Skip to content

Commit c9fd634

Browse files
committed
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.
1 parent a0794f6 commit c9fd634

File tree

7 files changed

+231
-26576
lines changed

7 files changed

+231
-26576
lines changed

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,6 @@ numpy/core/src/umath/umath_tests.c
132132
numpy/distutils/__config__.py
133133
numpy/linalg/umath_linalg.c
134134
doc/source/reference/generated
135+
# cythonized files
136+
cythonize.dat
137+
numpy/random/mtrand/mtrand.c

Diff for: .travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ before_install:
3232
- pip install nose
3333
# pip install coverage
3434
- python -V
35+
- pip install --upgrade pip setuptools
36+
- pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --use-wheel Cython
3537
- sudo apt-get install -qq libatlas-dev libatlas-base-dev gfortran
3638
- popd
3739

Diff for: bscript

+12
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ def _register_metadata(context):
6161
context.register_metadata("is_released", _SETUP_PY.ISRELEASED)
6262
context.register_metadata("full_version", full_version)
6363

64+
def _generate_cython():
65+
print("Cythonizing sources")
66+
cwd = os.path.abspath(os.path.dirname(__file__))
67+
p = subprocess.call([sys.executable,
68+
os.path.join(cwd, 'tools', 'cythonize.py'),
69+
'numpy'],
70+
cwd=cwd)
71+
if p != 0:
72+
raise RuntimeError("Running cythonize failed!")
73+
6474
@hooks.post_configure
6575
def post_configure(context):
6676
conf = context.waf_context
@@ -76,6 +86,8 @@ def post_configure(context):
7686

7787
blas_lapack.check_blas_lapack(context)
7888

89+
_generate_cython()
90+
7991
@hooks.pre_build
8092
def pre_build(context):
8193
_register_metadata(context)

0 commit comments

Comments
 (0)