Permalink
Browse files

BUG: setup.py: write version.py only after switching to Py3 build dir

This prevents importing non-2to3'ed numpy in Python 3 build, if
numpy/version.py exists for some reason but .git does not (e.g building
multiple Numpy versions from same source tree).
  • Loading branch information...
1 parent 12d0200 commit 0131218566f5daf215dab7bf5b46705145ac87c6 @pv pv committed Nov 23, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 setup.py
View
@@ -149,9 +149,6 @@ def configuration(parent_package='',top_path=None):
def setup_package():
- # Rewrite the version file everytime
- write_version_py()
-
# Perform 2to3 if needed
local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
src_path = local_path
@@ -167,11 +164,14 @@ def setup_package():
if os.path.isfile(site_cfg):
shutil.copy(site_cfg, src_path)
- # Run build
old_path = os.getcwd()
os.chdir(src_path)
sys.path.insert(0, src_path)
+ # Rewrite the version file everytime
+ write_version_py()
+
+ # Run build
from numpy.distutils.core import setup
try:

0 comments on commit 0131218

Please sign in to comment.