-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Make pip freeze respect the command that was used to install a local editable package #6199
Comments
Relative paths in requirements files are problematic because then the file would only be valid when pip is run from a particular directory. For example, see #6112 ("Requirements file which contains
It seems like what you're suggesting would cause the output to vary because the path to the project would depend on what directory you run pip freeze from. With an absolute path, the output of pip freeze will be the same no matter which directory you run it from. Also, whether a path or URL is outputted shouldn't depend on where you run the command from. That's a function of whether the project is under version control, and whether the repo has a remote URL or not. |
A couple other comments now that I understand better what you're suggesting (at first I thought you just wanted the requirements paths to be relative): First, an editable install doesn't currently record anywhere how it was installed, so pip wouldn't have access to the path
Second, if pip did what you suggested, it seems like this could easily result in requirements files that don't work from any directory. For example, if you were in a directory
Then the requirements file would look like--
But this wouldn't work from any directory because the two relative paths would be relative to different directories. |
@cjerdonek Thanks for the response. I think you've already considered the issue I'm facing in your discussion of #4300; feel free to close this. |
@csimmons0 Okay, thanks for your suggestion and for your understanding. FWIW, I agree with you that absolute paths aren't the best for certain scenarios (e.g. checking in to source control for sharing with others). Perhaps for your use case you can have a post-processing step where you replace the absolute paths with relative paths as desired. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Environment
Description
Pip freeze does not respect the way that a local editable package was installed. I thought that 19.0 was supposed to fix this issue, but it doesn't.
Expected behavior
After I run "pip install -e ./generated/sisu_backend/", I expect the output of "pip freeze" to include the line "-e ./generated/sisu_backend/". Instead, the output of pip freeze varies depending on where I am when I run the commands.
If I am outside of any repository:
If I am inside a repository that does not have a remote set:
If I am inside my local copy of the sisudata/core repository:
What I want is just the following:
For some context, my company has a Flask app in this sisudata/core repo, and that Flask app has this sisu_backend package, which is generated using openapi-generator, as one of its dependencies. This generated code is checked into the repo.
How to Reproduce
Do the following outside of any VCS, inside a git repo with no remote set, and inside a git repo with a remote set:
Output
Attached are the results of the command below run in each of the three contexts outlined above:
piptrace_not_in_a_repo.txt
piptrace_in_a_repo_no_remote.txt
piptrace_in_a_repo.txt
The text was updated successfully, but these errors were encountered: