diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 472010d..be4c548 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 # Use the ref you want to point at + rev: v4.6.0 # Use the ref you want to point at hooks: - id: trailing-whitespace - id: check-ast @@ -15,8 +15,8 @@ repos: - id: check-yaml - id: check-toml - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.2.2' + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: 'v0.4.3' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -25,7 +25,7 @@ repos: types_or: [python, jupyter] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.10.0 hooks: - id: mypy entry: python3 -m mypy --config-file pyproject.toml @@ -34,7 +34,7 @@ repos: exclude: "florist/tests/" - repo: https://github.com/nbQA-dev/nbQA - rev: 1.7.1 + rev: 1.8.5 hooks: - id: nbqa-ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/florist/api/client.py b/florist/api/client.py index 27529e0..cfe512f 100644 --- a/florist/api/client.py +++ b/florist/api/client.py @@ -1,4 +1,5 @@ """FLorist client FastAPI endpoints.""" + import json import logging import uuid diff --git a/florist/api/clients/common.py b/florist/api/clients/common.py index bdc77f1..6a9e79e 100644 --- a/florist/api/clients/common.py +++ b/florist/api/clients/common.py @@ -1,4 +1,5 @@ """Common functions and definitions for clients.""" + from enum import Enum from typing import List diff --git a/florist/api/clients/mnist.py b/florist/api/clients/mnist.py index 575fc27..ca6093f 100644 --- a/florist/api/clients/mnist.py +++ b/florist/api/clients/mnist.py @@ -1,4 +1,5 @@ """Implementation of the MNIST client and model.""" + from typing import Tuple import torch diff --git a/florist/api/db/entities.py b/florist/api/db/entities.py index 547abb0..aa2ef43 100644 --- a/florist/api/db/entities.py +++ b/florist/api/db/entities.py @@ -1,4 +1,5 @@ """Definitions for the MongoDB database entities.""" + import json import uuid from enum import Enum diff --git a/florist/api/launchers/local.py b/florist/api/launchers/local.py index 1681f5e..a085e71 100644 --- a/florist/api/launchers/local.py +++ b/florist/api/launchers/local.py @@ -1,4 +1,5 @@ """Launcher functions for local clients and servers.""" + import logging import sys import time diff --git a/florist/api/models/mnist.py b/florist/api/models/mnist.py index dd4a71b..29f41cd 100644 --- a/florist/api/models/mnist.py +++ b/florist/api/models/mnist.py @@ -1,4 +1,5 @@ """Definitions for the MNIST model.""" + import torch import torch.nn.functional as f from torch import nn diff --git a/florist/api/monitoring/logs.py b/florist/api/monitoring/logs.py index ed8bdfb..64c0e2f 100644 --- a/florist/api/monitoring/logs.py +++ b/florist/api/monitoring/logs.py @@ -1,4 +1,5 @@ """General functions and definitions for monitoring.""" + from pathlib import Path diff --git a/florist/api/monitoring/metrics.py b/florist/api/monitoring/metrics.py index f03afbf..91631b1 100644 --- a/florist/api/monitoring/metrics.py +++ b/florist/api/monitoring/metrics.py @@ -1,4 +1,5 @@ """Classes for the instrumentation of metrics reporting from clients and servers.""" + import json import time from logging import DEBUG, Logger diff --git a/florist/api/routes/server/job.py b/florist/api/routes/server/job.py index 09787f4..f322cd0 100644 --- a/florist/api/routes/server/job.py +++ b/florist/api/routes/server/job.py @@ -1,4 +1,5 @@ """FastAPI routes for the job.""" + from json import JSONDecodeError from typing import Any, Dict, List diff --git a/florist/api/routes/server/status.py b/florist/api/routes/server/status.py index 4d13882..02ccce8 100644 --- a/florist/api/routes/server/status.py +++ b/florist/api/routes/server/status.py @@ -1,4 +1,5 @@ """FastAPI routes for checking server status.""" + import json import logging diff --git a/florist/api/routes/server/training.py b/florist/api/routes/server/training.py index 75101f8..f4cfdcc 100644 --- a/florist/api/routes/server/training.py +++ b/florist/api/routes/server/training.py @@ -1,4 +1,5 @@ """FastAPI routes for training.""" + import logging from typing import List diff --git a/florist/api/server.py b/florist/api/server.py index 040e3eb..fbb388d 100644 --- a/florist/api/server.py +++ b/florist/api/server.py @@ -1,4 +1,5 @@ """FLorist server FastAPI endpoints and routes.""" + from contextlib import asynccontextmanager from typing import Any, AsyncGenerator diff --git a/florist/api/servers/common.py b/florist/api/servers/common.py index a8c784f..e51ef5e 100644 --- a/florist/api/servers/common.py +++ b/florist/api/servers/common.py @@ -1,4 +1,5 @@ """Common functions and definitions for servers.""" + import json from enum import Enum from typing import List diff --git a/florist/api/servers/launch.py b/florist/api/servers/launch.py index 2971f91..7122d5c 100644 --- a/florist/api/servers/launch.py +++ b/florist/api/servers/launch.py @@ -1,4 +1,5 @@ """Functions and definitions to launch local servers.""" + import uuid from functools import partial from multiprocessing import Process diff --git a/florist/api/servers/utils.py b/florist/api/servers/utils.py index d64f161..4470ecd 100644 --- a/florist/api/servers/utils.py +++ b/florist/api/servers/utils.py @@ -1,4 +1,5 @@ """Utilities functions and definitions for starting a server.""" + from functools import partial from typing import Callable, Dict, Union