From 062d78758acfa5af48240d91eb242201736b89e4 Mon Sep 17 00:00:00 2001 From: Changaco Date: Thu, 3 Dec 2015 17:05:52 +0100 Subject: [PATCH] mention `setuptools_scm` in single_source_version.rst --- source/single_source_version.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 `_.