Default to not using cython
This commit is contained in:
24
setup.py
24
setup.py
@@ -1,15 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
use_cython = True
|
||||
try:
|
||||
from Cython.Build import cythonize
|
||||
import Cython
|
||||
except ImportError:
|
||||
use_cython = False
|
||||
|
||||
if use_cython and Cython.__version__ < '0.19.1':
|
||||
use_cython = False
|
||||
use_cython = False
|
||||
|
||||
import pkg_resources
|
||||
setuptools_version = pkg_resources.get_distribution("setuptools").version
|
||||
@@ -23,10 +15,6 @@ import sys
|
||||
from buildutils import test_build, fetch_libcapnp, build_libcapnp, info
|
||||
from distutils.errors import CompileError
|
||||
from distutils.extension import Extension
|
||||
if use_cython:
|
||||
from Cython.Distutils import build_ext as build_ext_c
|
||||
else:
|
||||
from distutils.command.build_ext import build_ext as build_ext_c
|
||||
|
||||
_this_dir = os.path.dirname(__file__)
|
||||
|
||||
@@ -85,15 +73,15 @@ if force_bundled_libcapnp:
|
||||
force_system_libcapnp = "--force-system-libcapnp" in sys.argv
|
||||
if force_system_libcapnp:
|
||||
sys.argv.remove("--force-system-libcapnp")
|
||||
disable_cython = "--disable-cython" in sys.argv
|
||||
if disable_cython:
|
||||
sys.argv.remove("--disable-cython")
|
||||
use_cython = False
|
||||
force_cython = "--force-cython" in sys.argv
|
||||
if force_cython:
|
||||
sys.argv.remove("--force-cython")
|
||||
use_cython = True
|
||||
|
||||
if use_cython:
|
||||
from Cython.Distutils import build_ext as build_ext_c
|
||||
else:
|
||||
from distutils.command.build_ext import build_ext as build_ext_c
|
||||
|
||||
class build_libcapnp_ext(build_ext_c):
|
||||
def build_extension(self, ext):
|
||||
@@ -127,6 +115,8 @@ class build_libcapnp_ext(build_ext_c):
|
||||
return build_ext_c.run(self)
|
||||
|
||||
if use_cython:
|
||||
from Cython.Build import cythonize
|
||||
import Cython
|
||||
extensions = cythonize('capnp/lib/*.pyx')
|
||||
else:
|
||||
extensions = [Extension("capnp.lib.capnp", ["capnp/lib/capnp.cpp"],
|
||||
|
||||
Reference in New Issue
Block a user