-
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
Add option "--exclude-dependencies" for "pip freeze" and "pip list" #10681
base: main
Are you sure you want to change the base?
Conversation
TBH I am not very keen on adding this to pip. The problem is that what counts as dependency and what does not is a fundamentally subjective issue that pip is never going to really get right. If this gets in, we will face endless “bug reports” telling us we ought to have include some packages as dependencies but do not, or (if we do something to change the functionality to freeze some packages that are depended by another, with whatever logic) we should not have include a package when this flag is supplied. I am really not interested in taking this free puppy. |
Good point. One reason I keep pushing the idea that "you can write a script to do this" is because it's (relatively) easy to write something that covers your specific needs, but as you say nearly impossible to write something that pleases everyone. I'm largely indifferent to this, but I would want a pretty strong consensus from the pip maintainers that this was worth having before we merged it. I suspect we won't get that. |
@uranusjr Can you elaborate on why couldn't |
One thing the current logic does not consider is extras. Should an environment containing |
I came here from google trying to find a way to make a reasonable requirements.txt. I don't use requirements.txt files often, but when I do I feel it is full of "spam". Say I install three packages in a venv for a small script, then if I later come back to my script and have forgotten which packages I needed to install I could run It is hard as a user to figure out what are the "hard" or direct requirements for a specific project, and what is third party dependencies. Very often when I find a cool script or project the requirements.txt contains versions that are incompatible with each other or other things that makes it impossible to run I want to see only the three packages that were explicitly installed, and I'm guessing this is what most other people that wants this feature wants too. So what I propose is to call it |
It’s not spam, the dependencies are included so the file more accurately reflects the environment. Without those lines, a requirements file would not be able to reproduce the installation when a new version of a dependency is released (and not excluded by the dependant, which is often the case). This kind of requirements files has its use cases, but |
Hello! I am an automated bot and I have noticed that this pull request is not currently able to be merged. If you are able to either merge the |
348d1cb
to
05a0e28
Compare
Update: Add commit: |
@lrustand |
1> Add option "--exclude-dependencies" for "pip freeze" and "pip list" as per feature request #10667 and #8981
Update:
2> Add option --user-requested for "pip freeze" and "pip list"
Refer
requested
status