[Cython] Cannot cythonize subclasses of setuptools.extension._Extension

Erik Bray erik.m.bray at gmail.com
Thu Apr 14 09:08:04 EDT 2016


On Wed, Apr 13, 2016 at 9:35 PM, Manuel Nuno Melo
<manuel.nuno.melo at gmail.com> wrote:
> Hello devs,
>
> I'm developing the setup.py for a scientific package, MDAnalysis (see PR
> #799). We depend on distutils and setuptool. Namely, we use
> setuptools.extension.Extension class for our extensions.
>
> Some older versions of setuptools (<18.0) do filename cythonization
> themselves upon initialization of the Extension object.
>
> Because we want to control name cythonization ourselves I try to directly
> use distutils.extension.Extension, which has none of setuptools'
> cythonization. However, this doesn't work because setuptools patches
> distutils, so that distutils.extension.Extension effectively becomes
> setuptools.extension.Extension.

I'm wondering what it is specifically you need to do in your
subclass--might it still be possible to do with a subclass of the
setuptools Extension?  Not saying I disagree with the overall idea,
but I also wonder if there isn't a better way.

Erik


More information about the cython-devel mailing list