Commit 107fc454 authored by Stefan Behnel's avatar Stefan Behnel

Merge branch 'master' into release

parents e2d55c56 c4c9683e
......@@ -79,7 +79,7 @@ Bugs fixed
* The exception handling in generators and coroutines under CPython 3.7 was adapted
to the newly introduced exception stack. Users of Cython 0.28 who want to support
Python 3.7 are encouraged to upgrade to 0.29 to avoid potentially incorrect error
reporting and tracebacks.
reporting and tracebacks. (Github issue #1958)
* Crash when importing a module under Stackless Python that was built for CPython.
Patch by Anselm Kruis. (Github issue #2534)
......
# tag: numpy
# tag: numpy_old
# You can ignore the previous line.
# It's for internal testing of the cython documentation.
......
......@@ -135,6 +135,7 @@ def get_distutils_distro(_cache=[]):
EXT_DEP_MODULES = {
'tag:numpy': 'numpy',
'tag:numpy_old': 'numpy',
'tag:pythran': 'pythran',
'tag:setuptools': 'setuptools.sandbox',
'tag:asyncio': 'asyncio',
......@@ -254,12 +255,19 @@ def update_linetrace_extension(ext):
return ext
def update_numpy_extension(ext):
def update_old_numpy_extension(ext):
update_numpy_extension(ext, set_api17_macro=False)
def update_numpy_extension(ext, set_api17_macro=True):
import numpy
from numpy.distutils.misc_util import get_info
ext.include_dirs.append(numpy.get_include())
if set_api17_macro:
ext.define_macros.append(('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION'))
# We need the npymath library for numpy.math.
# This is typically a static-only library.
for attr, value in get_info('npymath').items():
......@@ -391,6 +399,7 @@ EXCLUDE_EXT = object()
EXT_EXTRAS = {
'tag:numpy' : update_numpy_extension,
'tag:numpy_old' : update_old_numpy_extension,
'tag:openmp': update_openmp_extension,
'tag:cpp11': update_cpp11_extension,
'tag:trace' : update_linetrace_extension,
......
# ticket: 155
# tag: numpy
# tag: numpy_old
"""
>>> myfunc()
......
# tag: numpy
# tag: numpy_old
# tag: openmp
cimport cython
......
# tag: numpy
# tag: numpy_old
cimport numpy as np
cimport cython
......
# tag: numpy
# tag: numpy_old
# cannot be named "numpy" in order to not clash with the numpy module!
cimport numpy as np
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment