Issue #15: resovled by using setuptools_cython
authorGuy Rozendorn <guy@rzn.co.il>
Tue, 2 Apr 2013 14:46:45 +0000 (17:46 +0300)
committerGuy Rozendorn <guy@rzn.co.il>
Tue, 2 Apr 2013 14:46:45 +0000 (17:46 +0300)
setup.py

index f10578217de027b98945ff1b46ea347a728308d8..f6e25b75e92b4343bb47553813be3fc7d91f92a3 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -20,13 +20,12 @@ import os as _os
 import sys as _sys
 import platform
 
-
-def build_ext_workaround(*args, **kwargs):
-    # We want to use Cython to build the ext, but if it is not installed,
-    # We need to tell easy_instll it is required
-    from Cython.Distutils import build_ext as _build_ext
-    return _build_ext(*args, **kwargs)
-
+# setuptools DWIM monkey-patch madness
+# http://mail.python.org/pipermail/distutils-sig/2007-September/thread.html#8204
+import sys
+if 'setuptools.extension' in sys.modules:
+    m = sys.modules['setuptools.extension']
+    m.Extension.__dict__ = m._Extension.__dict__
 
 package_name = 'kmod'
 
@@ -58,8 +57,7 @@ setup(
     provides=[package_name],
     maintainer="Andy Grover",
     maintainer_email="agrover@redhat.com",
-    cmdclass = {'build_ext': build_ext_workaround},
     ext_modules=ext_modules,
     install_requires=["Cython"],
-    setup_requires=["Cython"],
+    setup_requires=["setuptools_cython"],
     )