Migrate from Poetry to uv for dependency management (PP-4076)#3221
Merged
jonathangreen merged 11 commits intomainfrom Apr 14, 2026
Merged
Migrate from Poetry to uv for dependency management (PP-4076)#3221jonathangreen merged 11 commits intomainfrom
jonathangreen merged 11 commits intomainfrom
Conversation
eae2bdf to
f9c8666
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3221 +/- ##
=======================================
Coverage 93.30% 93.30%
=======================================
Files 497 497
Lines 46144 46144
Branches 6318 6318
=======================================
+ Hits 43054 43055 +1
Misses 2004 2004
+ Partials 1086 1085 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jonathangreen
added a commit
that referenced
this pull request
Apr 10, 2026
Black can auto-detect target versions from pyproject.toml, which will bring in unexpected formatting changes when python-requires is updated (see #3221). Explicitly set -t py312/py313/py314 in pre-commit config so these formatting changes are introduced separately.
2 tasks
jonathangreen
added a commit
that referenced
this pull request
Apr 10, 2026
Black can auto-detect target versions from pyproject.toml, which will bring in unexpected formatting changes when python-requires is updated (see #3221). Explicitly set -t py312/py313/py314 in pre-commit config so these formatting changes are introduced separately.
4094ed6 to
27a80ed
Compare
jonathangreen
added a commit
that referenced
this pull request
Apr 13, 2026
## Description Explicitly set `-t py312`, `-t py313`, and `-t py314` target version flags for black in the pre-commit configuration, and apply the resulting formatting changes. ## Motivation and Context In #3221, a change to `python-requires` in `pyproject.toml` allows black to auto-detect the supported Python versions. This auto-detection brings in unexpected formatting changes (parenthesized `with` statements, trailing commas on `**kwargs`, etc.). By explicitly setting the target versions in pre-commit and applying the formatting changes here, we can land #3221 without mixing unrelated formatting noise into that PR. Reference: https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#t-target-version ## How Has This Been Tested? - `pre-commit run -a` passes cleanly with the updated configuration. ## Checklist - [x] I have updated the documentation accordingly. - [x] All new and existing tests passed.
This was referenced Apr 13, 2026
Replace Poetry with uv across the entire project: pyproject.toml converted to PEP 621 with hatchling build backend, dependency groups (PEP 735) for dev/ci, pg moved to an optional-dependencies extra, and tox-uv added for tox integration. All four GitHub workflows now use astral-sh/setup-uv@v4. Docker images use COPY --from=ghcr.io/astral-sh/uv:0.5 instead of the Poetry curl installer. README and CLAUDE.md updated to reflect the new tooling. Dependabot switched from pip to uv ecosystem. uv.lock is excluded from the check-added-large-files pre-commit hook since lockfiles must be checked in regardless of size. This is PR 1 of the monorepo restructure plan. The .github/actions/poetry composite action is intentionally left on disk for transitive consumers in other repositories.
…ault Add a recommended direnv setup section so developers can auto-activate the virtualenv on cd without needing the uv run prefix. Change the default install command from uv sync to uv sync --all-groups so both dev and ci groups are installed. Fix broken #pyenv anchor reference.
Move psycopg2-binary from the dev dependency group into the main project dependencies and drop the pg optional extra entirely. In Docker containers where the environment is fully controlled, psycopg2-binary works fine in production and eliminates the need to maintain separate binary/source variants. Remove --extra pg from Dockerfiles, workflows, and README.
Add a 4-day cooldown for uv dependency updates as recommended by the uv dependabot integration docs, to avoid PRs that uv cannot resolve due to exclude-newer constraints.
The commands_pre section with punkt_tab and textblob corpus downloads was accidentally dropped during the Poetry-to-uv migration. Without these corpora, the summary evaluator tests fail with MissingCorpusError.
The uv-venv-runner doesn't install project dependencies (it's a simple venv creator). Switch to uv-venv-lock-runner which runs `uv sync --locked` to install the project and all dependencies from the lockfile. Also remove `skipsdist = true` which prevented tox from installing the project, and use `package = skip` for the report env instead of `skip_install`.
- Pin setup-uv to v8.0.0 and use activate-environment to avoid uv run wrappers in all workflows - Fix test.yml: pass matrix python-version to setup-python so tox actually tests against 3.12, 3.13, and 3.14 - Add --frozen to lint.yml install step for CI consistency - Move UV_PROJECT_ENVIRONMENT to ENV in Dockerfile.baseimage so it propagates to child images automatically - Bump uv Docker image from 0.5 to 0.11
88c618a to
c9d32ed
Compare
jonathangreen
added a commit
that referenced
this pull request
Apr 15, 2026
The Poetry to uv migration in #3221 switched the container install from editable (Poetry's default) to non-editable (uv sync --no-editable). That change broke palace.manager.scripts.startup's discovery of the startup_tasks/ directory — the script resolves STARTUP_TASKS_DIR via Path(__file__).parents[4], which assumes startup.py is at ${root}/src/palace/manager/scripts/startup.py (editable install). Under --no-editable, startup.py lives inside site-packages and parents[4] resolves to env/lib/python3.12/ instead of the project root, so startup_tasks/ is never found. Drop --no-editable to restore the working layout.
2 tasks
jonathangreen
added a commit
to ThePalaceProject/palace-tools
that referenced
this pull request
Apr 15, 2026
Switch dependency management and build tooling from Poetry to uv, matching the configuration pattern used in the circulation repo (PR ThePalaceProject/circulation#3221). - Rewrite pyproject.toml using PEP 621 [project] + hatchling build backend; move dev/ci deps to PEP 735 [dependency-groups]; git subdirectory deps move to [tool.uv.sources] (palace-util now resolves transitively via palace-opds). - Replace poetry.lock with uv.lock. - tox.ini uses the uv-venv-lock-runner (tox-uv). - GitHub workflows use astral-sh/setup-uv; lint workflow gets a pre-commit cache. - Dependabot switches from pip to uv ecosystem. - README documents uv-based setup. - .python-version now pins a real version (was a pyenv-virtualenv name).
3 tasks
jonathangreen
added a commit
that referenced
this pull request
Apr 15, 2026
## Description Drop `--no-editable` from the final `uv sync` in `docker/Dockerfile` so `palace-manager` is installed editably in the container — same behavior we had under Poetry. ## Motivation and Context Found while checking the uv changes that rolled out to Minotaur last night. The Poetry → uv migration in #3221 switched the in-container install from editable (Poetry's default) to non-editable (`uv sync --no-editable`). That change quietly broke `palace.manager.scripts.startup`'s discovery of the `startup_tasks/` directory: ``` Startup tasks directory /var/www/circulation/env/lib/python3.12/startup_tasks does not exist; skipping. ``` The script resolves `STARTUP_TASKS_DIR` via `Path(__file__).parents[4]`, which assumes `startup.py` is at `${root}/src/palace/manager/scripts/startup.py` (editable install). Under `--no-editable`, `startup.py` lives inside `site-packages` and `parents[4]` resolves to `env/lib/python3.12/` instead of the project root, so `startup_tasks/` is never found. Restoring the editable install fixes the immediate breakage and matches the previous behavior. It also has the minor side benefit of making in-container debugging easier — you can edit files in place without rebuilding the image. ## Future work Eventually we'd like to build `palace-manager` as a proper non-editable package that can be published the same way `palace-util` and `palace-opds` will be. Several path-resolution issues need to be sorted out first (alembic migrations, startup scripts, and similar file-layout assumptions) before that's feasible. For now, editable install is the simpler and safer choice. ## How Has This Been Tested? - Built the image locally and confirmed `startup.py` now resolves `STARTUP_TASKS_DIR` to `/var/www/circulation/startup_tasks`. - Existing startup task (`2026_02_17_force_re_harvest_all_opds_for_distributors.py`) is picked up. ## Checklist - [x] I have updated the documentation accordingly. - [x] All new and existing tests passed.
jonathangreen
added a commit
to ThePalaceProject/palace-tools
that referenced
this pull request
Apr 15, 2026
Switch dependency management and build tooling from Poetry to uv, matching the configuration pattern used in the circulation repo (PR ThePalaceProject/circulation#3221). - Rewrite pyproject.toml using PEP 621 [project] + hatchling build backend; move dev/ci deps to PEP 735 [dependency-groups]; git subdirectory deps move to [tool.uv.sources] (palace-util now resolves transitively via palace-opds). - Replace poetry.lock with uv.lock. - tox.ini uses the uv-venv-lock-runner (tox-uv). - GitHub workflows use astral-sh/setup-uv; lint workflow gets a pre-commit cache. - Dependabot switches from pip to uv ecosystem. - README documents uv-based setup. - .python-version now pins a real version (was a pyenv-virtualenv name).
jonathangreen
added a commit
to ThePalaceProject/palace-tools
that referenced
this pull request
Apr 15, 2026
Switch dependency management and build tooling from Poetry to uv, matching the configuration pattern used in the circulation repo (PR ThePalaceProject/circulation#3221). - Rewrite pyproject.toml using PEP 621 [project] + hatchling build backend; move dev/ci deps to PEP 735 [dependency-groups]; git subdirectory deps move to [tool.uv.sources] (palace-util now resolves transitively via palace-opds). - Replace poetry.lock with uv.lock. - tox.ini uses the uv-venv-lock-runner (tox-uv). - GitHub workflows use astral-sh/setup-uv; lint workflow gets a pre-commit cache. - Dependabot switches from pip to uv ecosystem. - README documents uv-based setup.
jonathangreen
added a commit
to ThePalaceProject/palace-tools
that referenced
this pull request
Apr 15, 2026
Switch dependency management and build tooling from Poetry to uv, matching the configuration pattern used in the circulation repo (PR ThePalaceProject/circulation#3221). - Rewrite pyproject.toml using PEP 621 [project] + hatchling build backend; move dev/ci deps to PEP 735 [dependency-groups]; git subdirectory deps move to [tool.uv.sources] (palace-util now resolves transitively via palace-opds). - Replace poetry.lock with uv.lock. - tox.ini uses the uv-venv-lock-runner (tox-uv). - GitHub workflows use astral-sh/setup-uv; lint workflow gets a pre-commit cache. - Dependabot switches from pip to uv ecosystem. - README documents uv-based setup.
jonathangreen
added a commit
to ThePalaceProject/palace-tools
that referenced
this pull request
Apr 15, 2026
## Summary - Switch dependency management and build tooling from Poetry to [uv](https://docs.astral.sh/uv/), matching the pattern introduced in [circulation#3221](ThePalaceProject/circulation#3221). - Rewrite \`pyproject.toml\` using PEP 621 \`[project]\` + \`hatchling\` build backend; dev/ci deps move to PEP 735 \`[dependency-groups]\`; git subdirectory deps move to \`[tool.uv.sources]\` (with \`palace-util\` now resolved transitively via palace-opds). - Replace \`poetry.lock\` with \`uv.lock\`. - \`tox.ini\` uses the \`uv-venv-lock-runner\` from \`tox-uv\`. - GitHub workflows use \`astral-sh/setup-uv\`; lint workflow gains a pre-commit cache. - Dependabot switches from \`pip\` to \`uv\` ecosystem. - README documents uv-based setup; \`.python-version\` now pins a real version (was a pyenv-virtualenv name). > Stacked on top of #242. Please review/merge that one first. ## Test plan - [x] \`uv run mypy\` clean - [x] \`uv run pytest\` (154 tests) passes - [x] \`tox\` (py312), \`tox -e mypy\`, \`tox -e lint\` all green
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.
Description
Migrate the entire project from Poetry to uv for dependency management, packaging, and virtualenv orchestration.
Motivation and Context
Poetry lacks native workspace/monorepo support, which is needed for future project restructuring. uv also provides faster dependency resolution, built-in Python version management, and a simpler CI setup via
astral-sh/setup-uv.How Has This Been Tested?
uv lockresolves 213 packages successfullyuv buildproduces a clean sdist + wheel (597 files, correct namespace)uv sync --all-groupsinstalls all dependenciesuv run mypypasses (1123 source files, no issues)uv run pytest --no-cov tests/manager/util/test_log.pypasses (23 tests)Checklist