Skip to content

fix(uv): resolve unconstrained multi-version packages via lockfile dev-dependencies#890

Closed
arrdem wants to merge 5 commits intomainfrom
arrdem/fix-unconstrained-conflict-versions
Closed

fix(uv): resolve unconstrained multi-version packages via lockfile dev-dependencies#890
arrdem wants to merge 5 commits intomainfrom
arrdem/fix-unconstrained-conflict-versions

Conversation

@arrdem
Copy link
Copy Markdown
Contributor

@arrdem arrdem commented Mar 20, 2026

When conflicting dependency groups both include a package without a version
specifier (e.g. just "build"), and the lockfile contains multiple versions,
resolution failed because normalize_deps only creates defaults for
single-version packages and specifier-based matching requires a non-empty
specifier.

The fix reads per-group resolved versions from the lockfile's root project
dev-dependencies/dependency-groups section and overlays them onto the
default version map before resolving each group.

Changes are visible to end-users: no

Test plan

  • New e2e test case uv-unconstrained-conflict-890 with intentionally stale lockfile
    reproducing the scenario (unconstrained build resolving to different versions
    per group)
  • test_unconstrained asserts the pyproject.toml keeps build unpinned
  • Existing conflict e2e tests pass
  • Main test suite passes

arrdem and others added 2 commits March 20, 2026 15:53
…v-dependencies

When conflicting dependency groups both include a package without a version
specifier, and the lockfile contains multiple versions, the resolution logic
failed because normalize_deps only creates defaults for single-version packages
and specifier-based matching requires a non-empty specifier.

The lockfile's root project package already records per-group resolved versions
in its dev-dependencies/dependency-groups section. Use this to build per-group
version maps that let unconstrained multi-version packages resolve correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aspect-workflows
Copy link
Copy Markdown

aspect-workflows bot commented Mar 20, 2026

Bazel 8 (Test)

All tests were cache hits

107 tests (100.0%) were fully cached saving 47s.


Bazel 9 (Test)

All tests were cache hits

107 tests (100.0%) were fully cached saving 1m 16s.


Bazel 8 (Test)

e2e

1 test target passed

Targets
//cases/uv-unconstrained-conflict-890:test_unconstrained [k8-fastbuild-ST-1a8602e72ef0]652ms

Total test execution time was 652ms. 45 tests (97.8%) were fully cached saving 55s.


Bazel 9 (Test)

e2e

1 test target passed

Targets
//cases/uv-unconstrained-conflict-890:test_unconstrained [k8-fastbuild-ST-1a8602e72ef0]652ms

Total test execution time was 652ms. 45 tests (97.8%) were fully cached saving 54s.


Bazel 8 (Test)

examples/uv_pip_compile

All tests were cache hits

1 test (100.0%) was fully cached saving 444ms.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ arrdem
❌ aspect-marvin
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@xangcastle xangcastle force-pushed the arrdem/fix-unconstrained-conflict-versions branch from 37f6f38 to 85be6d7 Compare April 1, 2026 21:41
for spec in lock_data.get("package", []):
if normalize_name(spec["name"]) == root_project_name:
# Handle both old ("dev-dependencies") and new ("dependency-groups") key names
group_deps_map = spec.get("dev-dependencies", spec.get("dependency-groups", {}))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev has priority over groups? Is that intentional? Should it be tested?

Comment thread e2e/cases/uv-unconstrained-conflict-890/pyproject.toml Outdated
@xangcastle xangcastle force-pushed the arrdem/fix-unconstrained-conflict-versions branch from 85be6d7 to 2904fdb Compare April 3, 2026 15:41
@xangcastle xangcastle closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants