-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Use Sean input's here and decide which or the cocktail of which options are the best fit for PDS python projects:
Sean message:
Let me look at how some of the "big name" Python projects handle it. Regardless, you want version as queryable metadata in the package's main module (i.e., init). But you also don't want to repeat yourself and have that version also in setup.py or setup.cfg.
Pillow (Python Imaging) keeps a src/PIL/_version.py and reads a version attribute using exec and compile; clever. But not compatible with the new everything-in-the-setup.cfg approach now recommended.
Requests (easy HTTP) does the same thing. Also not compatible with everything-in-the-setup.cfg.
Pandas (structured data) uses an add-on, "Versioneer". This is closer to the Maven approach, looks interesting; see https://github.com/warner/python-versioneer
Numpy (numeric and matrix) hard-codes it in setup.py then uses the PyCharm IDE to sub values into version.py from version.pyi 🤢
The Roundup Action (Yee-haw :face_with_cowboy_hat:) uses a VERSION.txt file that is read by init.py to provide the version attribute but also uses the file: syntax in the new setup.cfg support to provide by runtime and buildtime support.