Skip to content

Migrate from Poetry to uv#650

Open
skearnes wants to merge 2 commits intomainfrom
migrate-to-uv
Open

Migrate from Poetry to uv#650
skearnes wants to merge 2 commits intomainfrom
migrate-to-uv

Conversation

@skearnes
Copy link
Copy Markdown
Member

@skearnes skearnes commented Apr 14, 2026

Summary

  • Replace Poetry with uv for Python dependency management
  • Convert pyproject.toml from [tool.poetry] layout to PEP 621 [project] + [dependency-groups]
  • Regenerate lockfile (poetry.lockuv.lock)
  • Update both Dockerfiles, entrypoint.sh, and the tests / checks workflows to use uv sync / uv run
  • Promote greenlet to a first-class dependency (previously injected via poetry add greenlet in CI)
  • Drop Python 3.10 / 3.11 from the tests.yml matrix — they never satisfied requires-python = ">=3.12,<3.13" and were silently failing under the old Poetry config
  • Pin astral-sh/setup-uv to a commit SHA (SonarCloud hotspot)

Notes

  • [tool.uv] package = false — we don't build/publish ord_app as a wheel; uv sync installs only dependencies, matching the previous poetry install --no-root behavior.
  • Version specifiers translated from Poetry carets (^x.y.z) to PEP 440 ranges (>=x.y.z,<next). python = "~3.12" became requires-python = ">=3.12,<3.13".
  • Dockerfiles set UV_PROJECT_ENVIRONMENT=/usr/local so uvicorn/alembic land on PATH, letting entrypoint.sh and supervisord.conf call them directly (no wrapper needed).
  • Dockerfile.single uses uv sync --no-dev for production; Dockerfile (dev image) syncs the full env including the dev group.

Test plan

  • uv sync --frozen succeeds locally
  • uv run ruff check ord_app/ passes
  • docker build -f Dockerfile . succeeds; resulting image has uvicorn/alembic on PATH and import ord_app, fastapi, sqlalchemy, alembic works
  • docker build -f Dockerfile.single . succeeds; resulting image has uvicorn/alembic on PATH, imports work, and pytest is correctly absent (--no-dev)
  • uv run pytype -j auto passes in CI
  • uv run alembic upgrade head succeeds in CI against Postgres
  • uv run pytest -vv --cov=ord_app passes in CI
  • Running containers serve traffic end-to-end (not exercised locally — no Postgres wired up)

🤖 Generated with Claude Code

skearnes and others added 2 commits April 14, 2026 19:26
Replaces Poetry with uv for Python dependency management. Converts
pyproject.toml to PEP 621 format, regenerates the lockfile, and updates
the Dockerfiles, entrypoint, and CI workflows to use uv.

greenlet is now a declared dependency (previously added ad-hoc in CI).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Addresses SonarCloud hotspots by pinning astral-sh/setup-uv to its
commit SHA. Drops Python 3.10/3.11 from the tests matrix — they never
satisfied requires-python = ">=3.12,<3.13" and were silently failing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@skearnes skearnes requested a review from bdeadman April 14, 2026 23:44
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