Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0131218

Browse files
committed
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).
1 parent 12d0200 commit 0131218

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ def configuration(parent_package='',top_path=None):
149149

150150
def setup_package():
151151

152-
# Rewrite the version file everytime
153-
write_version_py()
154-
155152
# Perform 2to3 if needed
156153
local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
157154
src_path = local_path
@@ -167,11 +164,14 @@ def setup_package():
167164
if os.path.isfile(site_cfg):
168165
shutil.copy(site_cfg, src_path)
169166

170-
# Run build
171167
old_path = os.getcwd()
172168
os.chdir(src_path)
173169
sys.path.insert(0, src_path)
174170

171+
# Rewrite the version file everytime
172+
write_version_py()
173+
174+
# Run build
175175
from numpy.distutils.core import setup
176176

177177
try:

0 commit comments

Comments
 (0)