Migrated from pip to uv #374
No reviewers
Labels
No labels
Kestra
bug
enhancement
someday
subtask
☁️ api
🎛️ infrastructure
🐞 sentry
📆 2025 Season
📝 pages
allpicks
📝 pages
picks
📝 pages
standings
🚀 performance
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
johnsturgeon/tgfp-web!374
Loading…
Reference in a new issue
No description provided.
Delete branch "migrate-to-uv-and-pyproject-toml-343"
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?
I've reviewed the diff and the key files it touches. This is a clean, well-documented migration from pip/requirements.txt to uv/pyproject.toml, and the surrounding comments do a good job explaining the non-obvious choices (editable install +
/srv,uv runavoided at runtime, dev group excluded from the image). The mechanics are sound; my findings are minor.Review: Migrated from pip to uv (#374)
Overall this is a careful, well-reasoned migration and the resolution is preserved 1:1 from
config/requirements.txt, with the version now sourced from package metadata. Nothing here is blocking; the notes below are about a couple of small correctness/robustness gaps and test coverage.Worth fixing
scripts/test_and_lint.shwon't fail on a failing test or lint. The script usesset -uo pipefailbut not-e, and the final command isflake8 ... --exit-zero. So ifuv run pytestoruv run pylintfails, execution continues and the script's exit status is that of the--exit-zeroflake8 call — i.e.0. A developer running the local gate would see a green exit even with failing tests or pylint errors. This matches the pre-migration behavior, but the newset -uo pipefailheader signals an intent to be strict that-e(or an explicit accumulator) would actually deliver.scripts/test_and_lint.sh:4Stale Alembic fallback path in the entrypoint.
docker/entrypoint.sh:24still defaults to/app/alembic.ini(${ALEMBIC_CONFIG:-/app/alembic.ini}). The image now lives under/srvand the Dockerfile setsALEMBIC_CONFIG=/srv/alembic.ini, so this is harmless in the built image — but the fallback is now a path that doesn't exist, so any invocation with the env var unset would fail confusingly. Worth updating to/srv/alembic.inito match the new layout.docker/entrypoint.sh:24APP_VERSIONcan now lag the running code in production.app_version()reads the version baked into the distribution metadata at image build time (app/config/config.py:16), whilecompose.prod.ymlstill bind-mounts./app:/srv/app. That means after agit pullthat changes app code without rebuilding the image, the reported version (Sentryrelease=, cache-busting query string) will reflect the old build, not the running tree — a regression from the old behavior wherecreate_prod_env.shwroteAPP_VERSIONfromconfig/version.envat env-generation time. The PR notes #370 removes these mounts, which resolves it; until then it's a real drift worth calling out.compose.prod.yml:10,app/config/config.py:30Nits
No test coverage for
app_version(). It's the one piece of genuinely new logic (the raise-on-PackageNotFoundErrorpath in particular), and CI's pytest step is still a placeholderecho "pytest is not enabled yet"(.forgejo/workflows/lint.yml). Not new to this PR, but the migration is a natural moment to add a first real test.Pre-push hook checks that
pyproject.tomlwas touched, not that the version changed..githooks/pre-push:35greps for the filename in the diff; apyproject.tomledit that leavesversionuntouched still satisfies the gate. This is identical to the oldconfig/version.envbehavior, so no regression — just noting the guarantee is weaker than "the version was bumped."Wheel asset packaging for the no-mount future. With
packages = ["app"]and the editable install, templates/static underapp/are read straight from/srv/apptoday, so everything works. Once #370 drops the bind mounts, it'd be worth confirmingapp/templates/*.j2and any static assets actually ship inside the wheel. Nothing to change now.uvdirectly and pyproject is the source of truth for the version