migrate pyproject.toml from [tool.poetry] to PEP 621 [project] for uv #28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
pyproject.tomldeclares deps under the legacy[tool.poetry]/[tool.poetry.dependencies]tables. The working dev toolchain isuv (not poetry — confirmed in
reference_satmachineadmin_test_runner.md), and uv reads the PEP 621[project]table. Runninguv lockagainst the currentpyproject.tomlproduces a header-onlyuv.lock(3 lines, no deps)because uv can't see anything under the poetry tables.
Symptom:
uv.lockwas untracked for a long time and looked committablebut pinned nothing. We added it to
.gitignorein[commit-pending] as a stopgap; this issue tracks the real fix.
What needs to change
Migrate the relevant sections of
pyproject.toml:Before (current):
After (PEP 621 + uv):
(Hatchling is uv's preferred default backend; could also stay on
poetry.core.masonry.apiif we want backward compat with anyone stillon poetry — but since the working tool is uv, hatchling is the
simplest path.)
The
[tool.mypy],[tool.pytest.ini_options],[tool.black],[tool.ruff]sections stay as-is — uv doesn't touch those.Why bother
uv lockproduces a sha-pinned lockfile listingevery transitive dep. Reproducible installs, security audits, and
the "is this dep version compromised?" check all become tractable.
uv syncdoes nothinguseful because the project declaration is invisible to uv.
Contributors
pip install-ing into the LNbits venv work byaccident, not by spec.
"use uv, not poetry"; the workspace
CLAUDE.mdcalls poetry theprimary toolchain only as legacy mention. Migrating brings the
satmachineadmin repo in line with the workflow we actually use.
Steps
pyproject.tomlper the sketch above. Watch forsubtleties:
lnbitsversion constraint: currently{version = "*", allow-prereleases = true}. Confirm whether uv needs an explicitprerelease policy (
tool.uv.prerelease)."^3.10 | ^3.9"is poetry-flavoredOR-syntax; PEP 621 takes
requires-python = ">=3.10". Drop the3.9 branch (LNbits itself requires 3.10+).
uv lock— confirm it produces a real lockfile with everytransitive dep pinned.
uv sync --frozenin a fresh venv to verify install matchesthe LNbits dev container's existing
/app/.venv./app/.venv/bin/python -m pytest -qinsidethe dev container) — should remain at 75 passed.
uv.lockfrom.gitignoreand commit the lockfile.CLAUDE.md"Development Commands" section todocument
uv run …patterns (notpoetry run …).Cross-cutting
Same migration is probably warranted across other aiolabs LNbits
extensions (
aiolabs/lnurlp,aiolabs/withdraw,aiolabs/events,aiolabs/libra) and the lnbits fork itself. Don't bundle theminto this issue — each is a separate small migration. Track
sibling issues as they're filed.
Priority
Low. The current setup works — dev container has the right deps
installed, tests pass, production builds via NixOS flake input
(which doesn't consult
pyproject.tomlfor runtime deps). Themigration is hygiene, not a blocker. Ship after v2 launch.
➡️ Migrated to aiolabs/spirekeeper#16 (aiolabs/spirekeeper#16).
The v2-bitspire line of this extension now lives in its own repo,
aiolabs/spirekeeper. Tracking for this issue continues there; closing here. (Issue numbers were reassigned in the new repo.)