Most basic distutils test.
authorRobert Bradshaw <robertwb@math.washington.edu>
Sun, 12 Sep 2010 08:37:21 +0000 (01:37 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sun, 12 Sep 2010 08:37:21 +0000 (01:37 -0700)
Cython/Compiler/Dependencies.py
tests/build/basic_distutils.srctree [new file with mode: 0644]

index 448a694d9f3ded992ba0452c6037e79b6d55037a..13c8c85d7e1f43cef0c8347f78ffb8063844ae1d 100644 (file)
@@ -226,7 +226,10 @@ def create_dependency_tree(ctx):
         _dep_tree = DependencyTree(ctx)
     return _dep_tree
 
-def create_extension_list(filepatterns, ctx):
+def create_extension_list(filepatterns, ctx=None):
+    if ctx is None:
+        from Cython.Compiler.Main import Context
+        ctx = Context(["."])
     deps = create_dependency_tree(ctx)
     if isinstance(filepatterns, str):
         filepatterns = [filepatterns]
diff --git a/tests/build/basic_distutils.srctree b/tests/build/basic_distutils.srctree
new file mode 100644 (file)
index 0000000..625ac2a
--- /dev/null
@@ -0,0 +1,16 @@
+PYTHON setup.py build_ext --inplace
+PYTHON -c "import a"
+
+######## setup.py ########
+
+from distutils.core import setup
+from distutils.extension import Extension
+from Cython.Distutils import build_ext
+
+setup(
+  cmdclass = {'build_ext': build_ext},
+  ext_modules = [Extension("a", ["a.pyx"])],
+)
+
+######## a.pyx ########
+