You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(deps): migrate backend packaging from pip/Poetry to uv
Replace the dual-manifest setup (Poetry-format pyproject.toml that nothing
installed from + requirements.txt that everything installed from) with a
single PEP 621 pyproject.toml and a committed uv.lock:
- pyproject.toml: PEP 621 [project] with the requirements.txt ranges as
truth (Poetry file was missing tenacity, the SSO stack, and
cryptography), PEP 735 dev dependency group, [tool.uv] package=false
(the API is an app, not an installable package). Dead [tool.black] and
[tool.isort] sections removed — pre-commit already enforces ruff +
ruff-format; [tool.ruff] added (line-length 88, py312).
- uv.lock: first real lockfile for the backend (85 packages).
- requirements.txt: deleted.
- ci.yml: SHA-pinned astral-sh/setup-uv + `uv sync --locked`; .venv/bin
goes on GITHUB_PATH so existing bare pytest invocations are untouched.
- security.yml: pip-audit now audits `uv export --locked --no-dev` — the
dependency set that actually ships, not a loose manifest.
- Dockerfile.backend: uv-based builder (uv 0.10.0, UV_COMPILE_BYTECODE,
UV_PYTHON_DOWNLOADS=never); the `pip uninstall pip` hack is gone since
uv venvs contain no pip.
- dependabot.yml: pip -> uv ecosystem for /apps/api, same groups.
- package.json test:api:* scripts and docs updated to `uv run`.
- .python-version pins 3.12 to match CI and Docker.
Verified: full backend suite 1254 passed / 33 skipped / 11 xfailed under
uv + Python 3.12; Docker image builds and serves {"ready":true} on
/ready; uv export + pip-audit runs clean (no known vulnerabilities).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,11 +27,10 @@ bun run audit:runtime # Runtime audit policy
27
27
28
28
```bash
29
29
cd apps/api
30
-
python -m venv .venv &&source .venv/bin/activate
31
-
pip install -r requirements.txt
32
-
python server.py # Start FastAPI on :8000
33
-
pytest -q # Run all backend tests
34
-
pytest tests/test_ci_smoke.py -q # Quick smoke tests only
30
+
uv sync # Install deps into .venv from uv.lock
31
+
uv run python server.py # Start FastAPI on :8000
32
+
uv run pytest -q # Run all backend tests
33
+
uv run pytest tests/test_ci_smoke.py -q # Quick smoke tests only
35
34
```
36
35
37
36
From repo root:
@@ -50,10 +49,10 @@ cd apps/web && bunx vitest run tests/lib/api.test.ts
50
49
cd apps/web && bunx playwright test e2e/navigation.spec.ts
51
50
52
51
# Backend (pytest) — single file
53
-
cd apps/api && pytest tests/test_blog.py -q
52
+
cd apps/api &&uv run pytest tests/test_blog.py -q
54
53
55
54
# Backend — single test function
56
-
cd apps/api && pytest tests/test_blog.py::test_function_name -q
55
+
cd apps/api &&uv run pytest tests/test_blog.py::test_function_name -q
57
56
```
58
57
59
58
### Pre-PR checks
@@ -133,9 +132,9 @@ The frontend uses `NEXT_PUBLIC_API_URL` (default `http://localhost:8000` in dev)
133
132
134
133
## Conventions
135
134
136
-
-**Package manager**: Bun for the frontend workspace. Python pip/poetry for the backend.
135
+
-**Package manager**: Bun for the frontend workspace. **uv**for the backend (`apps/api/pyproject.toml` + `uv.lock` are the single source of truth; there is no requirements.txt).
-**Python formatting/linting**: Ruff only (line-length 88, `ruff format` + `ruff check`, configured in `apps/api/pyproject.toml`). Black and isort are retired. Pre-commit runs the ruff hooks on changed files; note the repo carries pre-existing ruff debt in unchanged files (the required `precommit` CI check runs only hygiene hooks, not ruff).
139
138
-**TypeScript linting**: ESLint flat config (`eslint.config.mjs`) with `@typescript-eslint`, Next.js core-web-vitals, and react-hooks rules. `no-explicit-any` is warn-level.
140
139
-**Testing**: Vitest (jsdom) for frontend unit tests, Playwright for E2E, pytest for backend. Frontend coverage uses `all: true` (measures every source file) with a **ratchet floor** set to the current real baseline (~10%) that only moves up toward the branches 70% / functions+lines+statements 85% target — never lower the thresholds to make a build pass (see `docs/REMEDIATION_PLAN.md`).
141
140
-**Turbopack**: Default bundler in dev. E2E tests use `--webpack` flag for stability.
0 commit comments