Consistent versioning in Python project

0 votes
I have a Python project which has Sphinx documentation and distutils for publishing to Pip.

Both of these functions require a version (e.g., 0.4b3)

Is there a best practice for automatically maintaining a consistent version number across the various utilities which require version numbers?

Also, is there anything that integrates with git (e.g., via tags)?
May 22, 2019 in Python by ana1504.k
• 7,910 points
360 views

1 answer to this question.

0 votes
This is one of the most asked question on Python distutils mailing lists. You can import your module from setup.py as well as from conf.py and get module.version. This may not work depending on your imports, your use of 2to3 or other factors, in which case you can move your version to a text file and open that from your module, setup.py and conf.py.

I would suggest that it’s no great burden to update the version number in three places. It’s a minor step in the release process.
answered May 22, 2019 by SDeb
• 13,300 points

Related Questions In Python

0 votes
0 answers

how can i contribute to an existing open source project in python?

is there a different platform for this ...READ MORE

May 8, 2019 in Python by Waseem
• 4,540 points
128 views
+3 votes
7 answers

How can I rename a file in Python?

yes, you can use "os.rename" for that. ...READ MORE

answered Mar 31, 2018 in Python by DareDev
• 6,890 points
16,952 views
+2 votes
2 answers

How can I create a new file in Python?

You can try the below code which ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,440 points
581 views
+2 votes
3 answers

what is the practical use of polymorphism in Python?

Polymorphism is the ability to present the ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,440 points
3,161 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,906 views
0 votes
1 answer
0 votes
1 answer

Indentation of Python in Notepad++

To indent the block, select the entire ...READ MORE

answered Sep 18, 2018 in Python by SDeb
• 13,300 points
1,446 views
0 votes
1 answer

Print C format in Python

For printf- style formatting and special case ...READ MORE

answered Sep 18, 2018 in Python by SDeb
• 13,300 points
326 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP