Skip to content

Commit

Permalink
Move around a few more files
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Apr 25, 2024
1 parent 8d3fdb0 commit 606a3bc
Show file tree
Hide file tree
Showing 47 changed files with 59 additions and 58 deletions.
2 changes: 1 addition & 1 deletion src/palace/manager/api/admin/controller/custom_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
from palace.manager.api.problem_details import CANNOT_DELETE_SHARED_LIST
from palace.manager.celery.tasks.custom_list import update_custom_list
from palace.manager.core.app_server import load_pagination_from_request
from palace.manager.core.external_search import ExternalSearchIndex
from palace.manager.core.problem_details import INVALID_INPUT, METHOD_NOT_ALLOWED
from palace.manager.core.query.customlist import CustomListQueries
from palace.manager.feed.acquisition import OPDSAcquisitionFeed
from palace.manager.search.external_search import ExternalSearchIndex
from palace.manager.sqlalchemy.model.collection import Collection
from palace.manager.sqlalchemy.model.customlist import CustomList
from palace.manager.sqlalchemy.model.datasource import DataSource
Expand Down
2 changes: 1 addition & 1 deletion src/palace/manager/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
PalaceXrayProfiler,
)
from palace.manager.core.app_server import ErrorHandler
from palace.manager.core.flask_sqlalchemy_session import flask_scoped_session
from palace.manager.service.container import Services, container_instance
from palace.manager.sqlalchemy.flask_sqlalchemy_session import flask_scoped_session
from palace.manager.sqlalchemy.model.key import Key, KeyType
from palace.manager.sqlalchemy.session import SessionManager
from palace.manager.util.cache import CachedData
Expand Down
2 changes: 1 addition & 1 deletion src/palace/manager/api/controller/opds_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
load_pagination_from_request,
)
from palace.manager.core.entrypoint import EverythingEntryPoint
from palace.manager.core.external_search import SortKeyPagination
from palace.manager.core.opensearch import OpenSearchDocument
from palace.manager.feed.acquisition import OPDSAcquisitionFeed
from palace.manager.feed.navigation import NavigationFeed
from palace.manager.feed.opds import NavigationFacets
from palace.manager.search.external_search import SortKeyPagination
from palace.manager.sqlalchemy.model.collection import Collection
from palace.manager.sqlalchemy.model.customlist import CustomList
from palace.manager.sqlalchemy.model.lane import (
Expand Down
2 changes: 1 addition & 1 deletion src/palace/manager/api/controller/work.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
from palace.manager.api.problem_details import NO_SUCH_LANE, NOT_FOUND_ON_REMOTE
from palace.manager.core.app_server import load_pagination_from_request
from palace.manager.core.config import CannotLoadConfiguration
from palace.manager.core.external_search import SortKeyPagination
from palace.manager.core.metadata_layer import ContributorData
from palace.manager.feed.acquisition import OPDSAcquisitionFeed
from palace.manager.search.external_search import SortKeyPagination
from palace.manager.sqlalchemy.model.lane import FeaturedFacets, Pagination
from palace.manager.util.opds_writer import OPDSFeed
from palace.manager.util.problem_detail import ProblemDetail
Expand Down
2 changes: 1 addition & 1 deletion src/palace/manager/api/overdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
)
from palace.manager.api.selftest import HasCollectionSelfTests, SelfTestResult
from palace.manager.core.config import CannotLoadConfiguration, Configuration
from palace.manager.core.connection_config import ConnectionSetting
from palace.manager.core.coverage import BibliographicCoverageProvider
from palace.manager.core.exceptions import IntegrationException
from palace.manager.core.metadata_layer import (
Expand All @@ -76,6 +75,7 @@
HasChildIntegrationConfiguration,
integration_settings_update,
)
from palace.manager.integration.configuration.connection import ConnectionSetting
from palace.manager.integration.goals import Goals
from palace.manager.integration.settings import (
BaseSettings,
Expand Down
2 changes: 1 addition & 1 deletion src/palace/manager/celery/tasks/custom_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

from palace.manager.celery.job import Job
from palace.manager.celery.task import Task
from palace.manager.core.external_search import ExternalSearchIndex
from palace.manager.core.query.customlist import CustomListQueries
from palace.manager.search.external_search import ExternalSearchIndex
from palace.manager.service.celery.celery import QueueNames
from palace.manager.sqlalchemy.model.customlist import CustomList, CustomListEntry
from palace.manager.util.cache import CachedData
Expand Down
8 changes: 4 additions & 4 deletions src/palace/manager/core/opds_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
)
from palace.manager.api.saml.credential import SAMLCredentialManager
from palace.manager.core.classifier import Classifier
from palace.manager.core.connection_config import ConnectionSetting
from palace.manager.core.coverage import CoverageFailure
from palace.manager.core.metadata_layer import (
CirculationData,
Expand All @@ -49,13 +48,14 @@
TimestampData,
)
from palace.manager.core.monitor import CollectionMonitor
from palace.manager.core.saml.wayfless import (
from palace.manager.integration.base import integration_settings_load
from palace.manager.integration.configuration.connection import ConnectionSetting
from palace.manager.integration.configuration.formats import FormatPrioritiesSettings
from palace.manager.integration.configuration.wayfless import (
SAMLWAYFlessConstants,
SAMLWAYFlessFulfillmentError,
SAMLWAYFlessSetttings,
)
from palace.manager.integration.base import integration_settings_load
from palace.manager.integration.configuration.formats import FormatPrioritiesSettings
from palace.manager.integration.settings import (
BaseSettings,
ConfigurationFormItem,
Expand Down
2 changes: 1 addition & 1 deletion src/palace/manager/core/query/customlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
CUSTOMLIST_ENTRY_NOT_VALID_FOR_LIBRARY,
CUSTOMLIST_SOURCE_COLLECTION_MISSING,
)
from palace.manager.core.external_search import ExternalSearchIndex, SortKeyPagination
from palace.manager.search.external_search import ExternalSearchIndex, SortKeyPagination
from palace.manager.sqlalchemy.model.customlist import CustomList, CustomListEntry
from palace.manager.sqlalchemy.model.lane import SearchFacets, WorkList
from palace.manager.sqlalchemy.model.library import Library
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion src/palace/manager/core/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
CollectionCoverageProviderJob,
CoverageProviderProgress,
)
from palace.manager.core.external_search import ExternalSearchIndex, Filter
from palace.manager.core.metadata_layer import TimestampData
from palace.manager.core.monitor import CollectionMonitor, ReaperMonitor
from palace.manager.core.opds_import import OPDSAPI, OPDSImporter, OPDSImportMonitor
Expand All @@ -30,6 +29,7 @@
)
from palace.manager.search.coverage_provider import SearchIndexCoverageProvider
from palace.manager.search.coverage_remover import RemovesSearchCoverage
from palace.manager.search.external_search import ExternalSearchIndex, Filter
from palace.manager.service.container import Services, container_instance
from palace.manager.sqlalchemy.listeners import site_configuration_has_changed
from palace.manager.sqlalchemy.model.classification import Classification, Subject
Expand Down
5 changes: 4 additions & 1 deletion src/palace/manager/feed/acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from palace.manager.api.problem_details import NOT_FOUND_ON_REMOTE
from palace.manager.core.entrypoint import EntryPoint
from palace.manager.core.external_search import ExternalSearchIndex, QueryParseException
from palace.manager.core.facets import FacetConstants
from palace.manager.core.problem_details import INVALID_INPUT
from palace.manager.feed.annotator.base import Annotator
Expand All @@ -22,6 +21,10 @@
from palace.manager.feed.opds import BaseOPDSFeed, UnfulfillableWork
from palace.manager.feed.types import FeedData, Link, WorkEntry
from palace.manager.feed.util import strftime
from palace.manager.search.external_search import (
ExternalSearchIndex,
QueryParseException,
)
from palace.manager.sqlalchemy.constants import LinkRelations
from palace.manager.sqlalchemy.model.edition import Edition
from palace.manager.sqlalchemy.model.identifier import Identifier
Expand Down
2 changes: 1 addition & 1 deletion src/palace/manager/feed/annotator/circulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from palace.manager.core.config import CannotLoadConfiguration
from palace.manager.core.entrypoint import EverythingEntryPoint
from palace.manager.core.exceptions import BasePalaceException
from palace.manager.core.external_search import WorkSearchResult
from palace.manager.core.lcp.credential import LCPCredentialFactory, LCPHashedPassphrase
from palace.manager.core.lcp.exceptions import LCPError
from palace.manager.feed.annotator.base import Annotator
Expand All @@ -38,6 +37,7 @@
)
from palace.manager.feed.util import strftime
from palace.manager.integration.configuration.formats import FormatPriorities
from palace.manager.search.external_search import WorkSearchResult
from palace.manager.service.analytics.analytics import Analytics
from palace.manager.service.container import Services
from palace.manager.sqlalchemy.model.circulationevent import CirculationEvent
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/palace/manager/service/search/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from dependency_injector.providers import Provider
from opensearchpy import OpenSearch

from palace.manager.core.external_search import ExternalSearchIndex
from palace.manager.search.external_search import ExternalSearchIndex
from palace.manager.search.revision_directory import SearchRevisionDirectory
from palace.manager.search.service import SearchServiceOpensearch1

Expand Down
2 changes: 1 addition & 1 deletion src/palace/manager/sqlalchemy/model/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from palace.manager.sqlalchemy.util import create

if TYPE_CHECKING:
from palace.manager.core.external_search import ExternalSearchIndex
from palace.manager.search.external_search import ExternalSearchIndex
from palace.manager.sqlalchemy.model.credential import Credential
from palace.manager.sqlalchemy.model.customlist import CustomList

Expand Down
8 changes: 4 additions & 4 deletions src/palace/manager/sqlalchemy/model/lane.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
from palace.manager.util.problem_detail import ProblemDetail

if TYPE_CHECKING:
from palace.manager.core.external_search import (
from palace.manager.search.external_search import (
ExternalSearchIndex,
WorkSearchResult,
)
Expand Down Expand Up @@ -1863,7 +1863,7 @@ def filter(self, _db, facets):
Using this ensures that modify_search_filter_hook() is always
called.
"""
from palace.manager.core.external_search import Filter
from palace.manager.search.external_search import Filter

filter = Filter.from_worklist(_db, self, facets)
modified = self.modify_search_filter_hook(filter)
Expand Down Expand Up @@ -1900,7 +1900,7 @@ def works_for_resultsets(self, _db, resultsets, facets=None):
"""Convert a list of lists of Hit objects into a list
of lists of Work objects.
"""
from palace.manager.core.external_search import Filter, WorkSearchResult
from palace.manager.search.external_search import Filter, WorkSearchResult

has_script_fields = None
work_ids = set()
Expand Down Expand Up @@ -2166,7 +2166,7 @@ def _featured_works_with_lanes(
queries = []
for lane in lanes:
overview_facets = lane.overview_facets(_db, facets)
from palace.manager.core.external_search import Filter
from palace.manager.search.external_search import Filter

filter = Filter.from_worklist(_db, lane, overview_facets)
queries.append((None, filter, pagination))
Expand Down
2 changes: 1 addition & 1 deletion src/palace/manager/sqlalchemy/model/work.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
from typing_extensions import Self

if TYPE_CHECKING:
from palace.manager.core.external_search import ExternalSearchIndex
from palace.manager.search.external_search import ExternalSearchIndex
from palace.manager.sqlalchemy.model.customlist import CustomListEntry
from palace.manager.sqlalchemy.model.library import Library
from palace.manager.sqlalchemy.model.licensing import LicensePool
Expand Down
4 changes: 2 additions & 2 deletions src/palace/manager/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sqlalchemy import distinct, select
from sqlalchemy.sql.functions import func

import palace.manager.core.flask_sqlalchemy_session
import palace.manager.sqlalchemy.flask_sqlalchemy_session


def batch(iterable, size=1):
Expand Down Expand Up @@ -549,7 +549,7 @@ def is_session(value: object) -> bool:
value,
(
sqlalchemy.orm.session.Session,
palace.manager.core.flask_sqlalchemy_session.flask_scoped_session,
palace.manager.sqlalchemy.flask_sqlalchemy_session.flask_scoped_session,
),
)

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from opensearchpy import OpenSearch
from pydantic import AnyHttpUrl

from palace.manager.core.external_search import ExternalSearchIndex
from palace.manager.search.coverage_provider import SearchIndexCoverageProvider
from palace.manager.search.external_search import ExternalSearchIndex
from palace.manager.search.service import SearchServiceOpensearch1
from palace.manager.service.configuration import ServiceConfiguration
from palace.manager.service.container import Services, wire_container
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pytest
from celery import Celery

from palace.manager.core.external_search import ExternalSearchIndex
from palace.manager.search.external_search import ExternalSearchIndex
from palace.manager.search.revision_directory import SearchRevisionDirectory
from palace.manager.search.service import SearchServiceOpensearch1
from palace.manager.service.analytics.analytics import Analytics
Expand Down
2 changes: 1 addition & 1 deletion tests/manager/api/controller/test_crawlfeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
DynamicLane,
)
from palace.manager.api.problem_details import NO_SUCH_COLLECTION, NO_SUCH_LIST
from palace.manager.core.external_search import SortKeyPagination
from palace.manager.core.problem_details import INVALID_INPUT
from palace.manager.feed.acquisition import OPDSAcquisitionFeed
from palace.manager.feed.annotator.circulation import CirculationManagerAnnotator
from palace.manager.search.external_search import SortKeyPagination
from palace.manager.util.flask_util import Response
from palace.manager.util.problem_detail import ProblemDetail
from tests.fixtures.api_controller import CirculationControllerFixture
Expand Down
2 changes: 1 addition & 1 deletion tests/manager/api/controller/test_opds_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from palace.manager.api.lanes import HasSeriesFacets, JackpotFacets, JackpotWorkList
from palace.manager.core.app_server import load_facets_from_request
from palace.manager.core.entrypoint import AudiobooksEntryPoint, EverythingEntryPoint
from palace.manager.core.external_search import SortKeyPagination
from palace.manager.feed.acquisition import OPDSAcquisitionFeed
from palace.manager.feed.annotator.circulation import LibraryAnnotator
from palace.manager.feed.navigation import NavigationFeed
from palace.manager.feed.opds import NavigationFacets
from palace.manager.search.external_search import SortKeyPagination
from palace.manager.sqlalchemy.model.edition import Edition
from palace.manager.sqlalchemy.model.lane import (
Facets,
Expand Down
2 changes: 1 addition & 1 deletion tests/manager/api/controller/test_scopedsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from sqlalchemy.orm import Session

from palace.manager import api
from palace.manager.core.flask_sqlalchemy_session import current_session
from palace.manager.core.opds_import import OPDSAPI
from palace.manager.sqlalchemy.flask_sqlalchemy_session import current_session
from palace.manager.sqlalchemy.model.collection import Collection
from palace.manager.sqlalchemy.model.datasource import DataSource
from palace.manager.sqlalchemy.model.identifier import Identifier
Expand Down
2 changes: 1 addition & 1 deletion tests/manager/api/controller/test_work.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
from palace.manager.api.problem_details import NO_SUCH_LANE, NOT_FOUND_ON_REMOTE
from palace.manager.core.classifier import Classifier
from palace.manager.core.entrypoint import AudiobooksEntryPoint
from palace.manager.core.external_search import SortKeyPagination
from palace.manager.core.metadata_layer import ContributorData, Metadata
from palace.manager.core.problem_details import INVALID_INPUT
from palace.manager.feed.acquisition import OPDSAcquisitionFeed
from palace.manager.feed.annotator.circulation import LibraryAnnotator
from palace.manager.feed.types import WorkEntry
from palace.manager.search.external_search import SortKeyPagination
from palace.manager.sqlalchemy.constants import MediaTypes
from palace.manager.sqlalchemy.model.datasource import DataSource
from palace.manager.sqlalchemy.model.edition import Edition
Expand Down
2 changes: 1 addition & 1 deletion tests/manager/api/test_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
from palace.manager.api.simple_authentication import SimpleAuthenticationProvider
from palace.manager.api.sip import SIP2AuthenticationProvider
from palace.manager.api.util.patron import PatronUtility
from palace.manager.core.mock_analytics_provider import MockAnalyticsProvider
from palace.manager.core.user_profile import ProfileController
from palace.manager.integration.goals import Goals
from palace.manager.integration.registry.base import IntegrationRegistry
Expand All @@ -74,6 +73,7 @@
from palace.manager.util.problem_detail import ProblemDetail
from tests.fixtures.announcements import AnnouncementFixture
from tests.fixtures.library import LibraryFixture
from tests.mocks.analytics_provider import MockAnalyticsProvider

if TYPE_CHECKING:
from tests.fixtures.api_controller import ControllerFixture
Expand Down
2 changes: 1 addition & 1 deletion tests/manager/api/test_axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
SubjectData,
TimestampData,
)
from palace.manager.core.mock_analytics_provider import MockAnalyticsProvider
from palace.manager.core.scripts import RunCollectionCoverageProviderScript
from palace.manager.integration.base import integration_settings_update
from palace.manager.service.analytics.analytics import Analytics
Expand All @@ -72,6 +71,7 @@
from palace.manager.util.problem_detail import ProblemDetail, ProblemDetailException
from tests.fixtures.files import FilesFixture
from tests.fixtures.library import LibraryFixture
from tests.mocks.analytics_provider import MockAnalyticsProvider
from tests.mocks.axis import MockAxis360API

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion tests/manager/api/test_bibliotheca.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
)
from palace.manager.api.web_publication_manifest import FindawayManifest
from palace.manager.core.metadata_layer import ReplacementPolicy, TimestampData
from palace.manager.core.mock_analytics_provider import MockAnalyticsProvider
from palace.manager.core.scripts import RunCollectionCoverageProviderScript
from palace.manager.service.analytics.analytics import Analytics
from palace.manager.sqlalchemy.model.circulationevent import CirculationEvent
Expand All @@ -69,6 +68,7 @@
from palace.manager.util.datetime_helpers import datetime_utc, utc_now
from palace.manager.util.http import BadResponseException
from palace.manager.util.web_publication_manifest import AudiobookManifest
from tests.mocks.analytics_provider import MockAnalyticsProvider
from tests.mocks.bibliotheca import MockBibliothecaAPI

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion tests/manager/api/test_circulationapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
PatronHoldLimitReached,
PatronLoanLimitReached,
)
from palace.manager.core.mock_analytics_provider import MockAnalyticsProvider
from palace.manager.core.opds_import import OPDSAPI
from palace.manager.service.analytics.analytics import Analytics
from palace.manager.sqlalchemy.model.circulationevent import CirculationEvent
Expand All @@ -47,6 +46,7 @@
from tests.fixtures.database import DatabaseTransactionFixture
from tests.fixtures.files import BibliothecaFilesFixture
from tests.fixtures.library import LibraryFixture
from tests.mocks.analytics_provider import MockAnalyticsProvider
from tests.mocks.bibliotheca import MockBibliothecaAPI
from tests.mocks.circulation import (
MockCirculationAPI,
Expand Down
2 changes: 1 addition & 1 deletion tests/manager/api/test_enki.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ def test__update_circulation(self, enki_test_fixture: EnkiTestFixure):
api.queue_response(200, content=json.dumps(circ_data))
api.queue_response(200, content=json.dumps(bib_data))

from palace.manager.core.mock_analytics_provider import MockAnalyticsProvider
from tests.mocks.analytics_provider import MockAnalyticsProvider

analytics = MockAnalyticsProvider()
monitor = EnkiImport(
Expand Down
2 changes: 1 addition & 1 deletion tests/manager/api/test_lanes.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
from palace.manager.api.overdrive import OverdriveAPI
from palace.manager.core.classifier import Classifier
from palace.manager.core.entrypoint import AudiobooksEntryPoint
from palace.manager.core.external_search import Filter
from palace.manager.core.metadata_layer import ContributorData, Metadata
from palace.manager.integration.goals import Goals
from palace.manager.integration.registry.metadata import MetadataRegistry
from palace.manager.search.external_search import Filter
from palace.manager.sqlalchemy.model.contributor import Contributor
from palace.manager.sqlalchemy.model.datasource import DataSource
from palace.manager.sqlalchemy.model.edition import Edition
Expand Down
Loading

0 comments on commit 606a3bc

Please sign in to comment.