Should setuptools version propagate to a module's __version__? If so, how?

John Ladasky john_ladasky at sbcglobal.net
Fri May 8 21:07:18 EDT 2020


I just came across a package in PyPI which is in a state of neglect.  The official version on the PyPI page is 1.3.1 -- but the installed module reports its version as 1.2.0.  This is confusing.

There are several bugs in this package besides the mismatched version number.  I've forked a copy of the package on GitHub, and I will attempt a cleanup.

In another private package of my own, I performed an unsavory hack in setup.py.  There is a "version" argument to the setup() call.  I define "version" as a global variable in setup.py.  Before I call setup with this version number, I also modify the line of package code which defines its __version__.  This works for me, but it feels wrong.

Is there a recommended way to keep the internal reference and the setup.py reference in sync?  Is there any reason someone would NOT want these numbers to match?

Thanks for your input.


More information about the Python-list mailing list