Procházet zdrojové kódy

Fix setuptools Cython issue

Jonas Borgström před 13 roky
rodič
revize
6ffa7e851c

+ 1 - 0
fake_pyrex/Pyrex/Distutils/__init__.py

@@ -0,0 +1 @@
+# This is a python package

+ 6 - 0
fake_pyrex/Pyrex/Distutils/build_ext.py

@@ -0,0 +1,6 @@
+from distutils.command.build_ext import build_ext
+#
+#def build_ext(*args, **kw):
+#    from distutils import build_ext as build_ext_orig
+#    return build_ext_orig(*args, **kw)
+

+ 1 - 0
fake_pyrex/Pyrex/__init__.py

@@ -0,0 +1 @@
+# This is a python package

+ 11 - 3
setup.py

@@ -3,6 +3,13 @@
 import os
 import os
 import sys
 import sys
 from glob import glob
 from glob import glob
+
+try:
+    import Cython
+    sys.path.insert(0, os.path.join(os.path.dirname(__file__), "fake_pyrex"))
+except ImportError:
+    pass
+
 from setuptools import setup, Extension
 from setuptools import setup, Extension
 from setuptools.command.sdist import sdist
 from setuptools.command.sdist import sdist
 hashindex_sources = ['darc/hashindex.pyx', 'darc/_hashindex.c']
 hashindex_sources = ['darc/hashindex.pyx', 'darc/_hashindex.c']
@@ -18,9 +25,10 @@ try:
                                         cython_compiler.default_options)
                                         cython_compiler.default_options)
             sdist.__init__(self, *args, **kwargs)
             sdist.__init__(self, *args, **kwargs)
 
 
-        def run(self):
-            sdist.run(self)
-            self.filelist.append('darc/hashindex.c', 'darc/hashindex.h')
+        def make_distribution(self):
+            self.filelist.append('darc/hashindex.c')
+            self.filelist.append('darc/hashindex.h')
+            sdist.make_distribution(self)
 
 
 except ImportError:
 except ImportError:
     hashindex_sources[0] = hashindex_sources[0].replace('.pyx', '.c')
     hashindex_sources[0] = hashindex_sources[0].replace('.pyx', '.c')