[yt-dev] setup.py and cython

Matthew Turk matthewturk at gmail.com
Thu Feb 25 08:34:51 PST 2016


Hi Nathan,

Thanks for this.

On Wed, Feb 24, 2016 at 2:07 PM, Nathan Goldbaum <nathan12343 at gmail.com> wrote:
> 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.

I am personally okay with this; this is mostly the status quo, right?
"pip install yt" will add Cython, even if the .c files are there,
which I suppose isn't the worst thing in the world.

>
> 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.

Using setuptools helps out a lot with keeping things cleaner.

>
> 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
>
>
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>



More information about the yt-dev mailing list