Should setuptools version propagate to a module's __version__? If so, how?
John Ladasky
john_ladasky at sbcglobal.net
Sun May 10 16:00:03 EDT 2020
On Saturday, May 9, 2020 at 8:17:19 PM UTC-7, Cameron Simpson wrote:
> I also autopatch the module itself to
> set __version__ to match when I make that release tag.
Yes, that's exactly what the module I wrote for my company's internal use does. The official version number is hard-coded into setup.py. My setup.py opens my module's __init__.py, and patches the line that starts with "__version__ = ".
I can see that this approach is one of several suggested approaches described in the Python packaging guide. If I'm going to work with a package that eventually ends up on PyPI, I want to make sure that I don't do something unexpected or fragile.
More information about the Python-list
mailing list