Commit c1c49f84 authored by Robert Bradshaw's avatar Robert Bradshaw

Complicated cythonize setup.

parent 2edd9045
...@@ -424,8 +424,8 @@ def create_extension_list(patterns, ctx=None, aliases=None): ...@@ -424,8 +424,8 @@ def create_extension_list(patterns, ctx=None, aliases=None):
# This is the user-exposed entry point. # This is the user-exposed entry point.
def cythonize(module_list, nthreads=0, aliases=None, **options): def cythonize(module_list, nthreads=0, aliases=None, **options):
c_options = CompilationOptions(options) c_options = CompilationOptions(**options)
cpp_options = CompilationOptions(options); cpp_options.cplus = True cpp_options = CompilationOptions(**options); cpp_options.cplus = True
ctx = c_options.create_context() ctx = c_options.create_context()
module_list = create_extension_list(module_list, ctx=ctx, aliases=aliases) module_list = create_extension_list(module_list, ctx=ctx, aliases=aliases)
deps = create_dependency_tree(ctx) deps = create_dependency_tree(ctx)
......
PYTHON setup.py build_ext --inplace
PYTHON -c "import a"
######## setup.py ########
from Cython.Build.Dependencies import cythonize
from distutils.core import setup
setup(
ext_modules = cythonize("*.pyx", include_path=['subdir'], compiler_directives={'cdivision': True}),
)
######## a.pyx ########
cimport x
include "y.pxi"
# cdivision from setup.py
def mod_int_c(int a, int b):
return a % b
assert mod_int_c(-1, 10) < 0
######## subdir/x.pxd ########
######## subdir/y.pxi ########
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