-
Notifications
You must be signed in to change notification settings - Fork 2.9k
find-links or path = causes absolute wheel path to become relative path when creating lock file #16602
Description
Summary
This issue is effectively the complete inverse of #6458.
I am working on a project that is used in a cloud environment where we have some wheels in a shared folder (defined by an absolute path). Everyone has a space that they can use to work on projects so everyone may have a different repo directory and path to it (it becomes a problem when the uv.lock file is created in one that is fewer folders deep than the one it will be used in). There are multiple packages that have their wheels located in that shared wheels folder.
dependencies = [
"package-in-wheels-folder>=1.0.0"
]
[tool.uv]
find-links = [
"/shared_drive/some/folders/wheels"
]When creating the uv.lock file, each of them will have their path made relative like:
[[package]]
name = "package-in-wheels-folder"
version = "1.0.0"
source = { path = "../../../../../../shared_drive/some/folders/wheels/<wheels_file>.whl" }If someone now wants to recreate the environment with uv sync --frozen and happens to be in a deeper nested folder than this, it will fail. From a more shallow one this still happens to work since extra .. will just stay in the base directory /.
It fails as expected given the uv.lock file with:
× Failed to download `package-in-wheels-folder==1.0.0`
├─▶ Failed to read from the distribution cache
╰─▶ failed to query metadata of file
`/remaining/bits/from/deeper/path/shared_drive/some/folders/wheels/<wheels_file>.whl`: No such file or directory (os error 2)
In this example, /remaining/bits/from/deeper/path is the part of the path that the repo is deeper than all of the ../ in the uv.lock file.
I realise this is quite an edge case, but nonetheless it would be useful if the uv.lock file respected the type of path from the pyproject.toml file, i.e. relative in pyproject.toml becomes relative in uv.lock (to keep #6458 resolved) and if it is absolute in puproject.toml then it should be absolute in uv.lock to resolve this issue. Or perhaps some default and explicit keyword to ensure it is clear.
Note: the same has also been tested by explicitly setting the path for the package and results in the same problem.
[tool.uv.sources]
package-in-wheels-folder = { path = "/shared_drive/some/folders/wheels/<wheels_file>.whl" }Platform
Linux 6.8.0 (AWS) x86_64 GNU/Linux
Version
uv 0.9.7
Python version
Python 3.10.12