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

## [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
This commit is contained in:
kert
2026-03-21 15:15:17 -04:00
parent 20fcb3e81c
commit 6486cd22dd
6 changed files with 13 additions and 4 deletions

3
.gitignore vendored
View File

@@ -1,3 +1,6 @@
# Virtual environment
.venv/
# Data directories (user data, not tracked)
data/
zotero/data/

View File

@@ -1 +1 @@
cpython-3.13.12-linux-x86_64-gnu
3.13

View File

@@ -13,9 +13,7 @@ steps:
UV_LINK_MODE: copy
UV_PROJECT_ENVIRONMENT: .venv
commands:
- uv python pin 3.13.11
- uv sync --dev
- uv pip install -e .
- uv run ruff check src/ tests/ --output-format=concise
- uv run ruff format --check src/ tests/

View File

@@ -38,6 +38,10 @@ dev = [
"altair>=6.0.0",
"pandas>=3.0.1",
]
[build-system]
requires = ["uv_build>=0.7,<1"]
build-backend = "uv_build"
[tool.ruff]
line-length = 88

2
uv.lock generated
View File

@@ -2040,7 +2040,7 @@ wheels = [
[[package]]
name = "stack"
version = "0.1.0"
source = { virtual = "." }
source = { editable = "." }
dependencies = [
{ name = "databricks-cli" },
{ name = "databricks-sdk" },

4
uv.toml Normal file
View File

@@ -0,0 +1,4 @@
# Project-level uv configuration.
# Prevents broken .venv symlinks when uv runs under different users.
link-mode = "copy"
python-preference = "managed"