Skip to content

Commit

Permalink
Fix setupscons.py so that the version.py is correctly generated.
Browse files Browse the repository at this point in the history
  • Loading branch information
cournape committed May 16, 2009
1 parent e090679 commit 653653a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions setupscons.py
Expand Up @@ -38,6 +38,14 @@
# update it when the contents of directories change.
if os.path.exists('MANIFEST'): os.remove('MANIFEST')

sys.path.insert(0, os.path.dirname(__file__))
try:
setup_py = __import__("setup")
FULLVERSION = setup_py.FULLVERSION
write_version_py = setup_py.write_version_py
finally:
sys.path.pop(0)

# This is a bit hackish: we are setting a global variable so that the main
# numpy __init__ can detect if it is being loaded by the setup routine, to
# avoid attempting to load components that aren't built yet. While ugly, it's
Expand Down Expand Up @@ -84,6 +92,10 @@ def setup_package():
os.chdir(local_path)
sys.path.insert(0,local_path)

# Rewrite the version file everytime
if os.path.exists('numpy/version.py'): os.remove('numpy/version.py')
write_version_py()

try:
setup(
name = 'numpy',
Expand Down

0 comments on commit 653653a

Please sign in to comment.