Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Version Control / Numbering (?) to Python Project

With my Java projects at present, I have full version control by declaring it as a Maven project. However I now have a Python project that I'm about to tag 0.2.0 which has no version control. Therefore should I come accross this code at a later date, I won't no what version it is.

How do I add version control to a Python project, in the same way Maven does it for Java?

like image 764
Federer Avatar asked Jul 31 '26 15:07

Federer


1 Answers

First, maven is a build tool and has nothing to do with version control. You don't need a build tool with Python -- there's nothing to "build".

Some folks like to create .egg files for distribution. It's as close to a "build" as you get with Python. This is a simple setup.py file.

You can use SVN keyword replacement in your source like this. Remember to enable keyword replacement for the modules that will have this.

__version__ = "$Revision$"

That will assure that the version or revision strings are forced into your source by SVN.

You should also include version keywords in your setup.py file.

like image 124
S.Lott Avatar answered Aug 02 '26 04:08

S.Lott



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!