summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2014-04-05 13:13:13 +0200
committerJulian Taylor <jtaylor.debian@googlemail.com>2014-04-05 14:35:28 +0200
commitc9fd63407da2a529c205402fd1bda5ea20eedce2 (patch)
tree177b04a1cabf326d31da5afd15568397123266a2 /setup.py
parenta0794f63d548e688e2eed76a9dc4e8df0ea33846 (diff)
downloadnumpy-c9fd63407da2a529c205402fd1bda5ea20eedce2.tar.gz
BLD: remove cython c source from git
Instead generate at build time. The generated sources are still part of the sdist. tools/cythonize.py is copied from SciPy with small changes to the configuration.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 0d367c1d5..6bb746955 100755
--- a/setup.py
+++ b/setup.py
@@ -180,6 +180,16 @@ class sdist_checked(sdist):
check_submodules()
sdist.run(self)
+def generate_cython():
+ cwd = os.path.abspath(os.path.dirname(__file__))
+ print("Cythonizing sources")
+ p = subprocess.call([sys.executable,
+ os.path.join(cwd, 'tools', 'cythonize.py'),
+ 'numpy/random'],
+ cwd=cwd)
+ if p != 0:
+ raise RuntimeError("Running cythonize failed!")
+
def setup_package():
src_path = os.path.dirname(os.path.abspath(sys.argv[0]))
old_path = os.getcwd()
@@ -225,6 +235,10 @@ def setup_package():
metadata['configuration'] = configuration
else:
from numpy.distutils.core import setup
+ cwd = os.path.abspath(os.path.dirname(__file__))
+ if not os.path.exists(os.path.join(cwd, 'PKG-INFO')):
+ # Generate Cython sources, unless building from source release
+ generate_cython()
metadata['configuration'] = configuration
try: