-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Error installing git+file VCS references #7650
Comments
This isn't a valid PEP 508 requirement (see https://www.python.org/dev/peps/pep-0508/#examples) -- it's a weird abomination of pip-specific VCS references and PEP 508. |
I don't think we should mix VCS and PEP 508 as proposed, since we'd be building on top of the standard, which would make pip non-compliant with it, in a very implementation-specific manner, which would defeat the point of the standardization. :) |
@pradyunsg how so? IIUC, PEP 508 builds on PEP 440 and the VCS form is documented in PEP 440. |
PEP 440 specifically says the URL should point to either an sdist or wheel. It’s possible to make a case for pip to support VCS requirements like this, but that would still be pip-specific, and not covered by PEP 440. |
This section of PEP 440 talks about VCS references. While it does only show git+https examples, I see nothing in it that excludes git+file references. |
So do we agree this is a bug? It comes from here in packaging: pip/src/pip/_vendor/packaging/requirements.py Lines 109 to 115 in 153e22a
The |
No... Note that OP's To quote examples from PEP 440:
Likewise, the following works:
(sorry that it says pip too many time, I literally copy-pasted the PEP's example) |
I do think we'd want to figure out a better error message here though. :) |
And, while there's definite back-and-forth going on here about what's actually the correct behavior, thanks for exploring and spotting this edge case. :) (also, yay 2:30am! I really should fix my body clock.) |
I'm really confused now. To be honest, this I always understood that PEP 440 direct references (name @ URL) were meant at some point to replace the legacy pip URL references (URL#egg=name). Is that correct? That is how I interpreted the PEP language saying "PEP's syntax "isn't quite the same as the existing VCS reference notation supported by pip". For instance that section explicitly notes that the package name goes in front instead of in the egg= fragment. It also says that a commit id must be provided in addition to a tag for better pinning. But I certainly does not read it as excluding other forms. For instance referring to a branch ( That is why this issue seemed so trivial to me at first. BTW in the meantime I had proposed a fix in packaging: pypa/packaging#264 |
It sounds to me like we might need a discussion on the Packaging discourse, with a view to clarifying the details of direct URLs, and updating the spec to be more precise on what the intended and supported uses are. Installing from VCS is, I believe, an entirely implementation-defined feature of pip. Short of standardising it (which would be a pretty big exercise) if we wanted to discuss VCS links in standards, we'd need to be viewing them as "a direct URL link to a PEP 517 source tree", but going much beyond that would need a lot more thought. FWIW, my view is that |
Yep. I had identified that PEP 440 needed some clarifications in that area while working on PEP 610. I'll consider tackling that when PEP 610 is out of Draft state, because I certainly don't have the mental energy to have two PEP discussions in flight at the same time - this is damn exhausting. |
Yea, this sounds about right to me and you basically said what I was gonna say. What @sbidoul is saying also makes sense to me, so we'd definitely want to have a broader discussion about the handling of direct URLs (and what's valid vs what's not and why). Further, rereading my earlier comments today, I realize that I likely came across as dismissive in my comments above, definitely which wasn't the intention. Sorry about that! I know that the web as a whole, isn't a great medium for conveying intent and should've been a bit more careful here. :) |
No worries, @pradyunsg. All that matter at the end of the day is that we reach a better collective understanding of these complex matters, and produce better specs and implementations. |
Lol, I know what you mean. One of the reasons things can move slowly in packaging standards is that everyone is permanently teetering on the brink of burnout. It's only due to the amazing commitment of the people who participate that we get as much done as we do. PS From the other various comments around, I suspect that the change to the direct URL spec might be as simple as changing it to say that PEP 440 defines nothing beyond the |
I think that's "just" a bug in the logic, and this doesn't need to be included in #8516. |
@pradyunsg If I'm not mistaken, pypa/packaging#684 fixed this issue so this can be closed, yes? |
@ImportTaste I added this to be closed by #12300 |
Environment
Description
The following installation of a PEP 440 local VCS reference fails: (using bash to reproduce)
Expected behavior
It should work, as does the pip-specific URL form:
$ pip install "git+file://$PWD/packaging#egg=packaging"
and as does the PEP 440 form with a remote VCS URL:
$ pip install "packaging @ git+https://github.com/pypa/packaging"
The text was updated successfully, but these errors were encountered: