-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
In an effort to obviate I've created rwt. If you're not familiar with rwt, take a look at that readme, which describes its purpose and gives some examples.easy_install (including implicit invocations such as setup_requires directives),
I've been using rwt in my daily workflows and I'm finding it quite powerful as a bootstrapping tool. However, it suffers from the same bootstrapping problem as setuptools and pip and virtualenv -- you have to install it before it's available to use it, so breaks the 'one step' workflows and adds a step to the instructions you give to someone (install python, install pip, install rwt, run this command).
I'd like to consider bundling rwt with pip as the pip run command. Since rwt is mostly a thin wrapper around pip and its parameters are passed directly to pip install, it makes sense as a pip command, and adding it as a command to pip would solve the bootstrapping issue. The functionality would also then be available during pip install, potentially eliminating the .setup_requires reliance on easy_install (or at least supporting an easy_install-free option)
So I'm proposing two things:
- Bundle
rwtaspip runand make it the pypa-endorsed mechanism for on-demand dependency resolution. Inpip installwhen building a source dist, invokesetup.pyusing rwt.
In the short term, the pip run command can be used for bootstrapping or test runs or whatever ad-hoc requirements one might have.
> pip run requests
...
>>> import requests
>>> requests.get(...)
discarded approach
Once this functionality has established more thoroughly and packagers can rely on all pip versions having this functionality, they could eliminate the reliance on distutils altogether and use whatever dependencies they require to build their package. Consider the pbr use case. Instead of invoking setuptools.setup() in their setup.py, they do this:
__requires__ = ['pbr']
import pbr
pbr.setup()
Where pbr might have dependencies on setuptools or distutils and and invoke that behavior, or perhaps they use another build system. Additionally, pip might be able to eschew the responsibility of supplying setuptools. If a script wants to rely on setuptools, it can require that:
__requires__ = ['setuptools']
import setuptools
setuptools.setup(...)
That last bit (pip without setuptools bundled) makes my heart glow a little. Think it over, maybe try out rwt, and let me know what you think. I plan to put together a PR after addressing any concerns.