8000 Merge pull request #167 from murrayrm/fix_conda · python-control/python-control@9457031 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9457031

Browse files
authored
Merge pull request #167 from murrayrm/fix_conda
Update conda-recipe for use with conda-build >= 3.0
2 parents 7d8bc65 + 087046f commit 9457031

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

conda-recipe/meta.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
package:
22
name: control
3+
version: {{ GIT_DESCRIBE_TAG }}
4+
5+
source:
6+
git_url: ../
37

48
build:
9+
number: {{ GIT_DESCRIBE_NUMBER }}
510
script:
611
- cd $RECIPE_DIR/..
712
- $PYTHON make_version.py

make_version.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
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+
122
from subprocess import check_output
223
import os
324

@@ -33,19 +54,5 @@ def main():
3354
fd.write('__version__ = "%s.post%s"\n' % (version, build))
3455
fd.write('__commit__ = "%s"\n' % (commit))
3556

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-
5057
if __name__ == '__main__':
5158
main()

0 commit comments

Comments
 (0)
0