-
Notifications
You must be signed in to change notification settings - Fork 18
Case insensitive check between specified requirement and requires_dist #87
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could you use canonical_name instead?
stub_uploader/metadata.py
Outdated
if req.name.lower() not in [ | ||
Requirement(r).name.lower() for r in (data["info"].get("requires_dist") or []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I assume that the requirement we manually specify is always a canonical name? Or should I normalize both like this?
if req.name.lower() not in [ | |
Requirement(r).name.lower() for r in (data["info"].get("requires_dist") or []) | |
if canonical_name(req.name) not in [ | |
canonical_name(Requirement(r).name) for r in (data["info"].get("requires_dist") or []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess either we should normalize both or we should test somewhere (probably typeshed) that all reqs are in canonical form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it was being called twice (thrice with #88). I figured may as well deduplicate it. And now it's only called once anyway, so I feel there's no reason not to use it.
Attempts to fix #86