Skip to content

Convert poetry to uv - #301

Draft
aedwardstx wants to merge 10 commits into
netdevops:nextfrom
aedwardstx:convert-poetry-to-uv
Draft

Convert poetry to uv#301
aedwardstx wants to merge 10 commits into
netdevops:nextfrom
aedwardstx:convert-poetry-to-uv

Conversation

@aedwardstx

Copy link
Copy Markdown
Collaborator

Summary

Migrates hier_config dependency management, packaging, build backend, and CI workflows from Poetry to uv.

  • Package metadata migrated to PEP 621 [project] and PEP 735 [dependency-groups].
  • Build backend switched to uv_build (license-files = ["LICENSE"] specified explicitly to preserve distribution integrity).
  • Replaced poetry.lock with uv.lock.
  • Updated GitHub Actions workflows to use astral-sh/setup-uv@v5, native uv build / uv publish, UV_FROZEN: "1", and pinned UV_PYTHON: ${{ matrix.python-version }} to maintain test matrix fidelity.
  • Updated Renovate config (matchManagers: ["pep621"], matchDepTypes: ["project.dependencies"]).
  • Updated developer docs, contributor guides, instructions, and test docstrings to reflect uv run commands.

Self-Review Checklist

  • uv run ./scripts/build.py lint-and-test passes locally (lint + 95% test coverage).
  • Tests were written first (TDD) and cover the change, following the testing conventions.
  • CHANGELOG.md has an entry under ## [Unreleased] referencing this issue/PR ((#NNN)).
  • Documentation is updated if public API or driver behavior changed (and mkdocs build --strict passes if docs were touched).
  • Commit messages follow the contributing guide: imperative mood, subject ≤72 characters, body explains why.

AI-Assisted Contributions

Self-reviewed via /self-review with full test, lint, and packaging validation.

Andrew Edwards and others added 10 commits September 7, 2026 10:34
Document the architectural design for migrating project packaging,
dependency management, build backend, and CI/CD workflows to uv.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace [tool.poetry] configuration with PEP 621 [project], PEP 735
[dependency-groups], and PEP 517 build-system using uv_build.
Remove poetry.lock and add uv.lock.
Replace snok/install-poetry with astral-sh/setup-uv@v5 across all workflows.
Update prepare-release to use uv version with alpha/beta/rc bump types.
Update deploy-pypi to use uv build and uv publish with UV_PUBLISH_TOKEN.
Update renovate.json to manage dependencies under pep621 manager.
Replace references to poetry run with uv run in scripts and test docstrings.
Replace all poetry commands and setup instructions with uv across
contributor guides, docs pages, and Claude Code skills.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The Poetry build shipped LICENSE via its own metadata handling, and
MANIFEST.in declared `include LICENSE` for setuptools. Neither applies
under uv_build, which does not glob license files by default, so the
migrated build dropped LICENSE from both artifacts -- a regression
against 3.6.2, whose PyPI wheel carries dist-info/LICENSE.

Declare `license-files` explicitly so LICENSE lands in the sdist and in
the wheel's dist-info, then remove MANIFEST.in now that it is inert
setuptools-only configuration. Also drop pytest-runner, which has been
unmaintained since 2019 and only existed for the `setup.py test` flow.

Self-Review: true

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Three defects surfaced by review of the uv migration:

uv defaults to `python-preference = managed` with automatic downloads, so
`uv sync` ignores the interpreter that actions/setup-python puts on PATH
and resolves its own. Verified locally: with PATH python3 at 3.12.13, uv
selected a managed CPython 3.14.4, which silently collapses the 3.10-3.14
matrix into five identical runs. Setting UV_PYTHON to the matrix version
restores per-leg fidelity (verified: UV_PYTHON=3.11 selects 3.11.15).

`uv run` re-locks and re-syncs by default, so it can rewrite uv.lock even
after `uv sync --frozen` -- including in the review job that is explicitly
instructed not to modify files. UV_FROZEN makes a stale lockfile fail the
job instead.

Renovate's pep621 manager reports runtime dependencies with depType
`project.dependencies`, not `dependencies`, so the rule holding runtime
deps to `update-lockfile` matched nothing after the manager switch and the
global `bump` strategy would have raised pydantic's lower bound.

Self-Review: true

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
CONTRIBUTING.md lost `poetry shell` in the migration without gaining a
replacement, which left every subsequent bare `pytest`, `ruff`, `mypy`,
and `scripts/build.py` invocation broken for anyone following the page.
Prefix them with `uv run`, matching docs/dev/contributing.md and AGENTS.md.

Document what the migration changed but did not explain: the lockfile
workflow (`uv add` / `uv lock`, commit uv.lock) now that CI installs with
`uv sync --frozen`, and the release bump semantics, since `uv version`
refuses non-increasing bumps and so behaves differently from Poetry's
single `prerelease` choice.

Correct entries inside [Unreleased] that this branch invalidated -- the
claude-review job no longer installs a poetry environment, and the
prepare-release bump choices are now alpha/beta/rc. Released sections keep
their poetry references as historical record.

Delete the AI planning artifacts under docs/superpowers/; they sit inside
docs_dir, so mkdocs would publish them to Read the Docs, and they are
absent from the nav.

Self-Review: true

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@aedwardstx
aedwardstx requested a review from jtdub as a code owner September 7, 2026 19:31
@aedwardstx
aedwardstx marked this pull request as draft September 7, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant