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 9589f16c3..06093aa31 100644 --- a/conda-store-server/conda_store_server/exception.py +++ b/conda-store-server/conda_store_server/exception.py @@ -8,10 +8,12 @@ class CondaStoreError(Exception): """ Exception raised by conda store - - Attributes: + + Attributes + ---------- message -- message to output to users """ + def __init__(self, msg: str): self.message = msg super().__init__(msg) @@ -20,8 +22,9 @@ def __init__(self, msg: str): class BuildPathError(CondaStoreError): """ Exception raised by conda store when there is an issue with the requested build path - - Attributes: + + Attributes + ---------- message -- message to output to users """ @@ -29,8 +32,9 @@ class BuildPathError(CondaStoreError): class CondaStorePluginNotFoundError(CondaStoreError): """ Exception raised by conda store when a specified plugin is not found - - Attributes: + + Attributes + ---------- plugin -- plugin that was not found available_plugins -- list of registered plugins """