pip: Error installing git+file VCS references
Environment
- pip version: 20.0
- Python version: 3.7
- OS: linux
Description
The following installation of a PEP 440 local VCS reference fails: (using bash to reproduce)
$ git clone https://github.com/pypa/packaging
...
$ pip install "packaging @ git+file://$PWD/packaging"
ERROR: Invalid requirement: 'packaging @ git+file:///home/.../packaging'
Hint: It looks like a path. File 'packaging @ git+file:///home/.../packaging' does not exist.
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"
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 19 (18 by maintainers)
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
packaging @ git+file://$PWD/packaging
looks like a perfectly good direct URL to me, and should be acceptable wherever pip accepts a direct URL. But having said that, the PEP says “the exact URLs and targets supported will be tool dependent” - in principle,pip @ mailto:pip@python.org?Subject="Please send me pip"
is a valid PEP 440 direct reference 😉@ImportTaste I added this to be closed by #12300
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.