A similar solution is provided by pbr · PyPI
(which also allows you to avoid keeping things like changelogs and
author lists in your source tree). Like SetupTools-SCM, PBR
calculates version numbers from tags, and can predict upcoming
version bumps from structured footers in commit messages in order to
more accurately form dev versions.
This package pip install tag2ver will update all your version numbers, tag, upload to remote (optional), and upload to PyPI (optional) in one hit. So it might take the pain of doing frequent releases away. It does for me - that’s why I wrote it!
Since you seem to want to do something similar to CalVer, I’ll shamelessly self promote as well: calver · PyPI will let you generate a version based on the current date.
Yep, that looks very similar to PBR’s environment variable solution
with PBR_VERSION completely overriding its usual version
autodetection logic (but much simpler of course because you don’t
have a separate and basically unnecessary setup_requires to deal
with):
Aha, yep thanks! I was apparently staring right at it in the
environment variables section of the readme and didn’t see it.
So anyway, both PBR and SetupTools-SCM have options to override
version numbers from an envvar instead of taking them from revision
control tags, but of course as shown it’s trivial to roll your own
version override from an envvar in a setup.py file too.