Permalink
Browse files

Fix setupscons.py so that the version.py is correctly generated.

  • Loading branch information...
1 parent e090679 commit 653653af44cb60a2d2840c4a1ce56fea6d5904b2 @cournape cournape committed May 16, 2009
Showing with 12 additions and 0 deletions.
  1. +12 −0 setupscons.py
View
@@ -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
@@ -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',

0 comments on commit 653653a

Please sign in to comment.