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 18, 2024
1 parent 85472d3 commit 73ff8ce
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion conda-store-server/conda_store_server/_internal/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

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

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

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)


class BuildPathError(CondaStoreError):
"""Exception raised by conda store when there is an issue with the requested build path
Attributes
----------
message : str
Expand All @@ -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
Expand Down

0 comments on commit 73ff8ce

Please sign in to comment.