Skip to content

Commit aa46b13

Browse files
Python: coordinate uv version updates
1 parent c72b5ed commit aa46b13

5 files changed

Lines changed: 39 additions & 5 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ updates:
7171
groups:
7272
basics:
7373
patterns:
74-
- "uv"
7574
- "ruff"
7675
- "prek"
7776
- "poethepoet"
@@ -94,6 +93,10 @@ updates:
9493
- "pyrefly"
9594
- "ty"
9695
- "zuban"
96+
# Root uv upgrades must update required-version, workflow pins, and the
97+
# pre-commit revision together. Lab retains its independent uv updater.
98+
ignore:
99+
- dependency-name: "uv"
97100
labels:
98101
- "python"
99102
- "dependencies"
@@ -110,7 +113,6 @@ updates:
110113
# by the pip updater above. This entry covers pyproject.toml and uv.lock.
111114
basics:
112115
patterns:
113-
- "uv"
114116
- "prek"
115117
- "poethepoet"
116118
- "tomli"
@@ -124,6 +126,9 @@ updates:
124126
flit:
125127
patterns:
126128
- "flit*"
129+
# Avoid partial root uv bumps; coordinated uv upgrades are manual.
130+
ignore:
131+
- dependency-name: "uv"
127132
labels:
128133
- "python"
129134
- "dependencies"

‎.github/workflows/github-automation-tests.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- ".github/workflows/issue-plan.md"
1414
- ".github/workflows/issue-plan.lock.yml"
1515
- "python/pyproject.toml"
16+
- "python/tooling/requirements-api-compatibility.txt"
1617
- "python/uv.lock"
1718
push:
1819
branches:
@@ -28,6 +29,7 @@ on:
2829
- ".github/workflows/issue-plan.md"
2930
- ".github/workflows/issue-plan.lock.yml"
3031
- "python/pyproject.toml"
32+
- "python/tooling/requirements-api-compatibility.txt"
3133
- "python/uv.lock"
3234

3335
permissions:

‎python/.github/skills/python-package-management/SKILL.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ uv run poe test
107107
refreshes; it repins exact dependencies across development groups and
108108
`tooling/requirements-*.txt`, refreshes `uv.lock`, and reruns `check` and
109109
`typing`.
110+
- Upgrade the root uv version manually as one coordinated change across the
111+
`dev` requirement, `[tool.uv].required-version`, setup workflows, and the
112+
uv pre-commit revision. Automated dependency updates intentionally ignore
113+
the root uv pin.
110114
- Run Lab dependency and validation commands from `packages/lab`; root workspace tasks deliberately do not
111115
discover or update the Lab project.
112116

‎python/scripts/dependencies/_dependency_bounds_upper_impl.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
CHECK_TASK_PRIORITY = ("dependency-pyright", "check", "typing", "pyright", "mypy", "lint")
4242
AZURE_MONITOR_OPENTELEMETRY = "azure-monitor-opentelemetry"
4343
OPENTELEMETRY_SDK = "opentelemetry-sdk"
44-
VALIDATION_TOOL_DEV_PINS = frozenset({"mypy", "pyrefly", "pyright", "ruff", "ty", "zuban"})
44+
MANUALLY_MANAGED_DEV_PINS = frozenset({"mypy", "pyrefly", "pyright", "ruff", "ty", "uv", "zuban"})
4545
REQ_PATTERN = r"^\s*([A-Za-z0-9_.-]+(?:\[[^\]]+\])?)\s*(.*?)\s*$"
4646
SECTION_HEADER_PATTERN = re.compile(r"^\s*\[([^\]]+)\]\s*$")
4747
INLINE_ARRAY_ASSIGNMENT_PATTERN = re.compile(
@@ -320,9 +320,9 @@ def _collect_development_pin_replacements(
320320
current_exact_version = _exact_pin_version(parsed_requirement)
321321
if current_exact_version is None:
322322
continue
323-
if dependency_name in VALIDATION_TOOL_DEV_PINS:
323+
if dependency_name in MANUALLY_MANAGED_DEV_PINS:
324324
logger.info(
325-
"Skipping %s in %s because validation tool upgrades should be handled separately.",
325+
"Skipping %s in %s because its version must be coordinated separately.",
326326
dependency_name,
327327
pyproject_file,
328328
)

‎python/scripts/dependencies/tests/test_upgrade_dev_dependencies.py‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from packaging.version import Version
66

7+
from scripts.dependencies._dependency_bounds_upper_impl import _collect_development_pin_replacements
78
from scripts.dependencies.upgrade_dev_dependencies import (
89
_apply_tool_requirement_replacements,
910
_collect_tool_requirement_replacements,
@@ -36,6 +37,28 @@ def test_collect_tool_requirement_replacements_preserves_extras_and_markers(tmp_
3637
}
3738

3839

40+
def test_collect_development_pins_skips_coordinated_uv_upgrade(tmp_path: Path) -> None:
41+
pyproject_file = tmp_path / "pyproject.toml"
42+
pyproject_file.write_text(
43+
"""
44+
[project]
45+
name = "test-project"
46+
version = "1.0.0"
47+
48+
[dependency-groups]
49+
dev = ["uv==0.12.23", "poethepoet==0.48.0"]
50+
"""
51+
)
52+
catalog = _VersionCatalog({
53+
"poethepoet": ["0.48.0", "0.49.0"],
54+
"uv": ["0.12.23", "0.12.24"],
55+
})
56+
57+
replacements = _collect_development_pin_replacements(pyproject_file, catalog=catalog) # type: ignore[arg-type]
58+
59+
assert replacements == {"poethepoet==0.48.0": "poethepoet==0.49.0"}
60+
61+
3962
def test_apply_tool_requirement_replacements_preserves_includes_and_comments(tmp_path: Path) -> None:
4063
requirements_file = tmp_path / "all.txt"
4164
requirements_file.write_text("# Shared tools\n-r runtime.txt\nruff==0.16.10\n")

0 commit comments

Comments
 (0)