File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ Single-sourcing the Project Version
55===================================
66
77:Page Status: Complete
8- :Last Reviewed: 2015-09-08
8+ :Last Reviewed: 2015-12-03
99
1010
11- There are a few techniques to store the version in your project code without duplicating the value stored in
12- `` setup.py `` :
11+ There are many techniques to maintain a single source of truth for the version
12+ number of your project :
1313
1414#. Read the file in ``setup.py `` and parse the version with a regex. Example (
1515 from `pip setup.py <https://github.com/pypa/pip/blob/1.5.6/setup.py#L33 >`_)::
@@ -115,3 +115,8 @@ There are a few techniques to store the version in your project code without dup
115115 ``sample/__init__.py `` imports packages from ``install_requires ``
116116 dependencies, which will very likely not be installed yet when ``setup.py ``
117117 is run.
118+
119+
120+ #. Keep the version number in the tags of a version control system (Git, Mercurial, etc)
121+ instead of in the code, and automatically extract it from there using
122+ `setuptools_scm <https://pypi.python.org/pypi/setuptools_scm >`_.
You can’t perform that action at this time.
0 commit comments