-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Remove setuptools requirements in pip itself #1422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
+INT_MAX. As the maintainer the Chef tooling for pip I have huge issues every time pip changes its setuptools requirements, and the result is usually a non-functional system as you can't use pip to install the correct versions of things once it is broken. |
related: #1049 |
there is no PEP426/MEBs yet, so unclear what your plan is for this? |
I mean that pip can depend on setuptools for actually executing a setup.py (e.g. just assume that the setup.py will be using setuptools), but that pip itself no longer depends on setuptools. This is important for Wheel installs in particular. |
right, but how are you planning on implementing this idea of "pip can depend on setuptools for actually executing a setup.py". daniel's "autosetuptools", was one idea, where we vendor pkg_resources and we automatically install setuptools when we need to, but that has concerns. |
I don't know that we actually need to do anything. Pip will still require you to have setuptools installed in order to install from sdists. So for most people there will still be a "dependency" on setuptools. The difference being we've firewalled it off to only the setup.py execution so we don't run into problems where a broken setuptools means a broken pip where you have to manually install setuptools to fix it. |
So, what I understand you to be saying is that we vendor pkg_resources, and redirect all of our internal calls to pkg_resources to the vendored version. We could go further and remove/migrate some of those calls to avoid pkg_resources (possibly in favour of the already-vendored distlib) but this is optional, and probably not worth the risk. Users still need setuptools installed to install from sdist (because we inject setuptools into the setup.py invocation) but that's orthogonal to our internal use of pkg_resources. Is that a correct interpretation? If so, +1 from me. |
Yup that's basically what I mean. |
we talked over IRC as well. |
Maybe we should consider this for 1.5.1. There has been a number of folks grumbling about the setuptools 0.8 requirement such as http://stackoverflow.com/questions/20905350/latest-pip-fails-with-requires-setuptools-0-8-for-dist-info |
yea, I guess more people than we might have imagined are using a mixture of old setuptools/distribute + new pip. |
I just did a very simple proof of concept patch (replace "import pkg_resources" with "from pip._vendor import pkg_resources") and it seems to work for some basic tests. Also, with this patch, you can (almost!) create a standalone zipfile of pip which can be run from a bare Python interpreter. There's a problem with finding the SSL certificate (see below) but that can probably be sorted with a bit of effort.
|
The following
|
Right on. When I did it, it was pretty much as simple as "from pip.vendor import pkg_resources". This takes care of pip's need to enumerate installed packages. I also remember a special case or two intended to help with upgrading distribute or setuptools that kindof breaks here. On the other hand setuptools is only needed by the setup.py sub-processes and pip shouldn't vendor it. It will be more complicated to fix pip to get smarter about setup/build dependencies but that is a totally different issue. I will be very happy when "pip install setuptools" always works. |
pkg_resources also uses _markerlib, so that needs to be vendored, and pkg_resources amended, as well. |
I think pkg_resources also has its own markers implementation, used in a different place, that came later. But vendoring pkg_resources' vendored markerlib is fairly easy. See old patch :-) |
Moving this to 1.5.1 |
|
The above are in a virtualenv where I've uninstalled setuptools. I had to use |
Here's what happens when you force it to use a sdist:
|
I'll probably explicitly check for setuptools to be installed and give a better error message when installing from sdist, but it's working. |
Nice. Can you put this up as a PR when it's ready, and I'll have a play with it? |
Yup! |
The latest version of pip doesn't play nicely with the ancient version of setuptools which comes with Debian - it requires setuptools 0.8, and we only have 0.6. http://stackoverflow.com/questions/20905350/latest-pip-fails-with-requires-setuptools-0-8-for-dist-info In order to fix this, we use a script get_pip.bash from commonlib to securely install pip and then update to a nice new setuptools. It looks like this is going to be fixed in version 1.5.1 of pip: pypa/pip#1422
The latest version of pip doesn't play nicely with the ancient version of setuptools which comes with Debian - it requires setuptools 0.8, and we only have 0.6. http://stackoverflow.com/questions/20905350/latest-pip-fails-with-requires-setuptools-0-8-for-dist-info In order to fix this, we use a script get_pip.bash from commonlib to securely install pip and then update to a nice new setuptools. It looks like this is going to be fixed in version 1.5.1 of pip: pypa/pip#1422
The past two released of pip have had issues relating to the setuptools dependency. Ideally pip itself will no longer have any sort of dependency on setuptools, and the only actual dependency for setuptools will exist when a project uses setup.py.
The text was updated successfully, but these errors were encountered: