-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
Python version 2.7.12, Cython version 0.25.1
The following works:
from Cython.Distutils import build_ext # old_build_ext
from Cython.Distutils import Extension
setup(name='test',
cmdclass={'build_ext': build_ext},
ext_modules=[Extension('test', sources=['test.pyx'], language='c++',
cython_compile_time_env={'TEST_ENV': 123})])But the following doesn't:
from setuptools.command.build_ext import build_ext
from Cython.Distutils import Extension
class my_build_ext(build_ext, object):
def finalize_options(self):
from Cython.Build.Dependencies import cythonize
self.distribution.ext_modules[:] = cythonize(
self.distribution.ext_modules)
super(my_build_ext, self).finalize_options()
setup(name='test',
cmdclass={'build_ext': my_build_ext},
ext_modules=[Extension('test', sources=['test.pyx'], language='c++',
cython_compile_time_env={'TEST_ENV': 123})])cythonize fails with error Compile-time name 'TEST_ENV' not defined.
my_build_ext is basically a copy of Cython.Distutils.built_ext.new_build_ext but it doesn't seem to be compatible with the cython_compile_time_env parameter which is essential for my package.
I'm trying to make my package compatible with new_build_ext but it seems that this is a missing feature or am I missing something?
Reactions are currently unavailable