diff --git a/source/single_source_version.rst b/source/single_source_version.rst index 0a80cf3b0b..54da6bd7b7 100644 --- a/source/single_source_version.rst +++ b/source/single_source_version.rst @@ -5,11 +5,11 @@ Single-sourcing the Project Version =================================== :Page Status: Complete -:Last Reviewed: 2015-09-08 +:Last Reviewed: 2015-12-03 -There are a few techniques to store the version in your project code without duplicating the value stored in -``setup.py``: +There are many techniques to maintain a single source of truth for the version +number of your project: #. Read the file in ``setup.py`` and parse the version with a regex. Example ( from `pip setup.py `_):: @@ -115,3 +115,8 @@ There are a few techniques to store the version in your project code without dup ``sample/__init__.py`` imports packages from ``install_requires`` dependencies, which will very likely not be installed yet when ``setup.py`` is run. + + +#. Keep the version number in the tags of a version control system (Git, Mercurial, etc) + instead of in the code, and automatically extract it from there using + `setuptools_scm `_.