Skip to content

Validate parentheses properly in environment markers #213

@takluyver

Description

@takluyver

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions