<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-08-30 5:08 GMT-07:00 Erik Bray <span dir="ltr"><<a href="mailto:erik.m.bray@gmail.com" target="_blank">erik.m.bray@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I mean this sort of already exists but it's spelled:<br>
<br>
from setuptools import Distribution<br>
Distribution({'setup_requires'<wbr>: ['numpy'])<br>
<br>
Granted it's non-obvious and doesn't have the needed_for flag, which I<br>
like.  It's not entirely clear how needed_for would work though.  For<br>
example, what if the package you're requiring provides the command<br>
that you need that package to run?<br></blockquote><div><br></div><div>needed_for just textually checks sys.argv[1], and does so before the call to setup() itself happens, so that's not a problem.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The same can be done by subclassing commands, and there can be some<br>
corner cases where that gets extra tricky (Cython comes to mind).</blockquote><div><br></div><div>I personally don't like subclassing commands at all (it's not very composable -- what happens if two projects both attempt to subclass build_ext?).  But even then, how is Cython an issue?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'm glad you mentioned Daniel Holth's setup-requires hack.  Although I<br>
haven't used it myself directly I generally like the concept.<br></blockquote><div><br></div><div>I am not really a fan of PEP518 in general.  Basically, the idea of setup.py is that declarative languages are not sufficient to express a build system (and AFAICT this is always going to be the case for expressing, say, compiler flags for extensions), so I'd rather just accept that and stick everything in setup.py instead of adding more parameter files.  What if someone wants dynamic build dependencies?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Yeah, setup_requires is a mess, but I'd be skeptical of solving the<br>
problem by depending on any new features in setuptools :/<br></blockquote><div><br></div><div>This could also go into pip (perhaps a better solution now that pip is de-facto stdlib (via ensurepip))... we'll need something new somewhere anyways.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Best,<br>
Erik<br>
</blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">Best,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Antony</div></div>