Get version from git tags (through pbr)
问题 I use pbr for packaging. It takes the version from git tags and applies that to setup.py Now I also want to have the version available inside the package. For instance to have a __version__ attribute. Can I use the pbr library for this? There is another library: versioneer that also extracts the version from the git tags, but that would add an extra requirement. I would prefer to get this functionality from pbr 回答1: After properly setting up for setuptools and pbr , here are several ways to