[yt-dev] setup.py and cython

Nathan Goldbaum nathan12343 at gmail.com
Wed Feb 24 12:07:10 PST 2016


Hi all,

Recently we refactored our setup.py file to no longer use numpy.distutils.
One of the major benefits of this change is that we can now use the
`setup_requires` and `install_requires` argument of `setup` to
automatically install yt's dependencies when someone does "pip install yt"
or "python setup.py develop" in the yt repo.

Unfortunately, that doesn't quite work right now. In particular, if cython
isn't in install_requires, the installation will fail with a somewhat
confusing error (http://paste.yt-project.org/show/6266/).

I can fix this error (but unfortunately only for "pip install -e .
/path/to/yt-repository", not for "python setup.py develop") by including
cython in our install_requires, as in my open pull request:

https://bitbucket.org/yt_analysis/yt/pull-requests/2003/add-minimum-setuptools-version-and-cython/diff

On slack, Kacper objected to this approach, since we should only need
cython to generate the C source for our extensions for development, not
unconditionally. I see where he is coming from, but think that making it so
"pip install yt" installs cython isn't so bad, especially given that up
until recently our "setup.py" unconditionally imported cython and would
simply bail if it wasn't installed.

I see a few paths forward here:

1. Accept pull request 2003 and be ok with "pip install yt" installing
cython and "python setup.py develop" failing when cython isn't installed or
figure out how to fix that.

2. Stop using setuptools' support for building cython extensions and
instead rely on cython to do that. This means going back to unconditionally
depending on cython in our setup.py. This will also mean we are no longer
depending on setuptools>=18.0, which was releaed on June 2015, and many
users do not have installed in their python installations.

I'd love to hear about alternate approaches, if people have strong opinions
either way, of if my understanding of the situation is incorrect.

We should come to a consensus about this before releasing yt 3.3.

Thanks for your time,

Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20160224/fd0e87fc/attachment.htm>


More information about the yt-dev mailing list