diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-06-10 12:33:54 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-06-10 12:33:54 -0400 |
commit | a811c089a4362c0dc6c4a84b708953dde9ebdbf8 (patch) | |
tree | e3affecd9b7ed8266bc61624d686d7a49ad2671f /setuptools/command/build_ext.py | |
parent | c1d71724e6f73eec022cb86161cf777ff37b009b (diff) | |
download | external_python_setuptools-a811c089a4362c0dc6c4a84b708953dde9ebdbf8.tar.gz external_python_setuptools-a811c089a4362c0dc6c4a84b708953dde9ebdbf8.tar.bz2 external_python_setuptools-a811c089a4362c0dc6c4a84b708953dde9ebdbf8.zip |
Detect Cython later in the build process, allowing the library to be specified in setup_requires. Fixes #288.
Diffstat (limited to 'setuptools/command/build_ext.py')
-rw-r--r-- | setuptools/command/build_ext.py | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py index e4b2c593..92e4a189 100644 --- a/setuptools/command/build_ext.py +++ b/setuptools/command/build_ext.py @@ -11,8 +11,8 @@ import itertools from setuptools.extension import Library try: - # Attempt to use Pyrex for building extensions, if available - from Pyrex.Distutils.build_ext import build_ext as _build_ext + # Attempt to use Cython for building extensions, if available + from Cython.Distutils.build_ext import build_ext as _build_ext except ImportError: _build_ext = _du_build_ext @@ -42,7 +42,6 @@ elif os.name != 'nt': if_dl = lambda s: s if have_rtld else '' - class build_ext(_build_ext): def run(self): """Build extensions in build directory, then copy if --inplace""" @@ -74,15 +73,6 @@ class build_ext(_build_ext): if ext._needs_stub: self.write_stub(package_dir or os.curdir, ext, True) - if _build_ext is not _du_build_ext and not hasattr(_build_ext, - 'pyrex_sources'): - # Workaround for problems using some Pyrex versions w/SWIG and/or 2.4 - def swig_sources(self, sources, *otherargs): - # first do any Pyrex processing - sources = _build_ext.swig_sources(self, sources) or sources - # Then do any actual SWIG stuff on the remainder - return _du_build_ext.swig_sources(self, sources, *otherargs) - def get_ext_filename(self, fullname): filename = _build_ext.get_ext_filename(self, fullname) if fullname in self.ext_map: @@ -176,6 +166,7 @@ class build_ext(_build_ext): return _build_ext.get_export_symbols(self, ext) def build_extension(self, ext): + ext._convert_pyx_sources_to_lang() _compiler = self.compiler try: if isinstance(ext, Library): |