summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorrgommers <ralf.gommers@googlemail.com>2011-03-04 00:13:08 +0800
committerrgommers <ralf.gommers@googlemail.com>2011-03-04 14:23:44 +0800
commit13212a5d7919f8668522a8251bea90b3a2b22894 (patch)
tree2f4e05446b8bc3133b01931cd1489e01cc29f8ac /setup.py
parent578cbb489bfad48b1611c4cfd5d89fc6ac9a7ce8 (diff)
downloadnumpy-13212a5d7919f8668522a8251bea90b3a2b22894.tar.gz
BUG: fix up setup.py and pavement.py so the binary builds work again.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/setup.py b/setup.py
index 216cda3de..318633beb 100755
--- a/setup.py
+++ b/setup.py
@@ -94,6 +94,20 @@ if os.path.exists('MANIFEST'): os.remove('MANIFEST')
# a lot more robust than what was previously being used.
builtins.__NUMPY_SETUP__ = True
+# Construct full version info. Needs to be in setup.py namespace, otherwise it
+# can't be accessed from pavement.py at build time.
+FULLVERSION = VERSION
+if not ISRELEASED:
+ if os.path.exists('.git'):
+ GIT_REVISION = git_version()
+ elif os.path.exists('numpy/version.py'):
+ # must be a source distribution, use existing version file
+ from numpy.version import git_revision as GIT_REVISION
+ else:
+ GIT_REVISION = "Unknown"
+
+ FULLVERSION += '.dev-' + GIT_REVISION[:7]
+
def write_version_py(filename='numpy/version.py'):
cnt = """
# THIS FILE IS GENERATED FROM NUMPY SETUP.PY
@@ -106,22 +120,10 @@ release = %(isrelease)s
if not release:
version = full_version
"""
- FULL_VERSION = VERSION
- if not ISRELEASED:
- if os.path.exists('.git'):
- GIT_REVISION = git_version()
- elif os.path.exists(filename):
- # must be a source distribution, use existing version file
- from numpy.version import git_revision as GIT_REVISION
- else:
- GIT_REVISION = "Unknown"
-
- FULL_VERSION += '.dev-' + GIT_REVISION[:7]
-
a = open(filename, 'w')
try:
a.write(cnt % {'version': VERSION,
- 'full_version' : FULL_VERSION,
+ 'full_version' : FULLVERSION,
'git_revision' : GIT_REVISION,
'isrelease': str(ISRELEASED)})
finally: