Complicated cythonize setup.
authorRobert Bradshaw <robertwb@math.washington.edu>
Sun, 5 Dec 2010 10:04:11 +0000 (02:04 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sun, 5 Dec 2010 10:04:11 +0000 (02:04 -0800)
Cython/Build/Dependencies.py
tests/build/cythonize_options.srctree [new file with mode: 0644]

index 07a23ea24a846ccbc4bfd698aa63cfd2667953e1..65f732f841a23c7e174d8a765c5b041f6d183035 100644 (file)
@@ -424,8 +424,8 @@ def create_extension_list(patterns, ctx=None, aliases=None):
 
 # This is the user-exposed entry point.
 def cythonize(module_list, nthreads=0, aliases=None, **options):    
-    c_options = CompilationOptions(options)
-    cpp_options = CompilationOptions(options); cpp_options.cplus = True
+    c_options = CompilationOptions(**options)
+    cpp_options = CompilationOptions(**options); cpp_options.cplus = True
     ctx = c_options.create_context()
     module_list = create_extension_list(module_list, ctx=ctx, aliases=aliases)
     deps = create_dependency_tree(ctx)
diff --git a/tests/build/cythonize_options.srctree b/tests/build/cythonize_options.srctree
new file mode 100644 (file)
index 0000000..56e38be
--- /dev/null
@@ -0,0 +1,29 @@
+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 ########
+