From 84fce4535db024785114c6e87e3bc308cce51702 Mon Sep 17 00:00:00 2001 From: pdmurray Date: Mon, 6 May 2024 21:46:51 -0700 Subject: [PATCH] Fix a few final bad imports and paths --- conda-store-server/conda_store_server/__init__.py | 2 +- .../conda_store_server/_internal/worker/tasks.py | 2 +- conda-store-server/hatch_build.py | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/conda-store-server/conda_store_server/__init__.py b/conda-store-server/conda_store_server/__init__.py index 60dfdb27d..d0bae8787 100644 --- a/conda-store-server/conda_store_server/__init__.py +++ b/conda-store-server/conda_store_server/__init__.py @@ -120,7 +120,7 @@ def parse_build_key( ) -> int: """Returns build id from build key""" # This import is here to avoid cyclic imports - from conda_store_server import orm + from conda_store_server._internal import orm parts = build_key.split("-") # Note: cannot rely on the number of dashes to differentiate between diff --git a/conda-store-server/conda_store_server/_internal/worker/tasks.py b/conda-store-server/conda_store_server/_internal/worker/tasks.py index 2364bc39d..16c97ea31 100644 --- a/conda-store-server/conda_store_server/_internal/worker/tasks.py +++ b/conda-store-server/conda_store_server/_internal/worker/tasks.py @@ -68,7 +68,7 @@ def _shutdown(*args, **kwargs): # CondaStoreServer @shared_task(base=WorkerTask, name="task_initialize_worker", bind=True) def task_initialize_worker(self): - from conda_store_server import orm + from conda_store_server._internal import orm conda_store = self.worker.conda_store diff --git a/conda-store-server/hatch_build.py b/conda-store-server/hatch_build.py index 742db2503..bb10cc397 100644 --- a/conda-store-server/hatch_build.py +++ b/conda-store-server/hatch_build.py @@ -25,7 +25,8 @@ class DownloadCondaStoreUIHook(BuildHookInterface): def clean(self, versions: List[str]) -> None: super().clean(versions) destination_directory = ( - pathlib.Path(self.root) / "conda_store_server/server/static/conda-store-ui" + pathlib.Path(self.root) + / "conda_store_server/_internal/server/static/conda-store-ui" ) shutil.rmtree(destination_directory, ignore_errors=True) @@ -48,7 +49,7 @@ def initialize(self, version: str, build_data: Dict[str, Any]) -> None: source_directory = tmp_dir / "package/dist" destination_directory = ( pathlib.Path(self.root) - / "conda_store_server/server/static/conda-store-ui" + / "conda_store_server/_internal/server/static/conda-store-ui" ) destination_directory.mkdir(parents=True, exist_ok=True) @@ -61,7 +62,7 @@ def initialize(self, version: str, build_data: Dict[str, Any]) -> None: # dirty modifications (bound to break eventually!) to # main.js to enable easy configuration see - # conda_store_server/server/templates/conda-store-ui.html + # conda_store_server/_internal/server/templates/conda-store-ui.html # for global variable set with (source_directory / "main.js").open("r", encoding="utf-8") as source_f: content = source_f.read()