-
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
pip freeze does case sensitive comparsion #5716
Comments
@cjerdonek I will like to work on this issue. Let me know, when we have classified this as a bug or a feature request. |
Hey @abs51295! I'd consider this a bug since this is essentially a case where pip is not normalizing the given package names correctly. |
Thanks @pradyunsg I will send a fix soon! 😄 |
@pradyunsg how should the fix look like? Should we change the dependency names to lower case explicitly? |
There's a normalize_name or a canonical_name (or similarly named) function in pip's codebase, which should be used to normalize names. (sorry I missed you on IRC - I slept off with the client open) |
Thanks @pradyunsg will look into this. ( I don't see you on #pypa-dev anymore on IRC) |
@pradyunsg I found this: https://github.com/pypa/pip/blob/master/src/pip/_vendor/packaging/requirements.py#L86-L89. Looks like this requires a discussion. |
Hey @abs51295! I was away from a PC for most of the time over the weekend. I've not looked carefully but you'd want to start looking here: https://github.com/pypa/pip/blob/b13cee6388adea5ddaf1ddb982beeec37d07ffda/src/pip/_internal/commands/freeze.py Basically, whenever pip's getting information from the user/distlib/pkg_resources, you'd want to normalize the name using
That's a vendored library (packaging) and while I do think that change needs discussion, the change in pip doesn't and they're fairly separate. |
@pradyunsg I did that, but why I was referring to the https://github.com/pypa/pip/blob/master/src/pip/_vendor/packaging/requirements.py#L86-L89, is because of the following:
|
@pradyunsg any updates on this? |
Sorry, I haven't taken a deeper look yet. Real life has kept me more than busy lately. I'll try to take a look today or this weekend. Feel free to ping me again in that time. |
Thanks. Will wait for your reply 🙂 |
@pradyunsg any updates? |
any updates? hope it badly to regenerate requirements.txt
The following requirements were added by pip freeze:
|
@pradyunsg @cjerdonek I have created #6857 in respect to this. Please have a look. Thanks. |
Environment
Description
Running
pip freeze -l -r requirements.txt
does a case sensitive comparison with dependencies mentioned inrequirements.txt
.Expected behavior
Running
pip freeze -l -r requirements.txt
should do case insensitive comparison with dependencies mentioned inrequirements.txt
or at least allow that via a command line option.How to Reproduce
pip install -r requirements.txt
.pip freeze -l -r requirements.txt
.Output
The text was updated successfully, but these errors were encountered: