-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Summary
I’m seeing a resolver failure in a uv workspace even though I explicitly declared package-level conflicts involving extras.
Reproduction repository
- Repo: gautier-cohere/workspace-test-uv-conflict-repro
- Branch:
main - Commit:
42f93cd(current repro commit) uv --version:uv 0.10.2 (a788db7e5 2026-02-10)- OS: macOS (
darwin 25.2.0)
workspace-test-uv-conflict-repro/
├── pyproject.toml
├── pkg-a/
│ └── pyproject.toml
└── pkg-b/
└── pyproject.toml
/pyproject.toml
[project]
name = "workspace-test"
version = "0.1.0"
description = "Test uv workspace with conflicting optional groups"
requires-python = ">=3.11,<3.13"
[tool.uv.workspace]
members = [
"pkg-a",
"pkg-b",
]
[tool.uv]
conflicts = [
[
{ package = "pkg-a"},
{ package = "pkg-b", extra = "unsafe" },
],
[
{ package = "pkg-a"},
{ package = "pkg-b", extra = "all" },
],
]/pkg-a/pyproject.toml
[project]
name = "pkg-a"
version = "0.1.0"
description = "Package A - depends on pkg-b[safe]"
requires-python = ">=3.11,<3.13"
dependencies = [
"pkg-b[safe]",
"datasets<4",
]
[project.optional-dependencies]
all = [
"pkg_a[foo]",
"pkg_a[bar]",
]
foo = [
"numpy"
]
bar = [
"pandas",
]
[tool.uv.sources]
pkg-b = { workspace = true }/pkg-b/pyproject.toml
[project]
name = "pkg-b"
version = "0.1.0"
description = "Package B"
requires-python = ">=3.11,<3.13"
dependencies = []
[project.optional-dependencies]
all = [
"pkg_b[safe]",
"pkg_b[unsafe]",
]
safe = [
"datasets"
]
unsafe = [
"datasets>4",
]Steps to reproduce
uv lockActual behavior
uv lock fails with unsatisfiable requirements.
The resolver reports that pkg-a (datasets<4) and pkg-b[unsafe] / pkg-b[all] (datasets>4) are incompatible, and that the workspace requirements are unsatisfiable.
Expected behavior
I expected the declared conflicts in tool.uv.conflicts (between pkg-a and pkg-b[unsafe] / pkg-b[all]) to be honored in a way that allows workspace locking (e.g., split handling of incompatible combos), rather than failing the entire lock as unsatisfiable.
Question
Is this the intended behavior for package-level conflicts with extras in workspaces, or is this a resolver bug?
What's the recommended way to do this? Imagine I have many more extra groups and many more packages in the workspace, it becomes intractable to enumerate every conflict. I would expect the package level conflict to be enough.
Reference repo link: https://github.com/gautier-cohere/workspace-test-uv-conflict-repro.git
Platform
Darwin 25.2.0 arm64
Version
uv 0.10.2 (a788db7 2026-02-10)
Python version
No response