-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
error messagesMessaging when something goes wrongMessaging when something goes wrong
Description
Summary
Let's say our project is set up like this:
proj/
- pyproject.toml
- requirements.txt
foo.lib/
- pyproject.toml
And our requirements.txt contains:
-e file:foo.lib
That path for foo.lib in requirements.txt is incorrect, because the path should be relative, e.g. ../foo.lib.
However, instead of saying that the path is wrong, uv complains that:
error: Couldn't parse requirement in `requirements.txt` at position 3
Caused by: Expected path (`foo.lib`) to end in a supported file extension: `.whl`, `.tar.gz`, `.zip`, `.tar.bz2`, `.tar.lz`, `.tar.lzma`, `.tar.xz`, `.tar.zst`, `.tar`, `.tbz`, `.tgz`, `.tlz`, or `.txz`
file:foo.lib
^^^^^^^^^^^^
Presumably uv is treating the path as a file because of the .lib at the end.
Contrast this with the error message when we replace the . with a _:
error: Distribution not found at: file:///private/tmp/test/foo_lib
This is a lot better. (Tho it does require you to know what a "distribution" is.)
Steps to reproduce:
uv init test&&cd testecho "-e file:foo.lib" >> requirements.txtuv add -r requirements.txt
Platform
Darwin 24.6.0 arm64
Version
uv 0.9.6 (Homebrew 2025-10-29)
Python version
Python 3.10.16
Metadata
Metadata
Assignees
Labels
error messagesMessaging when something goes wrongMessaging when something goes wrong