Skip to content

Commit

Permalink
[pre-commit.ci] Apply automatic pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 17, 2024
1 parent 469c060 commit e8c5390
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions conda-store-server/conda_store_server/_internal/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
from conda_store_server import __version__, storage
from conda_store_server._internal import dbutil, orm
from conda_store_server._internal.server import views
from conda_store_server.server import auth
from conda_store_server.conda_store import CondaStore
from conda_store_server.conda_store import CondaStore
from conda_store_server.conda_store_config import CondaStore as CondaStoreConfig
from conda_store_server.server import auth


class _Color(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
from fastapi.responses import JSONResponse, PlainTextResponse, RedirectResponse

from conda_store_server import __version__, api
from conda_store_server.conda_store import CondaStore
from conda_store_server.conda_store_config import CondaStore as CondaStoreConfig
from conda_store_server._internal import orm, schema, utils
from conda_store_server._internal.environment import filter_environments
from conda_store_server._internal.schema import AuthenticationToken, Permissions
from conda_store_server._internal.server import dependencies
from conda_store_server.conda_store import CondaStore
from conda_store_server.server.auth import Authentication


Expand Down
4 changes: 2 additions & 2 deletions conda-store-server/conda_store_server/_internal/worker/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from traitlets.config import Application, catch_config_error

from conda_store_server import __version__
from conda_store_server.conda_store import CondaStore
from conda_store_server.conda_store import CondaStore
from conda_store_server.conda_store_config import CondaStore as CondaStoreConfig


Expand Down Expand Up @@ -67,7 +67,7 @@ def _validate_config_file(self, proposal):
def initialize(self, *args, **kwargs):
super().initialize(*args, **kwargs)
self.load_config_file(self.config_file)

self.conda_store_config = CondaStoreConfig(parent=self, log=self.log)
self.conda_store = CondaStore(config=self.conda_store_config)
# ensure checks on redis_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ def delete_build_artifact(db: Session, conda_store, build_artifact):
# ignore key
conda_prefix = build_artifact.build.build_path(conda_store)
# be REALLY sure this is a directory within store directory
if str(conda_prefix).startswith(conda_store.config.store_directory) and os.path.isdir(
conda_prefix
):
if str(conda_prefix).startswith(
conda_store.config.store_directory
) and os.path.isdir(conda_prefix):
shutil.rmtree(conda_prefix)
db.delete(build_artifact)
else:
Expand Down
8 changes: 4 additions & 4 deletions conda-store-server/conda_store_server/conda_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
# license that can be found in the LICENSE file.

import datetime
import logging
import os
from contextlib import contextmanager
from typing import Any, Dict
import logging

import pydantic
from celery import Celery, group
from sqlalchemy.orm import Session, sessionmaker
from sqlalchemy.pool import QueuePool

from conda_store_server import CONDA_STORE_DIR, api, storage, conda_store_config
from conda_store_server._internal import conda_utils, orm, schema, utils, environment
from conda_store_server import CONDA_STORE_DIR, api, conda_store_config, storage
from conda_store_server._internal import conda_utils, orm, schema, utils
from conda_store_server.plugins import hookspec, plugin_manager
from conda_store_server.plugins.types import lock


class CondaStore():
class CondaStore:
def __init__(self, config: conda_store_config.CondaStore):
self.config = config
self.log = logging.getLogger(__name__)
Expand Down
6 changes: 3 additions & 3 deletions conda-store-server/conda_store_server/conda_store_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
)
from traitlets.config import LoggingConfigurable

from conda_store_server import CONDA_STORE_DIR, BuildKey, api, registry, storage
from conda_store_server import CONDA_STORE_DIR, BuildKey, api, storage
from conda_store_server._internal import conda_utils, environment, schema, utils


Expand Down Expand Up @@ -125,7 +125,6 @@ def _default_celery_results_backend(self):
return self.redis_url
return f"db+{self.database_url}"


container_registry_class = Type(allow_none=True, help="(deprecated)")

conda_command = Unicode(
Expand Down Expand Up @@ -291,6 +290,7 @@ def _check_redis(self, proposal):
try:
if self.redis_url is not None:
import redis

r = redis.Redis.from_url(self.redis_url)
r.ping()
except Exception:
Expand Down Expand Up @@ -348,4 +348,4 @@ def _check_redis(self, proposal):
False,
help="Use the extended-length prefix '\\\\?\\' (Windows-only), default: False",
config=True,
)
)
2 changes: 1 addition & 1 deletion conda-store-server/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from sqlalchemy.orm import Session

from conda_store_server import api, storage
from conda_store_server.conda_store import CondaStore
from conda_store_server.conda_store import CondaStore
from conda_store_server.conda_store_config import CondaStore as CondaStoreConfig

from conda_store_server._internal import ( # isort:skip
Expand Down

0 comments on commit e8c5390

Please sign in to comment.