| | import sys |
| |
|
| | if 'setuptools' in sys.modules: |
| | try: |
| | from setuptools.command.build_ext import build_ext as _build_ext |
| | except ImportError: |
| | |
| | |
| | from distutils.command.build_ext import build_ext as _build_ext |
| | else: |
| | from distutils.command.build_ext import build_ext as _build_ext |
| |
|
| |
|
| | class new_build_ext(_build_ext, object): |
| | def finalize_options(self): |
| | if self.distribution.ext_modules: |
| | nthreads = getattr(self, 'parallel', None) |
| | nthreads = int(nthreads) if nthreads else None |
| | from Cython.Build.Dependencies import cythonize |
| | self.distribution.ext_modules[:] = cythonize( |
| | self.distribution.ext_modules, nthreads=nthreads, force=self.force) |
| | super(new_build_ext, self).finalize_options() |
| |
|
| | |
| | from .old_build_ext import old_build_ext as build_ext |
| |
|