feat: add dependency-range bump utility (scripts/bump_deps.py)#382
Draft
mkitti wants to merge 3 commits into
Draft
feat: add dependency-range bump utility (scripts/bump_deps.py)#382mkitti wants to merge 3 commits into
mkitti wants to merge 3 commits into
Conversation
Add scripts/bump_deps.py, a CLI that bumps Python dependency version ranges in pyproject.toml to include the latest released versions, following the repo's >=LATEST,<NEXT convention and keeping the PyPI ([project]) and conda ([tool.pixi]) specs in sync. Resolves versions via `pixi search` (conda-forge) and the PyPI JSON API, rewrites specs with anchored formatting-preserving edits, and can regenerate pixi.lock and run the backend tests. Implements docs/dependency-update-spec.md. Includes tests/test_bump_deps.py covering the pure logic (spec parsing, NEXT computation, shape preservation, rewrite disambiguation/idempotence) and version resolution with mocked registries. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wire scripts/bump_deps.py into pixi as `pixi run bump-deps`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The design spec for scripts/bump_deps.py (origin: manual process in PR JaneliaSciComp#381). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
scripts/bump_deps.py, a utility that automates bumping Python dependencyversion ranges in
pyproject.tomlto include the latest released versions —the manual process used in #381. Implements
docs/dependency-update-spec.md.What it does:
[project].dependencies,[tool.pixi.dependencies],[tool.pixi.feature.*.dependencies],[dependency-groups].*), classifying each package as synced / conda / pypi-only.pixi search(conda-forge, binding for the lock) and thePyPI JSON API (PyPI-only first-party deps like
x2s3,py-cluster-api,build).>=LATEST,<NEXT(0ver-aware), preserving each spec's shape andkeeping
[project]/[tool.pixi]byte-identical, via anchored,formatting-preserving edits.
and reports the divergence.
pixi.lock(--lock) and run thebackend suite (
--test).--dry-run(default),--write,--exclude/--only,--bump-open-floors,--allow-prerelease,--json.Run it with
pixi run bump-deps(added as a pixi task).Validation: exact reproduction of #381
Run against the pre-#381 manifest, the script proposes 17 of 17 changes
identical to #381's hand-edited result, including the three major bumps
(cachetools 6→7, pandas 2→3, pytest 8→9). It also independently reproduced #381's
uvicorn judgment call — capping at conda-forge
0.48.0while noting"PyPI 0.49.0 ahead of conda-forge 0.48.0".
Tests
tests/test_bump_deps.py— 35 unit tests covering spec parsing, NEXT computation(0ver vs semver + per-package overrides), shape preservation, name/extras
stripping, rewrite disambiguation/idempotence, and version resolution with mocked
registries. All pass.
Notes
(spec §10 option A).
--teststep should run on a clean checkout — suite collection canbreak on stray untracked test files (spec §9).
🤖 Generated with Claude Code