diff options
author | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-04-05 13:13:13 +0200 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-04-05 14:35:28 +0200 |
commit | c9fd63407da2a529c205402fd1bda5ea20eedce2 (patch) | |
tree | 177b04a1cabf326d31da5afd15568397123266a2 /setup.py | |
parent | a0794f63d548e688e2eed76a9dc4e8df0ea33846 (diff) | |
download | numpy-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-x | setup.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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: |