From 2967da15118bc3c88c35da0e12f5aae0fd726ad0 Mon Sep 17 00:00:00 2001 From: Georgon Date: Sat, 11 Jul 2026 17:01:30 +0300 Subject: [PATCH 1/4] style: update Black and isort formatting --- migrations/env.py | 1 - migrations/versions/052f7b817bbd_init.py | 4 ++-- modal_backend/__init__.py | 1 - modal_backend/__main__.py | 1 - modal_backend/models/__init__.py | 1 - modal_backend/models/db.py | 1 - modal_backend/routes/__init__.py | 1 - modal_backend/routes/base.py | 1 - modal_backend/routes/groups.py | 1 - modal_backend/routes/note_type.py | 1 - modal_backend/routes/notes.py | 1 - modal_backend/routes/services.py | 1 - pyproject.toml | 3 --- 13 files changed, 2 insertions(+), 16 deletions(-) diff --git a/migrations/env.py b/migrations/env.py index 176348d..a0eb964 100644 --- a/migrations/env.py +++ b/migrations/env.py @@ -6,7 +6,6 @@ from modal_backend.models.base import BaseDbModel from modal_backend.settings import get_settings - # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config diff --git a/migrations/versions/052f7b817bbd_init.py b/migrations/versions/052f7b817bbd_init.py index 6f54245..e4d57e4 100644 --- a/migrations/versions/052f7b817bbd_init.py +++ b/migrations/versions/052f7b817bbd_init.py @@ -1,14 +1,14 @@ """init Revision ID: 052f7b817bbd -Revises: +Revises: Create Date: 2026-04-17 22:21:43.978416 """ + import sqlalchemy as sa from alembic import op - # revision identifiers, used by Alembic. revision = '052f7b817bbd' down_revision = None diff --git a/modal_backend/__init__.py b/modal_backend/__init__.py index aed50a4..4ed3366 100644 --- a/modal_backend/__init__.py +++ b/modal_backend/__init__.py @@ -1,4 +1,3 @@ import os - __version__ = os.getenv("APP_VERSION", "dev") diff --git a/modal_backend/__main__.py b/modal_backend/__main__.py index 08e898e..7733d59 100644 --- a/modal_backend/__main__.py +++ b/modal_backend/__main__.py @@ -2,6 +2,5 @@ from modal_backend.routes.base import app - if __name__ == '__main__': uvicorn.run(app) diff --git a/modal_backend/models/__init__.py b/modal_backend/models/__init__.py index ff47f88..30da289 100644 --- a/modal_backend/models/__init__.py +++ b/modal_backend/models/__init__.py @@ -1,5 +1,4 @@ from .base import Base, BaseDbModel from .db import * - __all__ = ["Base", "BaseDbModel", "NoteType", "Group", "Service", "Note", "NoteResponse"] diff --git a/modal_backend/models/db.py b/modal_backend/models/db.py index 0c8f5d8..e3291c1 100644 --- a/modal_backend/models/db.py +++ b/modal_backend/models/db.py @@ -22,7 +22,6 @@ from .base import BaseDbModel - settings: Settings = get_settings() diff --git a/modal_backend/routes/__init__.py b/modal_backend/routes/__init__.py index 5e4fcb1..e53b88c 100644 --- a/modal_backend/routes/__init__.py +++ b/modal_backend/routes/__init__.py @@ -1,5 +1,4 @@ from . import exc_handlers from .base import app - __all__ = ["app", "exc_handlers"] diff --git a/modal_backend/routes/base.py b/modal_backend/routes/base.py index 499e89b..dc7bff6 100644 --- a/modal_backend/routes/base.py +++ b/modal_backend/routes/base.py @@ -9,7 +9,6 @@ from modal_backend.routes.services import service from modal_backend.settings import get_settings - settings = get_settings() app = FastAPI( title='Сервис пользовательских модалок', diff --git a/modal_backend/routes/groups.py b/modal_backend/routes/groups.py index 48896a5..fd0e4dd 100644 --- a/modal_backend/routes/groups.py +++ b/modal_backend/routes/groups.py @@ -8,7 +8,6 @@ from modal_backend.settings import Settings, get_settings from modal_backend.utils.services import GroupService - settings: Settings = get_settings() group = APIRouter(prefix="/group", tags=["Group"]) diff --git a/modal_backend/routes/note_type.py b/modal_backend/routes/note_type.py index a2e7bd3..cd5da62 100644 --- a/modal_backend/routes/note_type.py +++ b/modal_backend/routes/note_type.py @@ -8,7 +8,6 @@ from modal_backend.settings import Settings, get_settings from modal_backend.utils.services import NoteTypeService - settings: Settings = get_settings() notetype = APIRouter(prefix="/notificationtype", tags=["NoteType"]) diff --git a/modal_backend/routes/notes.py b/modal_backend/routes/notes.py index dcb559b..5e2ca04 100644 --- a/modal_backend/routes/notes.py +++ b/modal_backend/routes/notes.py @@ -23,7 +23,6 @@ from modal_backend.settings import Settings, get_settings from modal_backend.utils.services import NoteService - settings: Settings = get_settings() note = APIRouter(prefix="/notification", tags=["Note"]) diff --git a/modal_backend/routes/services.py b/modal_backend/routes/services.py index 7fafed0..8f3d97b 100644 --- a/modal_backend/routes/services.py +++ b/modal_backend/routes/services.py @@ -8,7 +8,6 @@ from modal_backend.settings import Settings, get_settings from modal_backend.utils.services import ServiceManager - settings: Settings = get_settings() service = APIRouter(prefix="/service", tags=["Service"]) diff --git a/pyproject.toml b/pyproject.toml index bf2a06d..746f663 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,10 +5,7 @@ skip-string-normalization = true [tool.isort] line_length = 120 -multi_line_output = 3 profile = "black" -lines_after_imports = 2 -include_trailing_comma = true [tool.pytest.ini_options] minversion = "7.0" From bea35a7460bb8e7e510023f7a1c7acb101e4fb86 Mon Sep 17 00:00:00 2001 From: Georgon Date: Sat, 11 Jul 2026 17:02:30 +0300 Subject: [PATCH 2/4] style: update Black version in checks.yml and requirements --- .github/workflows/checks.yml | 6 +++++- requirements.dev.txt | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index ad49ba9..e4e0f9b 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -68,7 +68,11 @@ jobs: - uses: isort/isort-action@master with: requirementsFiles: "requirements.txt requirements.dev.txt" - - uses: psf/black@23.11.0 + - uses: psf/black@stable + with: + version: "~=26.0" + options: "--check --diff" + src: "." - name: Comment if linting failed if: failure() uses: thollander/actions-comment-pull-request@v2 diff --git a/requirements.dev.txt b/requirements.dev.txt index afb771e..a8192a7 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -1,5 +1,5 @@ autoflake -black==23.11.0 +black~=26.0 httpx isort pytest From 96d53fe5a8396bacb252ee18b3cad33ee73337cd Mon Sep 17 00:00:00 2001 From: Georgon Date: Sat, 11 Jul 2026 20:33:07 +0300 Subject: [PATCH 3/4] No versions of black in requirements and checks.yml --- .github/workflows/checks.yml | 1 - requirements.dev.txt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e4e0f9b..07e67ff 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -70,7 +70,6 @@ jobs: requirementsFiles: "requirements.txt requirements.dev.txt" - uses: psf/black@stable with: - version: "~=26.0" options: "--check --diff" src: "." - name: Comment if linting failed diff --git a/requirements.dev.txt b/requirements.dev.txt index a8192a7..c8d847a 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -1,5 +1,5 @@ autoflake -black~=26.0 +black httpx isort pytest From 9be4601a223160e9c9b4743e7cc1db46849dce16 Mon Sep 17 00:00:00 2001 From: petrCher <88943157+petrCher@users.noreply.github.com> Date: Mon, 13 Jul 2026 15:00:31 +0300 Subject: [PATCH 4/4] small fixes --- .github/workflows/checks.yml | 3 --- pyproject.toml | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 07e67ff..38bf399 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -69,9 +69,6 @@ jobs: with: requirementsFiles: "requirements.txt requirements.dev.txt" - uses: psf/black@stable - with: - options: "--check --diff" - src: "." - name: Comment if linting failed if: failure() uses: thollander/actions-comment-pull-request@v2 diff --git a/pyproject.toml b/pyproject.toml index 746f663..7be5d91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,9 @@ skip-string-normalization = true [tool.isort] line_length = 120 +multi_line_output = 3 profile = "black" +include_trailing_comma = true [tool.pytest.ini_options] minversion = "7.0"