Merge https://github.com/cython/cython
[cython.git] / setup.py
index 8b9737826bb76a6e980c04aecceabd72cd79b569..ee9e4387efcac11e05b7f192baf0d31399382c74 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -70,6 +70,9 @@ else:
 # specific to setup
 setuptools_extra_args = {}
 
+# tells whether to include cygdb (the script and the Cython.Debugger package
+include_debugger = sys.version_info[:2] > (2, 5)
+
 if 'setuptools' in sys.modules:
     setuptools_extra_args['zip_safe'] = False
     setuptools_extra_args['entry_points'] = {
@@ -81,8 +84,12 @@ if 'setuptools' in sys.modules:
 else:
     if os.name == "posix":
         scripts = ["bin/cython"]
+        if include_debugger:
+            scripts.append('bin/cygdb')
     else:
         scripts = ["cython.py"]
+        if include_debugger:
+            scripts.append('cygdb.py')
 
 def compile_cython_modules(profile=False, compile_more=False, cython_with_refnanny=False):
     source_root = os.path.abspath(os.path.dirname(__file__))
@@ -93,7 +100,8 @@ def compile_cython_modules(profile=False, compile_more=False, cython_with_refnan
                         "Cython.Compiler.Parsing",
                         "Cython.Compiler.Visitor",
                         "Cython.Compiler.Code",
-                        "Cython.Runtime.refnanny"]
+                        "Cython.Runtime.refnanny",
+                        "Cython.Debugger.do_repeat",]
     if compile_more:
         compiled_modules.extend([
             "Cython.Compiler.ParseTreeTransforms",
@@ -249,6 +257,22 @@ setup_args.update(setuptools_extra_args)
 
 from Cython import __version__ as version
 
+packages = [
+    'Cython',
+    'Cython.Build',
+    'Cython.Compiler',
+    'Cython.Runtime',
+    'Cython.Distutils',
+    'Cython.Plex',
+    'Cython.Tests',
+    'Cython.Build.Tests',
+    'Cython.Compiler.Tests',
+]
+
+if include_debugger:
+    packages.append('Cython.Debugger')
+    packages.append('Cython.Debugger.Tests')
+
 setup(
   name = 'Cython',
   version = version,
@@ -289,17 +313,7 @@ setup(
   ],
 
   scripts = scripts,
-  packages=[
-    'Cython',
-    'Cython.Build',
-    'Cython.Compiler',
-    'Cython.Runtime',
-    'Cython.Distutils',
-    'Cython.Plex',
-
-    'Cython.Tests',
-    'Cython.Compiler.Tests',
-    ],
+  packages=packages,
 
   # pyximport
   py_modules = ["pyximport/__init__",