Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG: Py3K: fix setup.py to work from a released tarball.

This was first fixed in commit 0131218 (but that broke the paver script), and
broken again in commit 13212a5. Should now work in both cases.
  • Loading branch information...
commit 87e12c1dfc90fae5d0a2576add0c1879df815740 1 parent 7d436cc
@rgommers rgommers authored
Showing with 27 additions and 14 deletions.
  1. +13 −1 pavement.py
  2. +14 −13 setup.py
View
14 pavement.py
@@ -77,7 +77,18 @@
sys.path.insert(0, os.path.dirname(__file__))
try:
setup_py = __import__("setup")
- FULLVERSION = setup_py.FULLVERSION
+ FULLVERSION = setup_py.VERSION
+ # This is duplicated from setup.py
+ if os.path.exists('.git'):
+ GIT_REVISION = setup_py.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 setup_py.ISRELEASED:
+ FULLVERSION += '.dev-' + GIT_REVISION[:7]
finally:
sys.path.pop(0)
@@ -474,6 +485,7 @@ def dmg(options):
ref = os.path.join(options.doc.destdir_pdf, "reference.pdf")
user = os.path.join(options.doc.destdir_pdf, "userguide.pdf")
if (not os.path.exists(ref)) or (not os.path.exists(user)):
+ import warnings
warnings.warn("Docs need to be built first! Can't find them.")
# Build the mpkg package
View
27 setup.py
@@ -94,19 +94,6 @@ def _minimal_ext_cmd(cmd):
# 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 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 +107,20 @@ def write_version_py(filename='numpy/version.py'):
if not release:
version = full_version
"""
+ # Adding the git rev number needs to be done inside write_version_py(),
+ # 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]
+
a = open(filename, 'w')
try:
a.write(cnt % {'version': VERSION,
Please sign in to comment.
Something went wrong with that request. Please try again.