Skip debugger tests for pre-2.5 python versions and make them 2.5 compatible
[cython.git] / setup.py
index e1f28e6d0cfd877ea75d03bfc52d7b1dd1d2665f..0a0584dd673a4943e4b2c4507ab2cd5ca5122097 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, 4)
+
 if 'setuptools' in sys.modules:
     setuptools_extra_args['zip_safe'] = False
     setuptools_extra_args['entry_points'] = {
@@ -80,9 +83,13 @@ if 'setuptools' in sys.modules:
     scripts = []
 else:
     if os.name == "posix":
-        scripts = ["bin/cython", "bin/cygdb"]
+        scripts = ["bin/cython"]
+        if include_debugger:
+            scripts.append('bin/cygdb')
     else:
-        scripts = ["cython.py", "cygdb.py"]
+        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__))
@@ -247,6 +254,20 @@ 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.Compiler.Tests',
+]
+
+if include_debugger:
+    packages.append('Cython.Debugger')
+
 setup(
   name = 'Cython',
   version = version,
@@ -287,17 +308,7 @@ setup(
   ],
 
   scripts = scripts,
-  packages=[
-    'Cython',
-    'Cython.Build',
-    'Cython.Compiler',
-    'Cython.Runtime',
-    'Cython.Distutils',
-    'Cython.Plex',
-    'Cython.Debugger',
-    'Cython.Tests',
-    'Cython.Compiler.Tests',
-    ],
+  packages=packages,
 
   # pyximport
   py_modules = ["pyximport/__init__",