P12: uv hygiene — build-system, link-mode, version pins, auto-recovery #62

Merged
kert merged 1 commits from feature/uv-hygiene into main 2026-03-21 19:34:02 +00:00
Owner

Summary

Fixes the recurring broken-venv issue and modernises all uv usage.

Changes

Issue Fix
#58 Add [build-system] with uv_build backend — uv sync --dev now installs the project editably. Removed uv pip install -e . and uv python pin 3.13.11 from CI.
#59 .python-version → 3.13 (minor pin, let patch float). Removed CI step that downgraded to 3.13.11.
#60 New uv.toml with link-mode = "copy" and python-preference = "managed". Prevents .venv symlinks to /root/.
#61 Pre-commit hook auto-recovers broken venv: checks uv run python -c 'import sys' at top, runs uv sync --dev if needed.

Also added .venv/ to .gitignore.

Closes #58, #59, #60, #61

Test plan

  • 11,819 tests pass
  • uv sync --dev installs project without uv pip install -e .
  • import aco, api, bib, conf all work
  • .venv/bin/python points to /home/kert/ (not /root/)
  • All notebooks run as scripts
## Summary Fixes the recurring broken-venv issue and modernises all uv usage. ### Changes | Issue | Fix | |-------|-----| | **#58** | Add `[build-system]` with `uv_build` backend — `uv sync --dev` now installs the project editably. Removed `uv pip install -e .` and `uv python pin 3.13.11` from CI. | | **#59** | `.python-version` → `3.13` (minor pin, let patch float). Removed CI step that downgraded to 3.13.11. | | **#60** | New `uv.toml` with `link-mode = "copy"` and `python-preference = "managed"`. Prevents .venv symlinks to /root/. | | **#61** | Pre-commit hook auto-recovers broken venv: checks `uv run python -c 'import sys'` at top, runs `uv sync --dev` if needed. | Also added `.venv/` to `.gitignore`. Closes #58, #59, #60, #61 ## Test plan - [x] 11,819 tests pass - [x] `uv sync --dev` installs project without `uv pip install -e .` - [x] `import aco, api, bib, conf` all work - [x] .venv/bin/python points to /home/kert/ (not /root/) - [x] All notebooks run as scripts
kert added this to the P12: uv Hygiene — fix venv, build system, python resolution milestone 2026-03-21 19:16:44 +00:00
kert added 1 commit 2026-03-21 19:16:44 +00:00
uv hygiene: build-system, uv.toml, version pins, auto-recovery hook
All checks were successful
ci/woodpecker/push/infra-ci Pipeline was successful
ci/woodpecker/pr/infra-ci Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful
coverage 99% coverage
ci/woodpecker/pr/ci Pipeline was successful
6486cd22dd
## [build-system] + drop uv pip install -e . (#58)
Add `[build-system] requires=["uv_build"] build-backend="uv_build"`
so `uv sync --dev` installs the project editably in one step.
Remove `uv pip install -e .` and `uv python pin 3.13.11` from CI.

## uv.toml with link-mode=copy (#60)
Create project-level `uv.toml` with `link-mode = "copy"` and
`python-preference = "managed"`. Prevents .venv symlinks from
pointing to /root/ when uv runs under different users.

## Align python version (#59)
`.python-version` pinned to `3.13` (minor, let patch float) instead
of platform-specific `cpython-3.13.12-linux-x86_64-gnu`. Removed
the CI step that downgraded to 3.13.11.

## Pre-commit auto-recovery (#61)
Hook now checks `uv run python -c 'import sys'` at the top — if the
venv is broken, it runs `uv sync --dev` automatically before checks.

## .gitignore
Add `.venv/` to prevent accidental venv commits.

fix #58, fix #59, fix #60, fix #61
kert merged commit 142170219e into main 2026-03-21 19:34:02 +00:00
Sign in to join this conversation.