mirror of
https://github.com/capnproto/pycapnp.git
synced 2025-03-04 08:24:43 +01:00
Default to not using cython
This commit is contained in:
parent
20c501d3f1
commit
b2daf3911d
2 changed files with 8 additions and 18 deletions
|
@ -29,7 +29,7 @@ Install with `pip install pycapnp`. You can set the CC environment variable to c
|
|||
Or you can clone the repo like so:
|
||||
|
||||
git clone https://github.com/jparyani/pycapnp.git
|
||||
pip install ./pycapnp
|
||||
pip install --install-option '--force-cython' ./pycapnp
|
||||
|
||||
Note: for OSX, if using clang from Xcode 5, you will need to set `CFLAGS` like so:
|
||||
|
||||
|
|
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"],
|
||||
|
|
Loading…
Add table
Reference in a new issue