Skip to content

Commit

Permalink
Merge pull request #385 from lsst-sqre/tickets/DM-47811
Browse files Browse the repository at this point in the history
DM-47811: Fixes to address FAST001 and FAST002 ruff rules and update-deps #232
  • Loading branch information
stvoutsin authored Nov 27, 2024
2 parents e1d9976 + a9e8956 commit 1e726ab
Show file tree
Hide file tree
Showing 10 changed files with 447 additions and 458 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: check-toml

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.4
rev: v0.8.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
462 changes: 235 additions & 227 deletions requirements/dev.txt

Large diffs are not rendered by default.

418 changes: 205 additions & 213 deletions requirements/main.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/mobu/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""The mobu service."""

__all__ = ["__version__", "metadata", "main"]
__all__ = ["__version__", "main", "metadata"]

from importlib.metadata import PackageNotFoundError, version

Expand Down
2 changes: 1 addition & 1 deletion src/mobu/dependencies/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
__all__ = [
"ContextDependency",
"RequestContext",
"context_dependency",
"anonymous_context_dependency",
"context_dependency",
]


Expand Down
2 changes: 1 addition & 1 deletion src/mobu/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"MobuSlackException",
"MobuSlackWebException",
"MonkeyNotFoundError",
"TAPClientError",
"SubprocessError",
"TAPClientError",
]


Expand Down
12 changes: 1 addition & 11 deletions src/mobu/handlers/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def render(self, content: Any) -> bytes:
@external_router.get(
"/",
description=("Metadata about the running version of mobu"),
response_model=Index,
response_model_exclude_none=True,
summary="Application metadata",
)
Expand All @@ -61,9 +60,7 @@ async def get_index(
return Index(metadata=metadata)


@external_router.get(
"/flocks", response_model=list[str], summary="List running flocks"
)
@external_router.get("/flocks", summary="List running flocks")
async def get_flocks(
context: Annotated[RequestContext, Depends(context_dependency)],
) -> list[str]:
Expand All @@ -73,7 +70,6 @@ async def get_flocks(
@external_router.put(
"/flocks",
response_class=FormattedJSONResponse,
response_model=FlockData,
response_model_exclude_none=True,
response_model_exclude_unset=True,
status_code=201,
Expand All @@ -98,7 +94,6 @@ async def put_flock(
@external_router.get(
"/flocks/{flock}",
response_class=FormattedJSONResponse,
response_model=FlockData,
response_model_exclude_none=True,
response_model_exclude_unset=True,
responses={404: {"description": "Flock not found", "model": ErrorModel}},
Expand Down Expand Up @@ -142,7 +137,6 @@ async def delete_flock(
@external_router.get(
"/flocks/{flock}/monkeys",
response_class=FormattedJSONResponse,
response_model=list[str],
responses={404: {"description": "Flock not found", "model": ErrorModel}},
summary="Monkeys in flock",
)
Expand All @@ -156,7 +150,6 @@ async def get_monkeys(
@external_router.get(
"/flocks/{flock}/monkeys/{monkey}",
response_class=FormattedJSONResponse,
response_model=MonkeyData,
response_model_exclude_none=True,
response_model_exclude_unset=True,
responses={
Expand Down Expand Up @@ -212,7 +205,6 @@ def iterfile() -> Iterator[bytes]:
@external_router.get(
"/flocks/{flock}/summary",
response_class=FormattedJSONResponse,
response_model=FlockSummary,
responses={404: {"description": "Flock not found", "model": ErrorModel}},
summary="Summary of statistics for a flock",
)
Expand All @@ -226,7 +218,6 @@ async def get_flock_summary(
@external_router.post(
"/run",
response_class=FormattedJSONResponse,
response_model=SolitaryResult,
response_model_exclude_none=True,
response_model_exclude_unset=True,
summary="Run monkey business once",
Expand All @@ -246,7 +237,6 @@ async def put_run(
@external_router.get(
"/summary",
response_class=FormattedJSONResponse,
response_model=CombinedSummary,
summary="Summary of all app state",
)
async def get_summary(
Expand Down
1 change: 0 additions & 1 deletion src/mobu/handlers/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
" a health check. This route is not exposed outside the cluster and"
" therefore cannot be used by external clients."
),
response_model=Metadata,
response_model_exclude_none=True,
summary="Application metadata",
)
Expand Down
2 changes: 1 addition & 1 deletion src/mobu/models/business/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

__all__ = [
"BusinessConfig",
"BusinessOptions",
"BusinessData",
"BusinessOptions",
"SerializableTimedelta",
]

Expand Down
2 changes: 1 addition & 1 deletion src/mobu/storage/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from ..exceptions import GitHubFileNotFoundError

__all__ = ["GitHubStorage", "CheckRun"]
__all__ = ["CheckRun", "GitHubStorage"]


class _CheckRunRequestOutput(BaseModel):
Expand Down

0 comments on commit 1e726ab

Please sign in to comment.