Add pxd packages in Includes to distribution creation
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Fri, 12 Mar 2010 20:03:32 +0000 (21:03 +0100)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Fri, 12 Mar 2010 20:03:32 +0000 (21:03 +0100)
setup.py

index 07e3531c0ae1eaa1cacca1f5bd7e25fa4de724df..6a3acdb9ae583ddfbc503bce0620f9a947ad59ed 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -37,23 +37,32 @@ if sys.version_info[0] >= 3:
     build_py.fixer_names = fixers
     add_command_class("build_py", build_py)
 
+pxd_packages = ['cpython', 'libc', 'libcpp']
 
 if sys.version_info < (2,4):
     install_base_dir = get_python_lib(prefix='')
     import glob
+    patterns = ['Cython/Includes/*.pxd',
+                'Cython/Plex/*.pxd',
+                'Cython/Compiler/*.pxd',
+                'Cython/Runtime/*.pyx']
+    for p in pxd_packages:
+        patterns.append('Cython/Includes/%s/*.pxd' % p)
+        patterns.append('Cython/Includes/%s/__init__.pyx' % p)
     setup_args['data_files'] = [
         (os.path.dirname(os.path.join(install_base_dir, pattern)),
          [ f for f in glob.glob(pattern) ])
-        for pattern in ['Cython/Includes/*.pxd',
-                        'Cython/Plex/*.pxd',
-                        'Cython/Compiler/*.pxd',
-                        'Cython/Runtime/*.pyx']
+        for pattern in patterns
         ]
 else:
-    setup_args['package_data'] = {'Cython' : ['Includes/*.pxd',
-                                              'Plex/*.pxd',
-                                              'Compiler/*.pxd',
-                                              'Runtime/*.pyx']}
+    patterns = ['Includes/*.pxd',
+                'Plex/*.pxd',
+                'Compiler/*.pxd',
+                'Runtime/*.pyx']
+    for p in pxd_packages:
+        patterns.append('Includes/%s/*.pxd' % p)
+        patterns.append('Includes/%s/__init__.pyx' % p)
+    setup_args['package_data'] = {'Cython' : patterns}
 
 # This dict is used for passing extra arguments that are setuptools 
 # specific to setup