Add [build-system] to pyproject.toml, drop uv pip install -e . #58

Closed
opened 2026-03-21 19:12:13 +00:00 by kert · 0 comments
Owner

Problem

pyproject.toml has no [build-system] section. This means:

  • uv doesn't install the project itself into the venv — only dependencies
  • The CI pipeline uses uv pip install -e . (legacy pip-compat mode) to work around this
  • uv sync alone doesn't make import aco, import api, etc. work
  • Every time the venv is recreated, someone has to remember uv pip install -e .

There IS a [tool.uv.build-backend] section with namespace = true, but without [build-system] it doesn't activate.

Fix

  1. Add to pyproject.toml:
[build-system]
requires = ["uv>=0.7,<1"]
build-backend = "uv"

uv's own build backend is the right choice here since [tool.uv.build-backend] is already configured.

  1. Remove uv pip install -e . from:

    • .woodpecker/ci.yml (line 18)
    • Any mental model / workflow docs
  2. After this, uv sync --dev will install the project editably AND all deps in one command.

Files

  • pyproject.toml
  • .woodpecker/ci.yml
## Problem `pyproject.toml` has no `[build-system]` section. This means: - uv doesn't install the project itself into the venv — only dependencies - The CI pipeline uses `uv pip install -e .` (legacy pip-compat mode) to work around this - `uv sync` alone doesn't make `import aco`, `import api`, etc. work - Every time the venv is recreated, someone has to remember `uv pip install -e .` There IS a `[tool.uv.build-backend]` section with `namespace = true`, but without `[build-system]` it doesn't activate. ## Fix 1. Add to `pyproject.toml`: ```toml [build-system] requires = ["uv>=0.7,<1"] build-backend = "uv" ``` uv's own build backend is the right choice here since `[tool.uv.build-backend]` is already configured. 2. Remove `uv pip install -e .` from: - `.woodpecker/ci.yml` (line 18) - Any mental model / workflow docs 3. After this, `uv sync --dev` will install the project editably AND all deps in one command. ## Files - `pyproject.toml` - `.woodpecker/ci.yml`
kert added this to the P12: uv Hygiene — fix venv, build system, python resolution milestone 2026-03-21 19:12:13 +00:00
kert added the config label 2026-03-21 19:12:13 +00:00
kert closed this issue 2026-03-21 19:34:02 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: homelab/stack#58