diff --git a/Makefile b/Makefile index 892f499..0defe02 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ safety: ## Check for insecure dependencies .PHONY: py-upgrade py-upgrade: ## Upgrade Python syntax to a newer version - pyupgrade --py313-plus `find app -name "*.py"` + pyupgrade --py314-plus `find app -name "*.py"` .PHONY: lint lint: ## Lint and format project code diff --git a/app/models/shakespeare.py b/app/models/shakespeare.py index fc542bd..ff4d90d 100644 --- a/app/models/shakespeare.py +++ b/app/models/shakespeare.py @@ -46,10 +46,10 @@ class Character(Base): abbrev: Mapped[str | None] = mapped_column(String(32)) description: Mapped[str | None] = mapped_column(String(2056)) - work: Mapped[list["Work"]] = relationship( + work: Mapped[list[Work]] = relationship( "Work", secondary="shakespeare.character_work", back_populates="character" ) - paragraph: Mapped[list["Paragraph"]] = relationship( + paragraph: Mapped[list[Paragraph]] = relationship( "Paragraph", back_populates="character" ) @@ -122,11 +122,11 @@ class Work(Base): total_paragraphs: Mapped[int] = mapped_column(Integer) notes: Mapped[str | None] = mapped_column(Text) - character: Mapped[list["Character"]] = relationship( + character: Mapped[list[Character]] = relationship( "Character", secondary="shakespeare.character_work", back_populates="work" ) - chapter: Mapped[list["Chapter"]] = relationship("Chapter", back_populates="work") - paragraph: Mapped[list["Paragraph"]] = relationship( + chapter: Mapped[list[Chapter]] = relationship("Chapter", back_populates="work") + paragraph: Mapped[list[Paragraph]] = relationship( "Paragraph", back_populates="work" ) @@ -170,8 +170,8 @@ class Chapter(Base): chapter_number: Mapped[int] = mapped_column(Integer) description: Mapped[str] = mapped_column(String(256)) - work: Mapped["Work"] = relationship("Work", back_populates="chapter") - paragraph: Mapped[list["Paragraph"]] = relationship( + work: Mapped[Work] = relationship("Work", back_populates="chapter") + paragraph: Mapped[list[Paragraph]] = relationship( "Paragraph", back_populates="chapter" ) @@ -259,11 +259,11 @@ class Paragraph(Base): char_count: Mapped[int] = mapped_column(Integer) word_count: Mapped[int] = mapped_column(Integer) - character: Mapped["Character"] = relationship( + character: Mapped[Character] = relationship( "Character", back_populates="paragraph" ) - chapter: Mapped["Chapter"] = relationship("Chapter", back_populates="paragraph") - work: Mapped["Work"] = relationship("Work", back_populates="paragraph") + chapter: Mapped[Chapter] = relationship("Chapter", back_populates="paragraph") + work: Mapped[Work] = relationship("Work", back_populates="paragraph") @classmethod async def find(cls, db_session: AsyncSession, character: str): diff --git a/app/models/stuff.py b/app/models/stuff.py index d4d5e1d..0954863 100644 --- a/app/models/stuff.py +++ b/app/models/stuff.py @@ -29,7 +29,7 @@ class Stuff(Base): name: Mapped[str] = mapped_column(String, primary_key=True, unique=True) description: Mapped[str | None] - nonsense: Mapped["Nonsense"] = relationship( + nonsense: Mapped[Nonsense] = relationship( "Nonsense", secondary="happy_hog.stuff_full_of_nonsense" ) @@ -47,7 +47,7 @@ class StuffFullOfNonsense(Base): UUID(as_uuid=True), default=uuid.uuid4, primary_key=True ) stuff_id: Mapped[Stuff] = mapped_column(UUID, ForeignKey("happy_hog.stuff.id")) - nonsense_id: Mapped["Nonsense"] = mapped_column( + nonsense_id: Mapped[Nonsense] = mapped_column( UUID, ForeignKey("happy_hog.nonsense.id") ) but_why: Mapped[str | None] diff --git a/app/schemas/shakespeare.py b/app/schemas/shakespeare.py index 97e7ec1..5628992 100644 --- a/app/schemas/shakespeare.py +++ b/app/schemas/shakespeare.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from typing import Any from pydantic import BaseModel