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

Validate parentheses properly in environment markers #213

Open
takluyver opened this issue Sep 27, 2018 · 0 comments · May be fixed by #225
Open

Validate parentheses properly in environment markers #213

takluyver opened this issue Sep 27, 2018 · 0 comments · May be fixed by #225

Comments

@takluyver
Copy link
Member

According to the grammar in PEP 508, environment markers can have parentheses, like this:

foo; extra == "test" and (os_name == "nt" or python_version == "2.7")

For now, I just strip leading/trailing parentheses from each clause before checking them. It would be good to check that the parentheses are balanced and only occur in the correct places, before and after individual boolean clauses.

I suspect that this requires a degree of 'proper' parsing of these expressions, rather than just regex-munging.

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 a pull request may close this issue.

1 participant