Extract palace.util into a uv workspace package (PP-4076)#3231
Open
jonathangreen wants to merge 3 commits intomainfrom
Open
Extract palace.util into a uv workspace package (PP-4076)#3231jonathangreen wants to merge 3 commits intomainfrom
jonathangreen wants to merge 3 commits intomainfrom
Conversation
2 tasks
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3231 +/- ##
=======================================
Coverage 93.30% 93.30%
=======================================
Files 497 498 +1
Lines 46144 46147 +3
Branches 6318 6318
=======================================
+ Hits 43054 43058 +4
Misses 2004 2004
+ Partials 1086 1085 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f523689 to
5001201
Compare
5c84059 to
3da1c0d
Compare
tdilauro
approved these changes
Apr 14, 2026
Contributor
tdilauro
left a comment
There was a problem hiding this comment.
This looks good to me. 🚀
The documentation updates are especially helpful. I didn't spend too much time looking at the changes under src/palace/manager, as I suspected (and it looked like) those changes were mostly about imports. Let me know if I misunderstood and, if so, I can take a deeper look there.
2 tasks
88c618a to
c9d32ed
Compare
Convert the repo into a uv workspace and carve out a new namespace package at packages/palace-util/ (namespace palace.util) holding the small set of cross-cutting utilities that are genuinely reusable. - palace.util.exceptions: BasePalaceException, PalaceValueError, PalaceTypeError. - palace.util.datetime_helpers: the full timezone-aware datetime helpers module (utc_now, to_utc, datetime_utc, from_timestamp, minute_timestamp, previous_months, strptime_utc). - palace.util.log: LoggerMixin, LoggerType, LoggerAdapterType, logger_for_cls.
Root config: list workspace packages explicitly under known_palace (['palace.opds', 'palace.util']) instead of the broad 'palace' prefix. The broad prefix accidentally caught 'from palace import manager' (the module being imported is 'palace', not 'palace.manager') and pulled it into the PALACE section instead of FIRSTPARTY. Add a per-package isort config to packages/palace-util so files there treat palace.util as their FIRSTPARTY (and need no PALACE section since palace-util depends on no other Palace package). isort discovers the nearest pyproject.toml per-file, so editor and pre-commit invocations pick the right config automatically.
Without this file downstream packages using mypy will treat every import from palace.util as untyped, losing the type information the models already carry. PEP 561 requires the empty marker to opt the package into inline-typing distribution.
f1a63b2 to
5e5983c
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
Convert the repo into a
uvworkspace and carve out a new namespace packagepalace-util(namespacepalace.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 hierarchypalace.util.datetime_helpers— timezone-aware datetime helpers.palace.util.log— the standardized logging toolkitMotivation and Context
Sets up the monorepo as a
uvworkspace and extracts the minimum subset of palace-manager that needs to come along with the upcomingpalace-opdsextraction (#3230). Havingpalace-utilas its own workspace member lets bothpalace-managerandpalace-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?
Checklist