On Tue, Jun 7, 2016 at 11:20 AM, William Stein <wst...@gmail.com> wrote:
> On Tue, Jun 7, 2016 at 11:18 AM, Nathan Dunfield <nat...@dunfield.info> wrote:
>> Erik,
>>
>> Interesting, I didn't realize that build-time (as opposed to run-time)
>> dependencies were even *possible* with setuptools, even if it does require a
>> hack.  With SnapPy, we just ship the Cython-generated C/C++-files in the
>> tarball that we post on PyPI.
>
> I was going to post that my understanding is that shipping
> Cython-generated files is the current standard way of shipping Cython
> code (for better or worse).

No, In fact if that were the case, cythonize would also be run as a
sub-command of `setup.py sdist` (ensuring that the C sources are
always included in source distributions without having to remember to
manually write `setup.py build_ext` first--I mistake I've seen a few
times.

One also has to cobble together a way to switch between compiling from
the C sources (if they're already available) and running and not
require Cython in that case.  There's no out-of-the box solution for
this in either Cython or setuptools.  Might be worth agitating for.

>>  It adds a bit to the tarball's size, but is
>> more robust than requiring Cython. For example, there are sometimes
>> incompatibilities between different versions of Cython, and it's a bit rude
>> to force the end-user to upgrade or downgrade their version of Cython just
>> so they can install some other package.
>>
>> In our setup.py we use code like:
>>
>> # If have Cython, check that .c files are up to date:
>>
>> try:
>>
>>     from Cython.Build import cythonize
>>
>>     if 'clean' not in sys.argv:
>>
>>         targets = ['planarity_src/planarity.pyx', pmap_dir +
>> 'planarmap.pyx']
>>
>>         cythonize(targets)
>>
>> except ImportError:
>>
>>     pass
>>
>>
>> Even if the user has the "wrong" Cython, the PyPI tarball will still build
>> since the Cythonized files are up-to-date.
>>
>>
>> Best,
>>
>> Nathan
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to sage-devel+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-devel@googlegroups.com.
>> Visit this group at https://groups.google.com/group/sage-devel.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> William (http://wstein.org)
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to