Skip to content

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

Merged
merged 7 commits into from
Jan 16, 2023

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Jan 14, 2023

Attempts to fix #86

Copy link
Contributor

@hauntsaninja hauntsaninja left a 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?

Comment on lines 211 to 212
if req.name.lower() not in [
Requirement(r).name.lower() for r in (data["info"].get("requires_dist") or [])
Copy link
Contributor Author

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?

Suggested change
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 [])

Copy link
Contributor

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.

Copy link
Contributor Author

@Avasam Avasam Jan 15, 2023

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.

@srittau srittau merged commit cf4d9db into typeshed-internal:main Jan 16, 2023
@Avasam Avasam deleted the patch-1 branch January 16, 2023 13:06
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

Successfully merging this pull request may close these issues.

Dependency check is case-sensitive
4 participants