Python Packaging - Version / Release


Code - Version and Code Versioning - Release in Python

This naming convention of compiled files allows compiled modules from different releases of Python to coexist.


All below properties of a build. ie:

All properties may be specified in the alias command. The alias command has default value that can be specified:

  • sitewide
  • or per-user

Projects may overwrite them.

Example with an alias called daily a daily job would run in each project directory daily


Any scheme can be chosen if it follows this comparison. See doc

>>> from pkg_resources import parse_version
>>> parse_version('') == parse_version('1.9a0dev')
>>> parse_version('2.1-rc2') < parse_version('2.1')
>>> parse_version('0.6a9dev-r41475') < parse_version('0.6a9')

This comparison is used by setuptools to tell which version is newer than the other.


setuptools allows you to “tag”:


  • pre-release tag such as “build” or “dev”
  • post-release tag, such as:
    • a build or revision number (–tag-build=STRING, -bSTRING)
    • build date (–tag-date, -d) - 8-character

You can add these tags by adding egg_info and the desired options to the command line ahead of the sdist or bdist commands that you want to generate a daily build or snapshot for.


Default tags may be specified in setup.cfg:


the rotate command lets you automatically delete all but the N most-recently-modified distributions matching a glob pattern.

Example: To build an egg whose version info includes ‘DEV-rNNNN’ (where NNNN is the most recent Subversion revision that affected the source tree), and then delete any egg files from the distribution directory except for the three that were built most recently. egg_info -rbDEV bdist_egg rotate -m.egg -k3



Update - Keep Python dependencies secure, up-to-date & compliant

Documentation / Reference

Powered by ComboStrap