diff options
author | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
---|---|---|
committer | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
commit | bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch) | |
tree | 1d1df72c0541a59a81439842f46d95396d3e7189 /contrib/tools/cython/Cython/Distutils/build_ext.py | |
parent | 8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff) | |
download | ydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz |
add ymake export to ydb
Diffstat (limited to 'contrib/tools/cython/Cython/Distutils/build_ext.py')
-rw-r--r-- | contrib/tools/cython/Cython/Distutils/build_ext.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/contrib/tools/cython/Cython/Distutils/build_ext.py b/contrib/tools/cython/Cython/Distutils/build_ext.py new file mode 100644 index 0000000000..598bb4a89b --- /dev/null +++ b/contrib/tools/cython/Cython/Distutils/build_ext.py @@ -0,0 +1,25 @@ +import sys + +if 'setuptools' in sys.modules: + try: + from setuptools.command.build_ext import build_ext as _build_ext + except ImportError: + # We may be in the process of importing setuptools, which tries + # to import this. + 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) # -j option in Py3.5+ + 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() + +# This will become new_build_ext in the future. +from .old_build_ext import old_build_ext as build_ext |