<p dir="ltr">The subprocess is certainly more compatible. And pip does not really have an API besides the command line interface. But a lot of packages could probably work with "import pip". (Setup.py is already running in a pip subprocess when invoked by pip.) If you were pressed for time then you should be using wheel. ðŸ˜ºðŸŽ¡</p>

<p dir="ltr">Might be interesting to add a bit more affordance for installers that want to implement setup requires themselves and skip the bootstrapper.</p>
<p dir="ltr">On May 29, 2014 11:55 AM, "Erik Bray" <<a href="mailto:erik.m.bray@gmail.com">erik.m.bray@gmail.com</a>> wrote:<br>
><br>
> On Mon, May 19, 2014 at 9:24 PM, Daniel Holth <<a href="mailto:dholth@gmail.com">dholth@gmail.com</a>> wrote:<br>
> > Here's a short setup.py replacement that makes setup-requires work:<br>
> > <a href="https://bitbucket.org/dholth/setup-requires/src/">https://bitbucket.org/dholth/setup-requires/src/</a> . I'd appreciate a<br>
> > code review.<br>
> ><br>
> > Use by renaming your own package's setup.py to real-setup.py and<br>
> > copying this setup.py in its place.<br>
> ><br>
> > List only the requirements setup.py itself needs to run in the<br>
> > `setup-requires =` key of the `[metadata]` section of setup.cfg,<br>
> > one per line::<br>
> ><br>
> > Â  Â  [metadata]<br>
> > Â  Â  setup-requires = cffi<br>
> > Â  Â  Â  Â  pip<br>
> > Â  Â  Â  Â  pycparser >= 2.10<br>
> ><br>
> > (Only the name and required versions are allowed, not the full pip<br>
> > syntax of URLs to specific repositories. Instead, install internal<br>
> > setup-requires dependencies manually or set PIP_FIND_LINKS=... to point<br>
> > to the necessary repositories.)<br>
> ><br>
> > When run, setup-requires' setup.py checks that each distribution<br>
> > listed in setup-requires is installed; if not, it installs them into<br>
> > the ./setup-requires directory in a pip subprocess. Then real-setup.py<br>
> > continues to execute with the same arguments.<br>
> ><br>
> > Why a custom section in setup.cfg? Users are accustomed to editing<br>
> > setup.cfg to configure random things like unit tests, bdist_wheel<br>
> > etc.; this just adds a field instead of a new file. Unlike a .txt file<br>
> > it should be more intuitive that setup.cfg does not support the full<br>
> > pip requirements syntax.<br>
> ><br>
> > Please note that not every package installs correctly with pip -t.<br>
> ><br>
> > Now let's see some setup.py helper packages.<br>
><br>
> Thanks, I like the approach this takes of using pip instead of<br>
> easy-install, and caching all the setup_requires packages in the<br>
> setup-requires directory without cluttering the source root with eggs.<br>
> Â I'm not crazy about having to launch a separate process to do<br>
> this--do you think it can be done without that, by just importing pip<br>
> and using its API? Â Or did you find that to be too problematic?<br>
><br>
> I'm also not crazy about putting the real setup.py in a separate file,<br>
> but only because, in my case, I think it's likely to confuse some of<br>
> my co-developers. Â That said, I think that this approach could be<br>
> adapted to suit my needs.<br>
><br>
> Erik<br>
> _______________________________________________<br>
> Distutils-SIG maillist Â - Â <a href="mailto:Distutils-SIG@python.org">Distutils-SIG@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/distutils-sig">https://mail.python.org/mailman/listinfo/distutils-sig</a><br>
</p>