Doesn't support local paths to wheels
@Anurag-S1ngh is already working on this.
Since Oct 31, 2026.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Reproduce the failure with the req.txt and test.py example using requirements.parse, then trace the parser entry point that passes each line to requirement parsing. The work is done when a local wheel path such as ./humanize-4.14.0-py3-none-any.whl parses without raising, while existing requirement parsing continues to work.
Written by the indexing model from the issue text.
Description
If a requirements.txt file contains a local path with "/", requirements.parse throws rather than parsing it as a local path. Here's a complete example showing that this is a valid file that works with pip:
$ python3.11 -m venv test-venv
$ ./test-venv/bin/pip download humanize
Collecting humanize
Using cached humanize-4.14.0-py3-none-any.whl.metadata (7.8 kB)
Using cached humanize-4.14.0-py3-none-any.whl (132 kB)
Saved ./humanize-4.14.0-py3-none-any.whl
Successfully downloaded humanize
$ echo ./humanize-4.14.0-py3-none-any.whl > req.txt
$ ./test-venv/bin/pip install -r req.txt
Processing ./humanize-4.14.0-py3-none-any.whl (from -r req.txt (line 1))
Installing collected packages: humanize
Successfully installed humanize-4.14.0
$ ./test-venv/bin/python -c 'import humanize'
$ ./test-venv/bin/pip install requirements-parser==0.13.0
Collecting requirements-parser==0.13.0
Using cached requirements_parser-0.13.0-py3-none-any.whl.metadata (4.7 kB)
Collecting packaging>=23.2 (from requirements-parser==0.13.0)
Using cached packaging-25.0-py3-none-any.whl.metadata (3.3 kB)
Using cached requirements_parser-0.13.0-py3-none-any.whl (14 kB)
Using cached packaging-25.0-py3-none-any.whl (66 kB)
Installing collected packages: packaging, requirements-parser
Successfully installed packaging-25.0 requirements-parser-0.13.0
$ cat <<EOF > test.py
import sys
import requirements
with open(sys.argv[1]) as f:
for r in requirements.parse(f):
print(r)
EOF
$ ./test-venv/bin/python test.py req.txt
Traceback (most recent call last):
File "/Users/dborowitz/w/test-venv/lib/python3.11/site-packages/packaging/requirements.py", line 36, in __init__
parsed = _parse_requirement(requirement_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dborowitz/w/test-venv/lib/python3.11/site-packages/packaging/_parser.py", line 62, in parse_requirement
return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dborowitz/w/test-venv/lib/python3.11/site-packages/packaging/_parser.py", line 71, in _parse_requirement
name_token = tokenizer.expect(
^^^^^^^^^^^^^^^^^
File "/Users/dborowitz/w/test-venv/lib/python3.11/site-packages/packaging/_tokenizer.py", line 143, in expect
raise self.raise_syntax_error(f"Expected {expected}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dborowitz/w/test-venv/lib/python3.11/site-packages/packaging/_tokenizer.py", line 168, in raise_syntax_error
raise ParserSyntaxError(
packaging._tokenizer.ParserSyntaxError: Expected package name at the start of dependency specifier
./humanize-4.14.0-py3-none-any.whl
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/dborowitz/w/test.py", line 5, in <module>
for r in requirements.parse(f):
File "/Users/dborowitz/w/test-venv/lib/python3.11/site-packages/requirements/parser.py", line 90, in parse
yield Requirement.parse(line)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dborowitz/w/test-venv/lib/python3.11/site-packages/requirements/requirement.py", line 274, in parse
return cls.parse_line(line)
^^^^^^^^^^^^^^^^^^^^
File "/Users/dborowitz/w/test-venv/lib/python3.11/site-packages/requirements/requirement.py", line 240, in parse_line
pkg_req = Req(line_without_comment)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dborowitz/w/test-venv/lib/python3.11/site-packages/packaging/requirements.py", line 38, in __init__
raise InvalidRequirement(str(e)) from e
packaging.requirements.InvalidRequirement: Expected package name at the start of dependency specifier
./humanize-4.14.0-py3-none-any.whl
^
- requirements-parser version: 0.13.0
- OS: macOS 26
- Python: 3.11.14 (Homebrew)
- Dominant language
- Python
- Stars
- 20
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aboutcode-org/pip-requirements-parser
-
Quadratic comment split on a requirements file line (pip_requirements_parser.py:1058)May be free again @Anurag-S1ngh claimed this 25 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aboutcode-org/pip-requirements-parser#30 · 1 comment ·
-
Support PEP 561 Distributing and Packaging Type Information (py.typed marker)May be free again A pull request for this issue was closed without being merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 60/100
-
Tests failures with packaging 26.0Possibly taken @s-t-e-v-e-n-k claimed this 290 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
[BUG] VCS URLs are detected as path on linux systemsMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
All issues in aboutcode-org/pip-requirements-parser
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
GoogleCloudPlatform/professional-services-data-validator#1899 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mohanraj00/entelos#200 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
sweep
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
bketelsen/truenas-mcp#77 ·
Maintainers usually reply within 1 day
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskOpen
Difficulty 1/5 Under an hour Newbie friendliness 86/100
sandbox-quantum/switch#2163 ·
Maintainers usually reply within 1 day