robertwb / issues-import-test

0 stars 0 forks source link

Please import Cython.Compiler in Cython.Distutils.bdist_ext #92

Open robertwb opened 7 years ago

robertwb commented 7 years ago

Reported by nikratio on 12 Aug 2015 20:44 UTC Setuptools tries to import Cython.Distutils.bdist_ext to determine if Cython is available (cf https://bitbucket.org/pypa/setuptools/src/626b55107cf96e6872a859f5c759458b01907d26/setuptools/command/build_ext.py?at=default#build_ext.py-13). However, this method is unreliable: if Cython has been installed for the regular Python interpreter, but setup.py runs under the debug interpreter, importing Cython.Distutils.bdist_ext succeeds (because it involves only .py files), but importing Cython.Compiler fails (because there is no extension module for the debugging interpreter). This then causes errors when setuptools tries to use Cython.

Would it be possible to import Cython.Compiler in Cython.Distutils.bdist_ext, so that it's assured that Cython is installed and working if the import of build_ext succeeds?

Migrated-From: http://trac.cython.org/ticket/859