From ffa0c58736a401f2cfa8e10ef31737396c0b6121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sp=C3=B6ttel?= <1682504+fspoettel@users.noreply.github.com> Date: Wed, 1 Mar 2023 18:28:22 +0100 Subject: [PATCH] chore(deps): update dependency sqlalchemy to v2.0.4 --- .gitignore | 2 ++ app/shared/db/alembic/env.py | 2 +- app/shared/db/models.py | 3 +-- app/tests/test_api.py | 2 +- mypy.ini | 2 +- pyproject.toml | 3 +-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 3d320bf..5fa62ee 100644 --- a/.gitignore +++ b/.gitignore @@ -164,3 +164,5 @@ cython_debug/ .DS_Store whisperbox-transcribe.sqlite* +*shm +*wal diff --git a/app/shared/db/alembic/env.py b/app/shared/db/alembic/env.py index 6d9ed9f..53ffd1f 100644 --- a/app/shared/db/alembic/env.py +++ b/app/shared/db/alembic/env.py @@ -62,7 +62,7 @@ def run_migrations_online() -> None: """ connectable = engine_from_config( - config.get_section(config.config_ini_section), + config.get_section(config.config_ini_section), # type: ignore prefix="sqlalchemy.", poolclass=pool.NullPool, ) diff --git a/app/shared/db/models.py b/app/shared/db/models.py index c25fa93..793b3f0 100644 --- a/app/shared/db/models.py +++ b/app/shared/db/models.py @@ -3,8 +3,7 @@ from typing import Optional from sqlalchemy import JSON, VARCHAR, Column, DateTime, Enum, ForeignKey, String, func from sqlalchemy.dialects.postgresql import UUID -from sqlalchemy.ext.declarative import declarative_base, declared_attr -from sqlalchemy.orm import Mapped, declarative_mixin # type: ignore +from sqlalchemy.orm import Mapped, declarative_base, declarative_mixin, declared_attr from .schemas import ArtifactType, JobStatus, JobType diff --git a/app/tests/test_api.py b/app/tests/test_api.py index 2d2754d..d0f3e3f 100644 --- a/app/tests/test_api.py +++ b/app/tests/test_api.py @@ -87,7 +87,7 @@ def test_get_artifacts_pass( auth_headers: Dict[str, str], db_session: Session, mock_job: models.Job ) -> None: artifact = models.Artifact( - data=[], job_id=mock_job.id, type=schemas.ArtifactType.raw_transcript + data=[], job_id=str(mock_job.id), type=schemas.ArtifactType.raw_transcript ) db_session.add(artifact) diff --git a/mypy.ini b/mypy.ini index 1c26ad6..a3136a3 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,4 +1,4 @@ [mypy] -plugins = sqlmypy +plugins = sqlalchemy.ext.mypy.plugin ignore_missing_imports = True disallow_untyped_defs = True diff --git a/pyproject.toml b/pyproject.toml index 9332f18..8651944 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ version = "0.1.0" dependencies=[ "celery[redis] ==5.2.7", - "sqlalchemy[mypy] ==1.4.46", + "sqlalchemy[mypy] ==2.0.4", "pydantic ==1.10.5" ] @@ -36,7 +36,6 @@ tooling = [ "pytest ==7.2.1", # types "mypy ==1.0.1", - "sqlalchemy-stubs ==0.4", "types-requests ==2.28.11.15" ]