Extract palace.opds into a uv workspace package (PP-4074)#3230
Merged
jonathangreen merged 4 commits intomainfrom Apr 14, 2026
Merged
Extract palace.opds into a uv workspace package (PP-4074)#3230jonathangreen merged 4 commits intomainfrom
jonathangreen merged 4 commits intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3230 +/- ##
==========================================
- Coverage 93.31% 93.30% -0.01%
==========================================
Files 498 498
Lines 46147 46147
Branches 6318 6318
==========================================
- Hits 43060 43059 -1
Misses 2003 2003
- Partials 1084 1085 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
62c3010 to
1cfbce1
Compare
2 tasks
193d6be to
f523689
Compare
1cfbce1 to
e8f5c0c
Compare
f523689 to
5001201
Compare
e8f5c0c to
d22102d
Compare
5c84059 to
3da1c0d
Compare
659eb42 to
e5d909b
Compare
2 tasks
tdilauro
approved these changes
Apr 14, 2026
Contributor
tdilauro
left a comment
There was a problem hiding this comment.
This looks good to me, too. 🚀
One overall comment: Since this is just for OPDS models, should it be named palace-opds-models to avoid confusion with other Palace OPDS stuff? If so, I'd say that now is the time to do it.
f1a63b2 to
5e5983c
Compare
jonathangreen
added a commit
that referenced
this pull request
Apr 14, 2026
## Description Convert the repo into a [`uv` workspace](https://docs.astral.sh/uv/concepts/projects/workspaces/) and carve out a new namespace package `palace-util` (namespace `palace.util`) that sits at the bottom of the Palace dependency graph — other Palace packages depend on it; it depends on no other Palace package. The package holds the small set of reusable, dependency-light utilities: - `palace.util.exceptions` — the base of Palace exception hierarchy - `palace.util.datetime_helpers` — timezone-aware datetime helpers. - `palace.util.log` — the standardized logging toolkit ## Motivation and Context Sets up the monorepo as a `uv` workspace and extracts the minimum subset of palace-manager that needs to come along with the upcoming `palace-opds` extraction (#3230). Having `palace-util` as its own workspace member lets both `palace-manager` and `palace-opds` (and eventually any other Palace project) depend on it without any of them pulling in each other. JIRA: PP-4076 ## How Has This Been Tested? - Tests run in CI ## Checklist - [x] I have updated the documentation accordingly. - [x] All new and existing tests passed.
e5d909b to
f42c076
Compare
Member
Author
|
I think |
Stacked on the palace-util extraction. Move palace.manager.opds into a
new workspace package at packages/palace-opds/ (namespace palace.opds)
and retarget all callers. The OPDS model tree is generic and reusable
across Palace projects; making it a standalone workspace member lets us
publish it independently without dragging in palace-manager.
palace-opds depends on palace-util for the three small cross-cutting
symbols the models need (PalaceValueError, utc_now/to_utc, LoggerMixin).
Callers rewritten (palace.manager.opds.* → palace.opds.*):
- 17 source files across palace.manager.{api, celery, data_layer, feed,
integration, sqlalchemy}.
- 15 test files across tests/manager/**.
Moved tests:
- tests/manager/opds/** → packages/palace-opds/tests/opds/**. The 5
tests that only use OPDS2FilesFixture / OPDS2WithODLFilesFixture as
type annotations now import them under TYPE_CHECKING so the package
tests don't need tests.fixtures.files at import time; pytest still
injects the fixtures at runtime via the root-conftest plugin.
- tests/manager/opds/types/test_language.py: replace LogLevel.warning
with stdlib logging.WARNING so the test has no palace.manager import.
Tooling:
- pyproject.toml: palace-opds added to [project.dependencies],
workspace members, mypy files/mypy_path, coverage source, pytest
testpaths. tests-mypy override picks up "opds.*".
- docker/Dockerfile, docker/Dockerfile.baseimage: copy
packages/palace-opds/pyproject.toml in the cache layer alongside
palace-util.
- README.md, CLAUDE.md: workspace section extended with palace-opds.
…hing Add a [tool.isort] block to packages/palace-opds/pyproject.toml that treats palace.opds as FIRSTPARTY (the package's own namespace) and palace.util as PALACE (other Palace package). Pass --resolve-all-configs (with --config-root .) to the pre-commit isort hook. Without this, pre-commit's batched --all-files invocation uses a single isort config (whichever it discovers first) for every file in the batch, defeating per-package configs and producing non-deterministic results between local and CI runs. Reflow the four palace-opds source files that imported both palace.opds and palace.util — they now show palace.util in PALACE above palace.opds in FIRSTPARTY.
Rewrite packages/palace-opds/README.md from an internal-conventions doc (workspace dependency rules, test layout, contributor criteria) into a consumer-facing one: what specs are covered, how to install, a quick usage example, design tradeoffs, then a short Project context section that acknowledges the Palace origin and points back to the monorepo for contributions. The internal-conventions content lives in CLAUDE.md where contributors look for it. Drop pydantic-xml from the dependencies — it was inherited from the palace-manager dep list but isn't actually imported anywhere in packages/palace-opds/src/. palace-manager keeps its own pydantic-xml dep for the places it does use it.
Without this file downstream packages using mypy will treat every import from palace.opds as untyped, losing the type information the Pydantic models already carry. PEP 561 requires the empty marker to opt the package into inline-typing distribution.
f42c076 to
568b49d
Compare
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
Move
palace.manager.opdsinto a new workspace packagepalace-opds(namespacepalace.opds) and retarget all callers topalace.opds.*.palace-opdsdepends onpalace-utilfor the small set of cross-cutting symbols the OPDS models need (PalaceValueError,utc_now/to_utc,LoggerMixin); it depends on no other Palace package — same dependency-graph rule documented in #3231.Motivation and Context
The OPDS Pydantic model tree describes formats exchanged across system boundaries — other Palace services and ingestion tools could reuse it without dragging in the full
palace-managerapplication. Extracting it as a workspace member lets us publish it independently in the future while keeping the monorepo as the source of truth.JIRA: PP-4074
How Has This Been Tested?
uv syncresolves the workspace cleanly with all three members.uv build --package palace-opdsproduces a wheel containing onlypalace/opds/**.mypypasses (1126 source files).pytest tests/palace_opds tests/palace_util— 232 tests pass.tox -e py312-docker) will run in CI.Conventions
This PR follows the workspace-member conventions established in #3231:
tests/palace_opds/(mirrors thetests/palace_util/layout) so they share root pytest fixtures and conftest plugins automatically.palace.manager— callers import frompalace.opds.*directly.pyproject.tomlfiles are copied (manifest-only) into the Docker cache layer souvcan resolve workspace deps.palace-opds/README.mdfollows the same template aspalace-util/README.md— purpose, scope, dependency-graph hard rule, stability, development.Checklist