numpy/numpy-1.6.0b1-import.patch
Orion Poplawski 81d563effe Update to 1.6.0b1
Build python3  module with python3
Add patch from upstream to fix build time import error
2011-04-01 08:56:44 -06:00

48 lines
1.6 KiB
Diff

diff --git a/setup.py b/setup.py
index 14e2d6f..74add2e 100755
--- a/setup.py
+++ b/setup.py
@@ -94,19 +94,11 @@ 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.
+# Full version info needs to be in setup.py namespace, otherwise it
+# can't be accessed from pavement.py at build time. Adding the git rev number
+# needs to be done inside write_version_py() however, otherwise the import of
+# numpy.version messes up the build under Python 3.
FULLVERSION = VERSION
-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"
-
-if not ISRELEASED:
- FULLVERSION += '.dev-' + GIT_REVISION[:7]
def write_version_py(filename='numpy/version.py'):
cnt = """
@@ -120,6 +112,18 @@ release = %(isrelease)s
if not release:
version = full_version
"""
+ FULLVERSION = VERSION
+ 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"
+
+ if not ISRELEASED:
+ FULLVERSION += '.dev-' + GIT_REVISION[:7]
+
a = open(filename, 'w')
try:
a.write(cnt % {'version': VERSION,