From 73ff8ce9ec7921ec44beee6c6a2a1ccb1d60a993 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:53:15 +0000 Subject: [PATCH] [pre-commit.ci] Apply automatic pre-commit fixes --- conda-store-server/conda_store_server/_internal/orm.py | 2 +- .../conda_store_server/_internal/server/views/api.py | 4 ++-- conda-store-server/conda_store_server/app.py | 6 ++---- conda-store-server/conda_store_server/exception.py | 7 ++++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/conda-store-server/conda_store_server/_internal/orm.py b/conda-store-server/conda_store_server/_internal/orm.py index 468c8cbff..b3eb0879e 100644 --- a/conda-store-server/conda_store_server/_internal/orm.py +++ b/conda-store-server/conda_store_server/_internal/orm.py @@ -40,8 +40,8 @@ ) from conda_store_server._internal import conda_utils, schema, utils -from conda_store_server.exception import BuildPathError from conda_store_server._internal.environment import validate_environment +from conda_store_server.exception import BuildPathError logger = logging.getLogger("orm") diff --git a/conda-store-server/conda_store_server/_internal/server/views/api.py b/conda-store-server/conda_store_server/_internal/server/views/api.py index fec460cc8..b33c90ffd 100644 --- a/conda-store-server/conda_store_server/_internal/server/views/api.py +++ b/conda-store-server/conda_store_server/_internal/server/views/api.py @@ -12,12 +12,12 @@ from fastapi.responses import JSONResponse, PlainTextResponse, RedirectResponse from conda_store_server import __version__, api, app -from conda_store_server._internal import orm, schema, utils +from conda_store_server._internal import orm, schema 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.server.auth import Authentication from conda_store_server.exception import CondaStoreError +from conda_store_server.server.auth import Authentication class PaginatedArgs(TypedDict): diff --git a/conda-store-server/conda_store_server/app.py b/conda-store-server/conda_store_server/app.py index bb8af8c0e..fae95667d 100644 --- a/conda-store-server/conda_store_server/app.py +++ b/conda-store-server/conda_store_server/app.py @@ -26,8 +26,8 @@ from traitlets.config import LoggingConfigurable from conda_store_server import CONDA_STORE_DIR, BuildKey, api, storage -from conda_store_server.exception import CondaStoreError from conda_store_server._internal import conda_utils, environment, orm, schema, utils +from conda_store_server.exception import CondaStoreError from conda_store_server.plugins import hookspec, plugin_manager from conda_store_server.plugins.types import lock @@ -857,9 +857,7 @@ def delete_build(self, db: Session, build_id: int): schema.BuildStatus.FAILED, schema.BuildStatus.COMPLETED, ]: - raise CondaStoreError( - "cannot delete build since not finished building" - ) + raise CondaStoreError("cannot delete build since not finished building") build.deleted_on = datetime.datetime.utcnow() db.commit() diff --git a/conda-store-server/conda_store_server/exception.py b/conda-store-server/conda_store_server/exception.py index 949d0e4e3..61ccb844a 100644 --- a/conda-store-server/conda_store_server/exception.py +++ b/conda-store-server/conda_store_server/exception.py @@ -7,12 +7,13 @@ class CondaStoreError(Exception): """Exception raised by conda store - + Attributes ---------- message : str message to output to users """ + def __init__(self, msg: str): self.message = msg super().__init__(msg) @@ -20,7 +21,7 @@ def __init__(self, msg: str): class BuildPathError(CondaStoreError): """Exception raised by conda store when there is an issue with the requested build path - + Attributes ---------- message : str @@ -30,7 +31,7 @@ class BuildPathError(CondaStoreError): class CondaStorePluginNotFoundError(CondaStoreError): """Exception raised by conda store when a specified plugin is not found - + Attributes ---------- plugin : str