|
| 1 | +# make_version.py - generate version information |
| 2 | +# |
| 3 | +# Author: Clancy Rowley |
| 4 | +# Date: 2 Apr 2015 |
| 5 | +# Modified: Richard M. Murray, 28 Dec 2017 |
| 6 | +# |
| 7 | +# This script is used to create the version information for the python- |
| 8 | +# control package. The version information is now generated directly from |
| 9 | +# tags in the git repository. Now, *before* running setup.py, one runs |
| 10 | +# |
| 11 | +# python make_version.py |
| 12 | +# |
| 13 | +# and this generates a file with the version information. This is copied |
| 14 | +# from binstar (https://github.com/Binstar/binstar) and seems to work well. |
| 15 | +# |
| 16 | +# The original version of this script also created version information for |
| 17 | +# conda, but this stopped working when conda v3 was released. Instead, we |
| 18 | +# now use jinja templates in conda-recipe to create the conda information. |
| 19 | +# The current version information is used in setup.py, control/__init__.py, |
| 20 | +# and doc/conf.py (for sphinx). |
| 21 | + |
1 | 22 | from subprocess import check_output
|
2 | 23 | import os
|
3 | 24 |
|
@@ -33,19 +54,5 @@ def main():
|
33 | 54 | fd.write('__version__ = "%s.post%s"\n' % (version, build))
|
34 | 55 | fd.write('__commit__ = "%s"\n' % (commit))
|
35 | 56 |
|
36 |
| - # Write files for conda version number |
37 |
| - SRC_DIR = os.environ.get('SRC_DIR', '.') |
38 |
| - conda_version_path = os.path.join(SRC_DIR, '__conda_version__.txt') |
39 |
| - print("Writing %s" % conda_version_path) |
40 |
| - with open(conda_version_path, 'w') as conda_version: |
41 |
| - conda_version.write(version) |
42 |
| - |
43 |
| - conda_buildnum_path = os.path.join(SRC_DIR, '__conda_buildnum__.txt') |
44 |
| - print("Writing %s" % conda_buildnum_path) |
45 |
| - |
46 |
| - with open(conda_buildnum_path, 'w') as conda_buildnum: |
47 |
| - conda_buildnum.write(build) |
48 |
| - |
49 |
| - |
50 | 57 | if __name__ == '__main__':
|
51 | 58 | main()
|
0 commit comments