Make mypy as strict as practical #13

Merged
alexander merged 32 commits from stricter-mypy into develop 2026-12-01 14:26:52 +01:00
Showing only changes of commit 90c0597193 - Show all commits

Type the relationships of Forecast

Also, move the `db` import to the top
Alexander Hess 2026-12-01 11:13:40 +01:00
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -8,6 +8,7 @@ import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy.dialects import postgresql as psql
from velofy import db
from velofy.db import meta
@ -174,7 +175,10 @@ class Forecast(meta.Base):
)
# Relationships
pixel = orm.relationship("Pixel", back_populates="forecasts")
pixel: orm.Mapped["db.Pixel"] = orm.relationship(
"Pixel",
back_populates="forecasts",
)
def __repr__(self) -> str:
"""Non-literal text representation."""
@ -255,6 +259,3 @@ class Forecast(meta.Base):
)
return forecasts
from velofy import db # noqa:E402 isort:skip