-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Minimal reproduction
Running in /home/user/projects/uv_test with uv 0.5.6.
mkdir other
mkdir project
cd project
uv init
cd ../other
uv --project ../project/ lock
uv --project ../project/ run python3 hello.pyGives the following output:
Initialized project `project`
Using CPython 3.10.12 interpreter at: /usr/bin/python3.10
Resolved 1 package in 2ms
Using CPython 3.10.12 interpreter at: /usr/bin/python3.10
Creating virtual environment at: ../project/.venv
error: Failed to generate package metadata for `project==0.1.0 @ virtual+../../../project`
Caused by: Distribution not found at: file:///home/user/projectContents of project/uv.lock:
version = 1
requires-python = ">=3.10"
[[package]]
name = "project"
version = "0.1.0"
source = { virtual = "../../../project" }
The relative path that ends up in the lock file is incorrect. Using --directory instead of --project produces the expected "." path.
Nor is the path produced, "../../../project", the one given as --project - it ends up pointing to a somewhat arbitrary directory and so with some bad luck could produce some very unexpected results if it happens to hit a different valid project. In my case the concrete project is at /home/user/projects/uv_test/project with uv looking in /home/user/project.
To be clear, in my usecase switching to --directory worked. Maybe this is expected behaviour but I am reporting it as it surprised me.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working