Skip to content

Commit 5df8a21

Browse files
Replace palace-manager dependency with palace-opds (PP-3973) (#242)
## Summary - Depend on the extracted [palace-opds](ThePalaceProject/circulation#3230) package instead of the full palace-manager monorepo, dropping a large set of unnecessary transitive deps. - Rename imports from `palace.manager.opds.*` → `palace.opds.*`. - Inline the tiny `LibraryImportInfo` Pydantic model into the CSV import CLI (it lives in palace-manager, not palace-opds). - palace-util is added explicitly because Poetry does not honor uv workspace sources (removed again in the follow-up uv migration PR). ## Test plan - [x] \`poetry run mypy\` clean - [x] \`poetry run pytest\` (154 tests) passes
1 parent e0fa3e8 commit 5df8a21

6 files changed

Lines changed: 123 additions & 3855 deletions

File tree

poetry.lock

Lines changed: 104 additions & 3847 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ddsketch = "^3.0.1"
3333
httpx = "^0.28.1"
3434
jwcrypto = "^1.5.6"
3535
mutagen = "^1.47.0"
36-
palace-manager = {git = "https://github.com/ThePalaceProject/circulation.git", branch = "main"}
36+
palace-opds = "^41.0.0"
3737
psycopg2-binary = "^2.9.11"
3838
pydantic = "^2.11.7"
3939
python = ">=3.12,<4"

src/palace_tools/cli/import_libraries_from_csv.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,23 @@
55

66
import requests
77
import typer
8+
from pydantic import BaseModel
89
from requests import Response
910

10-
from palace.manager.api.admin.controller.library_settings import LibraryImportInfo
11-
1211
from palace_tools.utils.typer import run_typer_app_as_main
1312

13+
14+
class LibraryImportInfo(BaseModel):
15+
name: str
16+
short_name: str
17+
website_url: str
18+
patron_support_email: str
19+
large_collection_languages: list[str]
20+
small_collection_languages: list[str]
21+
facets_default_order: str
22+
enabled_entry_points: list[str]
23+
24+
1425
app = typer.Typer()
1526

1627

src/palace_tools/cli/validate_feed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import typer
77

8-
from palace.manager.opds import opds2
9-
from palace.manager.opds.odl import odl
8+
from palace.opds import opds2
9+
from palace.opds.odl import odl
1010

1111
from palace_tools.feeds import opds
1212
from palace_tools.utils.typer import run_typer_app_as_main

src/palace_tools/validation/opds.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
from pydantic import TypeAdapter, ValidationError
88

9-
from palace.manager.opds.opds2 import PublicationFeedNoValidation
9+
from palace.opds.opds2 import PublicationFeedNoValidation
1010

1111
from palace_tools.utils.logging import LogCapture
1212

1313
# Logger name for capturing OPDS parsing warnings
14-
OPDS_LOGGER_NAME = "palace.manager.opds"
14+
OPDS_LOGGER_NAME = "palace.opds"
1515

1616

1717
def _should_ignore_error(error: ValidationError, ignore_errors: list[str]) -> bool:

tests/palace_tools/validation/test_opds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pytest
66

7-
from palace.manager.opds.opds2 import Publication
7+
from palace.opds.opds2 import Publication
88

99
from palace_tools.validation.opds import validate_opds_feeds, validate_opds_publications
1010

0 commit comments

Comments
 (0)