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

feat: stray quote keep quote #2778

Closed
wants to merge 1 commit into from
Closed

Conversation

fatelei
Copy link

@fatelei fatelei commented Apr 2, 2024

Summary

stray quote keep quote for python >= "3.7", fix #2551

Test Plan

rust playground: https://gist.github.com/rust-play/eebce903f361ab4b58d5c7c98f4a3537

@fatelei
Copy link
Author

fatelei commented Apr 2, 2024

when i add test:

LenientVersionSpecifiers::from_str(">=\"3.6\"").unwrap().into();

there is a error: expected version to start with a number

@konstin
Copy link
Member

konstin commented Apr 3, 2024

PEP 508, the standard for the requirements, is a bit tricky here: The main version specifier must not have quotes, while the version specifiers in the markers must have quotes.

This is a correct requirement: numpy >=1.19; python_version >= "3.7"
This one is incorrect, we want to fix it up: numpy ">=1.19"; python_version >= "3.7"
But this one is also incorrect, the markers need quotes: numpy >=1.19; python_version >= 3.7

So when we see numpy ">=1.19"; python_version >= "3.7", we only want to remove the first set of quotes, not the second set of quotes.

@ibraheemdev
Copy link
Member

ibraheemdev commented Apr 23, 2024

I opened up #3214, which should address this. Thanks @fatelei for your initial work on this.

@zanieb zanieb closed this Apr 23, 2024
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.

"Stray quotes" fixup can lead to invalid markers
4 participants