summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorFernando Perez <fperez@fperez.org>2007-12-30 03:04:17 +0000
committerFernando Perez <fperez@fperez.org>2007-12-30 03:04:17 +0000
commit083ca64099268bc5967d25a15f9a4d26d750eb69 (patch)
treef30d625ff545b721477e77bcf5c03246f38511fe /setup.py
parentb4a25a4ae23890d04b993698a7e82f769ee748a5 (diff)
downloadnumpy-083ca64099268bc5967d25a15f9a4d26d750eb69.tar.gz
Modify the setup routine to indicate that it is being run via a system
global. This allows the main __init__ to detect the setup and avoid attempting to load things that aren't built yet. This is hackish, but the previously used method would fail if there was an existing system-wide numpy already installed, for example (which users might have no control over). There were frequent reports of problems with the previous method: - http://projects.scipy.org/pipermail/scipy-user/2007-November/014511.html - Tickets #561 and #565
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index d98fece35..b9acb647b 100755
--- a/setup.py
+++ b/setup.py
@@ -15,6 +15,7 @@ basic linear algebra and random number generation.
DOCLINES = __doc__.split("\n")
+import __builtin__
import os
import sys
@@ -37,6 +38,12 @@ Operating System :: MacOS
# update it when the contents of directories change.
if os.path.exists('MANIFEST'): os.remove('MANIFEST')
+# 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
+# a lot more robust than what was previously being used.
+__builtin__.__NUMPY_SETUP__ = True
+
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration