Skip to content

Relative tool.uv.sources paths written as absolute in uv.lock since 0.10.10 #20477

Description

@eddie-on-gh

Summary

Since uv 0.10.10 (PR #18176), relative path dependencies declared in [tool.uv.sources] are written as absolute paths in uv.lock. This makes lockfiles non-portable across machines and unsuitable for version control.

I'm using this in a monorepo-style repository where I do not want a shared workspace or workspace-level lockfile because our CI/CD pipeline uses per-package lockfile hashes to determine which packages need to be rebuilt/retested.

Version Relative paths in lockfile?
0.10.9 ✅ Yes (correct)
0.10.10 ❌ No (absolute)
0.11.0 ❌ No (absolute)
0.11.29 ❌ No (absolute)

Reproduction

Given a project structure:

repo/
├── my-app/
│   ├── pyproject.toml
│   └── uv.lock
├── lib-a/
├── lib-b/
└── lib-c/

With my-app/pyproject.toml:

[project]
name = "my-app"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = [
    "lib-a",
    "lib-b",
    "lib-c",
]

[tool.uv.sources]
lib-a = { path = "../lib-a", editable = true }
lib-b = { path = "../lib-b", editable = true }
lib-c = { path = "../lib-c" }

Steps:

cd my-app
rm -rf .venv uv.lock
uv lock
grep "home" uv.lock

Expected (uv 0.10.9 and earlier)

source = { editable = "../lib-a" }
source = { editable = "../lib-b" }
source = { directory = "../lib-c" }

Actual (uv 0.10.10 through 0.11.29)

source = { editable = "/home/user/repo/lib-a" }
source = { editable = "/home/user/repo/lib-b" }
source = { directory = "/home/user/repo/lib-c" }

Platform

Linux (x86_64)

Version

uv 0.10.10

Python version

Python 3.12.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions