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

Improve Requirement/Marker parser with context-sensitive tokenisation #624

Merged
merged 23 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2ceccfc
Convert `Token` into a dataclass
pradyunsg Dec 5, 2022
a25e85f
Convert parser exception into a rich exception class
pradyunsg Dec 5, 2022
09f31ff
Use a richer type for `Tokenizer.rules`
pradyunsg Dec 5, 2022
1c930f1
Provide dedicated `parse_{requirement,marker}(str)` functions
pradyunsg Dec 5, 2022
650c7c6
Rename `req` to `parsed` in `Requirement.__init__`
pradyunsg Dec 5, 2022
282b4e1
Rename parser's `Requirement` to `ParsedRequirement`
pradyunsg Dec 5, 2022
07bf6f4
Rework the parser with context-sensitive tokenisation
pradyunsg Dec 5, 2022
c6baf52
Parse markers inline when parsing requirements
pradyunsg Dec 5, 2022
6b2f3de
Factor out parsing semicolon-marker for requirements
pradyunsg Dec 5, 2022
177e9ff
Tweak the presentation of ParserSyntaxError spans
pradyunsg Dec 5, 2022
1c3f900
Make URLs match "not whitespace"
pradyunsg Dec 5, 2022
4a4d835
Update `IDENTIFIER` to match PEP 508's stipulated syntax
pradyunsg Dec 5, 2022
39ae524
Make arbitrary version matching accept what `LegacySpecifier` did
pradyunsg Dec 5, 2022
97e7649
Better reflect what is optional within `specifier`/`version_many`
pradyunsg Dec 5, 2022
92b9545
Flatten nested ifs into if-elif
pradyunsg Dec 5, 2022
3a7cdb6
Rewrite test suite for requirements parsing
pradyunsg Dec 5, 2022
0399eaf
Improve error message for bad version specifiers in `Requirement`
pradyunsg Dec 6, 2022
83aae66
Add `ParserSyntaxError` as the cause of `Invalid{Requirement/Marker}`
pradyunsg Dec 6, 2022
163993a
Permit whitespace around `marker_atom`
pradyunsg Dec 7, 2022
fa4b69d
Rename `marker_expr` to `marker`
pradyunsg Dec 7, 2022
ff75da7
Enforce word boundaries in operators and names
pradyunsg Dec 7, 2022
4945856
Fix a typo in an error message
pradyunsg Dec 7, 2022
7869a1a
Permit arbitrary whitespace around versions specifier in parenthesis
pradyunsg Dec 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view