Add pip freeze option to report local directory instead of VCS link
See original GitHub issueThis is a follow up on https://github.com/pypa/pip/issues/4300 which has been automatically locked.
I was tricked by this as well and I am not sure about the reasoning about why pip freeze wants to be super smart and changes the location of a pip install -e to a version control path. Is there some way to turn this behaviour off via command line?
If I would want to specify a version controlled package in the pip freeze output, then I could simply use
pip install -e git+ssh://<package>
to install the package. If instead I use
pip install -e ./some/relative/local/path
I find it very strange that this path is suddenly replaced by a completely different path to a version control system.
Automatically converting local paths to version control paths is a bad idea in my opinion and it actually breaks the usability of pip freeze for us. Converting the path back to a local path afterwards is pretty much impossible, but it is necessary in our infrastructure.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
@uranusjr PEP 610 does have an effect on this issue, albeit indirect.
Actually, providing a VCS url to
-e
must be seen as a shortcut forgit clone project && pip install -e ./project
. That’s the way pip works today and I assume it will stay this way.For editable installs, PEP 610 says the local project directory must be recorded in
direct_url.json
(theeditable
flag is in thedir_info
structure). The reasoning is that editable is meant for ‘development mode’, and the important part for that is the local project location.So the way I see it is that
pip freeze
is indeed trying to be smart with editable installs to workaround the absence of PEP 610. When #7612 is merged, we can start encouraging people not to use-e
anymore for the purpose of making pip freeze work with VCS URLs.Under that light, this issue makes sense, and we will probably want to have a way for
pip freeze
to emit the project location and not try to infer the VCS url. Of course there will be the question of backward compatibility or if we want to add a new option etc.I’ve labelled this issue as an “deferred PR”.
This label is essentially for indicating that further discussion related to this issue should be deferred until someone comes around to make a PR. This does not mean that the said PR would be accepted - it has not been determined what the appropriate change should look like and that decision has been deferred until the PR is made.