-
Notifications
You must be signed in to change notification settings - Fork 288
Present a clearer error message when the user misses a space before ; in marker #529
Copy link
Copy link
Closed
Description
Currently, if you try to use:
tomli @ https://github.com/hukkin/tomli/archive/master.zip; python_version < '3.11'
The error you get is:
>>> Requirement("tomli @ https://github.com/hukkin/tomli/archive/master.zip; python_version < '3.11'")
Traceback (most recent call last):
File "/Users/pradyunsg/Developer/github/packaging/.venv/lib/python3.11/site-packages/packaging/requirements.py", line 102, in __init__
req = REQUIREMENT.parseString(requirement_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/pradyunsg/Developer/github/packaging/.venv/lib/python3.11/site-packages/pyparsing/core.py", line 1141, in parse_string
raise exc.with_traceback(None)
pyparsing.exceptions.ParseException: Expected string_end, found 'python' (at char 60), (line:1, col:61)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/pradyunsg/Developer/github/packaging/.venv/lib/python3.11/site-packages/packaging/requirements.py", line 104, in __init__
raise InvalidRequirement(
packaging.requirements.InvalidRequirement: Parse error at "'python_v'": Expected string_endIt would be good if it presented an error that suggested adding a (space) before the semicolon.
Reactions are currently unavailable