Skip to content

Commit

Permalink
Fix a few final bad imports and paths
Browse files Browse the repository at this point in the history
  • Loading branch information
peytondmurray committed May 7, 2024
1 parent ef38447 commit 84fce45
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion conda-store-server/conda_store_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions conda-store-server/hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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()
Expand Down

0 comments on commit 84fce45

Please sign in to comment.