From 1429fcd6d7888c74b62f2da5e84e0669bca6bdca Mon Sep 17 00:00:00 2001 From: Connie Gao Date: Mon, 19 Oct 2015 15:28:36 -0400 Subject: [PATCH 1/2] Have setup.py read the version from a new version.py file --- setup.py | 4 +++- version.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 version.py diff --git a/setup.py b/setup.py index 347f5854e5..e3d2e8afe7 100644 --- a/setup.py +++ b/setup.py @@ -42,9 +42,11 @@ scripts = ['scripts/' + scriptName for scriptName in scripts] +# Read the version number +exec(open('version.py').read()) # Initiate the build and/or installation setup(name='RMG-database', - version='1.0.0', + version=__version__, description='Reaction Mechanism Generator Database', author='William H. Green and the RMG Team', author_email='rmg_dev@mit.edu', diff --git a/version.py b/version.py new file mode 100644 index 0000000000..2637849f2e --- /dev/null +++ b/version.py @@ -0,0 +1,3 @@ +# This file describes the version + +__version__ = '1.0.1' \ No newline at end of file From d9df7d3b16b90d972a396260896226eac65381fc Mon Sep 17 00:00:00 2001 From: Connie Gao Date: Mon, 19 Oct 2015 15:29:17 -0400 Subject: [PATCH 2/2] Have conda build get version from version.py and store build number based on commits --- build.sh | 6 +++++- meta.yaml | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 831b5b3a94..3d868a53e7 100644 --- a/build.sh +++ b/build.sh @@ -9,4 +9,8 @@ cp -R ${SRC_DIR}/input/* rmgdatabase/ # Create rmgrc file that points to this folder in site-packages/rmgpy directory cd ${SP_DIR} mkdir rmgpy -echo 'database.directory: ' ${PREFIX}/share/rmgdatabase > ${SP_DIR}/rmgpy/rmgrc \ No newline at end of file +echo 'database.directory: ' ${PREFIX}/share/rmgdatabase > ${SP_DIR}/rmgpy/rmgrc + +# Save version number stored in version.py +$PYTHON -c 'exec(open('version.py').read()); print __version__' > ${SRC_DIR}/__conda_version__.txt + diff --git a/meta.yaml b/meta.yaml index 66b94cdafb..a7e969dc82 100644 --- a/meta.yaml +++ b/meta.yaml @@ -1,14 +1,14 @@ # For conda build package: name: rmgdatabase - version: "1.0.1" + version: "0" # set by build.sh, which gets it from version.py file source: path: . build: - number: 1 - + number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }} # number of commits since last git tag (which should be last change to __version__) + requirements: build: - python