Skip to content

chore: migrate Python deps from requirements-lock.txt to uv lock#21

Open
CameronBrooks11 wants to merge 2 commits into
mainfrom
chore/migrate-to-uv-lock
Open

chore: migrate Python deps from requirements-lock.txt to uv lock#21
CameronBrooks11 wants to merge 2 commits into
mainfrom
chore/migrate-to-uv-lock

Conversation

@CameronBrooks11
Copy link
Copy Markdown
Member

Summary

Replaces the manual pip freeze > requirements-lock.txt workflow with uv's native lock file (uv.lock).

Changes

  • pyproject.toml: Added [project] section with [project.optional-dependencies] dev declaring all Python deps (previously in requirements.txt)
  • uv.lock: Generated via uv lock — resolver-guaranteed consistent resolution
  • CI workflows: Migrated from pip install -r requirements-lock.txt to astral-sh/setup-uv + uv sync --locked --extra dev
  • Removed: requirements.txt, requirements-lock.txt, lockfile validation steps
  • renovate.json: Switched to pep621 manager, enabled lockFileMaintenance (weekly), ignored legacy files

Why

The old pattern (requirements.txt ranges + requirements-lock.txt pins) had no automated way to keep the lock file in sync. Renovate's pip_requirements manager bumps individual pins without resolver guarantees, creating noise and potential inconsistency.

With uv lock:

  • Lock is always resolver-consistent (full dependency graph)
  • Renovate's pep621 manager natively understands uv.lock
  • lockFileMaintenance regenerates the full lock weekly
  • Matches the pattern already used in anolis-workbench

Local dev

uv sync --extra dev    # install all deps
uv run pytest tests/   # run tests
uv run mypy .          # type check

Replace the manual pip freeze workflow with uv's native lock file:
- Add [project] + [project.optional-dependencies] dev to pyproject.toml
- Generate uv.lock (resolver-guaranteed consistency)
- Update all CI workflows to use astral-sh/setup-uv + uv sync --locked
- Remove requirements.txt and requirements-lock.txt
- Update renovate.json: pep621 manager, lockFileMaintenance, ignore legacy files

Renovate now manages deps via the pep621 manager and will
run lockFileMaintenance weekly to keep uv.lock current.
CMake's find_package(Python3) must discover the venv Python (which
has pytest installed), not the bare system Python. Prefixing cmake
configure with 'uv run' puts .venv/bin first on PATH so CMake stores
the correct Python3_EXECUTABLE. CTest then invokes the venv Python
which has all packages available.
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.

1 participant