build: Migrate from Poetry to uv - #143
Merged
Merged
Conversation
Replaces poetry.lock with uv.lock. Dev dependencies move from [project.optional-dependencies] to [dependency-groups], which uv installs by default on sync. BREAKING: the 'dev' extra is no longer published, so 'pip install async-firebase[dev]' no longer works. Dev dependencies are CI tooling and were never intended for library consumers.
Drops the create-virtualenv cache-warming job, now redundant with setup-uv's built-in caching. Uses uv sync --locked so CI fails if uv.lock drifts from pyproject.toml.
Replaces poetry build/publish with uv build/publish using OIDC, removing the need for a PYPI_TOKEN secret. Requires a trusted publisher configured on PyPI for this repo and cd.yml before the next tagged release.
The pip ecosystem does not update uv.lock. Also replaces the dependency-type group filter, which is undocumented for uv, with an explicit pattern list covering every dev-group member.
Also gitignores docs/superpowers/, which holds agent tooling scratch output that should not be committed.
Specifying any permissions block drops every unlisted scope to none, so the OIDC-only block left actions/checkout without contents: read and would have failed the release job at checkout on the first tagged push.
astral-sh/setup-uv does not publish floating major tags — neither v9 nor v8 resolve, only exact versions. The v9 reference failed every job with "Unable to resolve action astral-sh/setup-uv@v9".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces Poetry with uv as this project's dependency manager, lock-file generator, task runner, and release tool.
This is a tooling-only change.
pyproject.tomlwas already PEP 621 withhatchlingas the build backend, so no package metadata was rewritten. The published package, its runtime dependencies (google-auth,httpx,h11), and the build backend are all unchanged. Not one line underasync_firebase/ortests/was touched.What changed
poetry.lockuv.lock[project.optional-dependencies] dev[dependency-groups] devpoetry run …uv run …snok/install-poetry+actions/setup-python+actions/cacheastral-sh/setup-uv@v9poetry build/poetry publish+PYPI_TOKENuv build/uv publishvia OIDCpackage-ecosystem: pippackage-ecosystem: uvDependency versions are untouched
Every runtime and dev dependency constraint moved across character-for-character. The only
pyproject.tomlchange is the table header:[project.optional-dependencies]→[dependency-groups].CI got simpler
The
create-virtualenvjob is gone. It ran a five-version matrix purely to warm a venv cache that each downstream job rebuilt anyway;setup-uv's built-in caching replaces it. The four remaining jobs keep their exact names (linters-ruff,linters-mypy,test,integration-test), so required-status-checks are unaffected. Triggers, the 3.10–3.14 matrix,needs:edges, the fork guard, and the Codacy step are all unchanged.CI now syncs with
uv sync --locked, which fails the build ifuv.lockdrifts frompyproject.toml.Dependabot had to change ecosystems
The
pipecosystem does not understanduv.lock— left as-is, Dependabot would have silently stopped updating dependencies oncepoetry.lockwas deleted. Thedev-dependenciesgroup also moved from adependency-type: "development"filter to an explicitpatternslist, becausedependency-typeis documented forpipbut not foruv. Runtime deps are deliberately excluded from the group so they keep arriving as individually reviewable PRs.The
devextra has been removed.pip install async-firebase[dev]no longer installs anything.Library consumers are unaffected — this only ever contained CI tooling. Worth knowing: uv/pip resolve the missing extra with a warning, not an error, so the command still exits 0 while installing only the runtime packages.
Contributors with an existing environment should run:
rm -rf .venv && make setup_devmake installbehaviour changeThe old target ran
poetry config virtualenvs.create falseand installed globally.uv sync --no-devnow creates and populates.venvinstead. If anything downstream depended on the global install,uv sync --no-dev --activeis the equivalent.🔴 Required before the next release
A trusted publisher must be configured on PyPI, or the next tagged release will fail to publish.
PyPI →
async-firebase→ Manage → Publishing → Add a new GitHub publisher:healthjoyasync-firebasecd.ymlKeep the
PYPI_TOKENsecret in place until one release has published successfully via OIDC, then delete it.Testing
Verified locally on a clean
rm -rf .venv && uv sync --lockedrebuild:138 passed, 8 skipped, 98% coverage — identical to the pre-migration baselineruff checkandruff format --checkcleanmypycleanuv buildproduces both sdist and wheel; the built wheel installs into a throwaway env and importstwine checkpasses on both artifactsmake install,make setup_dev,make test,make mypyall workpoetryreferences remain outside theCHANGES.mdentryNot verifiable locally:
Note for reviewers
A whole-branch review caught one genuine bug worth calling out, fixed in
10d30ac: the CD job originally specifiedpermissions: id-token: writealone. GitHub replaces rather than merges permissions, so every unlisted scope drops tonone—actions/checkoutwould have failed with a 403 at the release job's first step, beforeuv publishever ran. Addingcontents: readfixes it, matching the pattern already used incodeql-analysis.yml.The
uv.lockdiff is large but entirely generated — reviewpyproject.tomlinstead to confirm no constraint drifted.