Skip to content
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

Reasoning behind mapping requests to Requests (capitalization change) #468

Open
aka-Ani opened this issue Dec 11, 2024 · 0 comments
Open

Comments

@aka-Ani
Copy link

aka-Ani commented Dec 11, 2024

I was wondering if there is any documentation anywhere that describes why some packages have their names remapped to something else. In particular I was curious about the requests package and the flask package. So if you have import requests in the code, pipreqs says "Found packages: {'requests'}", then "Found imports: Requests" but then "WARNING: Import named "Requests" not found locally. Trying to resolve it at the PyPI server." after which it ends up getting resolved to something like "requests:2.23.3", but then what gets written in the requirements file is "Requests==2.23.3"

I guess I don't really understand why this happens? I mean I understand how I guess, because its listed here in the mapping file https://github.com/bndr/pipreqs/blob/master/pipreqs/mapping#L994, but yeah not sure why.

Even in like a pip show requests, the name of the package is lowercase, so I'm not sure where this reference to a capitalized Requests package is coming from.

It's not a huge issue I suppose, it does warn you it didn't find it and is putting some other version into the requirements. Is this just something one should watch out for? For what its worth I've noticed it so far with requests and flask. And maybe flask is an even weirder example because on PyPI it says to install it with pip install Flask but the usage is from flask import Flask....

Sorry if this has been asked before and I just didn't find it, thanks for the work on this cool project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant