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 5ad3fb538d - Show all commits

Type the relationships of ReplaySimulation

Alexander Hess 2026-12-01 11:18:30 +01:00
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -3,6 +3,7 @@
import sqlalchemy as sa
from sqlalchemy import orm
from velofy import db
from velofy.db import meta
@ -50,8 +51,14 @@ class ReplaySimulation(meta.Base):
)
# Relationships
city = orm.relationship("City", back_populates="replays")
orders = orm.relationship("ReplayedOrder", back_populates="simulation")
city: orm.Mapped[db.City] = orm.relationship(
"City",
back_populates="replays",
)
orders: orm.Mapped[list["db.ReplayedOrder"]] = orm.relationship(
"ReplayedOrder",
back_populates="simulation",
)
def __repr__(self) -> str:
"""Non-literal text representation."""