On Tue, Jun 7, 2016 at 10:59 AM, Jeroen Demeyer <jdeme...@cage.ugent.be> wrote:
> On 2016-06-07 10:57, Erik Bray wrote:
>>
>> Yes, but it's a pain in the butt to do and would require support from
>> the setuptools end
>
>
> I must be missing something... setuptools allows declaring dependencies,
> right?

Yes but again there are build-time dependencies and run-time
dependencies and those are handled very differently.  The way it
handles build-time dependencies isn't great either, and has a famous
catch22 to it: Build-time dependencies, like all other metadata, are
declared via the call to setup().  Which means you can't use any of
those build-time dependencies prior to the setup() call.  There are
some hacky but usually effective workarounds to this though (the
simplest is to use a dummy Distribution(args={'setup_requires':
[...]}) call).

This is actually not a huge problem if you hook into setuptools using
entry_points which is basically the intent of the design.  But most
people don't know how to get that right, and it can still be fragile
for certain cases.  One day I hope to revive d2to1 [1] which provides
clean and consistent workarounds to all this mess.

With d2to1 you describe all the project's metadata in a text file
(setup.cfg), along with a stub for setup.py.  If you need to customize
anything about the build you can do so through hook functions which
can be provided in a separate module.  This includes processing
build-time requirements before any hooks are loaded, so those hooks
can come from an external module if desired.  For most packages it's
easy to provide simple hooks without having to write a lot of
boilerplate (subclassing commands, etc).

d2to1 is currently missing some features that it would nice to have
though, like better support for globbing (and perhaps regexps) for
filenames (for example extension modules currently require every
source file to be explicitly listed; silly!) and better support for
Cython-specific issues.  And a better name.

Erik

[1] https://github.com/embray/d2to1

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