Repository navigation
build: lock Python dependencies with uv instead of Rye - #528
Merged
Merged
Conversation
Rye is no longer developed. Its lockfiles had no maintained way to be updated: `rye lock` re-resolved unrelated pins, new dependencies were added to both requirements*.lock files by hand, and Renovate could not regenerate them, so Python dependencies got no update PRs. - pyproject.toml: [tool.rye] dev-dependencies become the PEP 735 `dev` dependency group. The [tool.uv] constraints and overrides stay. - uv.lock replaces requirements.lock and requirements-dev.lock. It was locked with every Rye pin as a temporary constraint, then relocked without them, so every previously locked version is kept. - CI installs with `uv sync --locked --extra ui`, which fails when pyproject.toml changes without updating uv.lock. - The image installs the runtime set from uv.lock with a uv binary pinned by digest in the build stage only. The installed packages are identical to the current image. - Renovate manages Python through the pep621 manager, batching non-major updates weekly like the UI.
This was referenced Nov 20, 2026
WilhelmZA
approved these changes
Nov 20, 2026
WilhelmZA
left a comment
Collaborator
There was a problem hiding this comment.
Approving at d30acaed.
Every package in the two Rye lock files has the same version in uv.lock, so no runtime dependency changes. The image installs with uv sync --locked from a uv image pinned by digest, and uv stays out of the final image. The backend and SSH jobs install from uv.lock; no publish, tag or release job or condition changes. No reference to Rye or to the removed lock files remains. The commit is verified, CI gate passes and Closes #527 matches the issue.
#523 changes .github/workflows/ci.yml and CONTRIBUTING.md, and #524 changes Dockerfile; the hunks do not touch. #526 uses this branch as its base, so retarget it to main before this branch is deleted, or the delete closes it.
Nits:
setup-uvhas noversionin the backend and SSH jobs, so CI runs the latest uv while the image pins 0.13.7. Arequired-versionunder[tool.uv], or aversionon both steps, keeps the two on one installer.- Renovate now proposes updates for
typer,clickandrich, whichpyproject.tomlholds at old versions. #531 tracks lifting those holds.
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.
Closes #527
Problem
Python dependencies on
mainwere locked by Rye, which is no longer developed.rye lockre-resolves unrelated pins (a recent attempt droppedfakeredis[lua]), so new dependencies were added to bothrequirements*.lockfiles by hand.renovate.jsonleft Python unmanaged because Renovate cannot regenerate Rye lockfiles, so Python dependencies got no update PRs. Meanwhile CI already installed with uv, andpyproject.tomlalready had[tool.uv]settings.Change
pyproject.toml:[tool.rye] dev-dependencies→ PEP 735[dependency-groups] dev, same entries.[tool.uv]constraints and overrides unchanged.uv.lockreplacesrequirements.lockandrequirements-dev.lock, and is no longer git-ignored. To keep versions, I locked once with all 104 Rye pins as temporaryconstraint-dependencies, then removed them and relocked. uv keeps locked versions that still satisfy the requirements.uv sync --locked --extra ui; cache keyed onuv.lock.--lockedfails whenpyproject.tomlchanged withoutuv lock.ghcr.io/astral-sh/uv:0.13.7pinned by digest, thenuv sync --locked --inexact --no-dev --extra ui --no-install-projectinto/opt/venv.--inexactkeeps the venv's pip for the final stage's editable install, which then removes pip as before.UV_COMPILE_BYTECODE=1matches pip's default bytecode compilation.pep621manager enabled; non-major Python updates batched into one weekly PR like the UI. Majors still need Dependency Dashboard approval (e.g. paramiko 5, paramiko 5 cannot connect to IOSv and EXOS #418)..gitignore, CONTRIBUTING (uv sync --extra ui,uv lock,uv run pytest).Tests
requirements-dev.lockhas the same version inuv.lock; none missing. Only inuv.lock:async-timeout(redis, Python < 3.11.3),mslexandwin32-setctime(Windows),uvloop(performanceextra), and the project.uv sync --locked --extra ui --python 3.12, thenruff check .(clean) and the backend suite:4146 passed, 4 skipped.docker buildsucceeds.importlib.metadatalists the same 67 distributions at the same versions asghcr.io/hyperglass-community/hyperglass:sha-20c89a92…(diffempty). The final image has nouvand no pip, runs asuid=10001, andhyperglass --helpworks.renovate-config-validator --strict renovate.json: "Config validated successfully".Changelog
uv.lock) instead of Rye, and Renovate now updates them.Notes
pep621to open a weekly "Python non-major dependencies" PR, plus Dashboard entries for majors.prometheus-clientto the Rye lockfiles by hand. Whichever merges second needs a rebase; after this PR, feat(api): add optional Prometheus metrics #526 runsuv add prometheus-clientinstead.setup-uvsteps use the latest uv; the image pins 0.13.7. A newer uv reads lockfiles written by older ones.