Skip to content

Commit

Permalink
BLD: remove cython c source from git
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
juliantaylor committed Apr 5, 2014
1 parent a0794f6 commit c9fd634
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 26,576 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,6 @@ numpy/core/src/umath/umath_tests.c
numpy/distutils/__config__.py
numpy/linalg/umath_linalg.c
doc/source/reference/generated
# cythonized files
cythonize.dat
numpy/random/mtrand/mtrand.c
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ before_install:
- pip install nose
# pip install coverage
- python -V
- pip install --upgrade pip setuptools
- pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --use-wheel Cython
- sudo apt-get install -qq libatlas-dev libatlas-base-dev gfortran
- popd

Expand Down
12 changes: 12 additions & 0 deletions bscript
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ def _register_metadata(context):
context.register_metadata("is_released", _SETUP_PY.ISRELEASED)
context.register_metadata("full_version", full_version)

def _generate_cython():
print("Cythonizing sources")
cwd = os.path.abspath(os.path.dirname(__file__))
p = subprocess.call([sys.executable,
os.path.join(cwd, 'tools', 'cythonize.py'),
'numpy'],
cwd=cwd)
if p != 0:
raise RuntimeError("Running cythonize failed!")

@hooks.post_configure
def post_configure(context):
conf = context.waf_context
Expand All @@ -76,6 +86,8 @@ def post_configure(context):

blas_lapack.check_blas_lapack(context)

_generate_cython()

@hooks.pre_build
def pre_build(context):
_register_metadata(context)
Expand Down
Loading

0 comments on commit c9fd634

Please sign in to comment.