diff --git a/examples/demo.py b/examples/demo.py index a0c95c9..3367dd7 100644 --- a/examples/demo.py +++ b/examples/demo.py @@ -4,8 +4,6 @@ it doubles as a smoke check that ``apply_action`` still behaves as intended. """ -from __future__ import annotations - from functools import reduce from mundane.engine.actions import Action, CastInstant, IllegalAction, PassPriority, PlayCard diff --git a/src/mundane/api/app.py b/src/mundane/api/app.py index 39d285c..391a972 100644 --- a/src/mundane/api/app.py +++ b/src/mundane/api/app.py @@ -9,8 +9,6 @@ (create / get / save) makes swapping it for Redis or SQLite a localised change. """ -from __future__ import annotations - from typing import Any from uuid import uuid4 diff --git a/src/mundane/api/schemas.py b/src/mundane/api/schemas.py index 6accbbc..d5806e5 100644 --- a/src/mundane/api/schemas.py +++ b/src/mundane/api/schemas.py @@ -10,8 +10,6 @@ is pure translation. """ -from __future__ import annotations - from typing import TYPE_CHECKING from mundane.engine.actions import CastInstant, IllegalAction, PassPriority, PlayCard diff --git a/src/mundane/engine/actions.py b/src/mundane/engine/actions.py index 2c28a19..45bfd1b 100644 --- a/src/mundane/engine/actions.py +++ b/src/mundane/engine/actions.py @@ -6,8 +6,6 @@ from it so the wire format can never drift from the engine. """ -from __future__ import annotations - from dataclasses import dataclass @@ -39,7 +37,7 @@ class PassPriority: """The closed set of moves a player may submit.""" -ACTION_TYPES: dict[str, type[PlayCard | CastInstant | PassPriority]] = { +ACTION_TYPES: dict[str, type[Action]] = { "play_card": PlayCard, "cast_instant": CastInstant, "pass_priority": PassPriority, diff --git a/src/mundane/engine/cards.py b/src/mundane/engine/cards.py index 33b4526..41510fa 100644 --- a/src/mundane/engine/cards.py +++ b/src/mundane/engine/cards.py @@ -4,8 +4,6 @@ through :data:`CARD_LIBRARY` is how the engine recovers a card's type, cost, and effect. """ -from __future__ import annotations - from .state import Card, CardType, GameState, StackItem diff --git a/src/mundane/engine/game.py b/src/mundane/engine/game.py index 61e5d7b..f157ce7 100644 --- a/src/mundane/engine/game.py +++ b/src/mundane/engine/game.py @@ -6,8 +6,6 @@ is never logged. """ -from __future__ import annotations - from dataclasses import dataclass, field from typing import TYPE_CHECKING diff --git a/src/mundane/engine/rules.py b/src/mundane/engine/rules.py index 9f7a126..bf11f26 100644 --- a/src/mundane/engine/rules.py +++ b/src/mundane/engine/rules.py @@ -6,8 +6,6 @@ ``final = reduce(apply_action, actions, initial)``. """ -from __future__ import annotations - from .actions import Action, CastInstant, IllegalAction, PassPriority, PlayCard from .cards import CARD_LIBRARY from .state import PERMANENTS, PHASES, CardType, GameState, StackItem diff --git a/src/mundane/engine/serialize.py b/src/mundane/engine/serialize.py index 700d932..1f42563 100644 --- a/src/mundane/engine/serialize.py +++ b/src/mundane/engine/serialize.py @@ -6,8 +6,6 @@ hand-written decoder. """ -from __future__ import annotations - import dataclasses import json from enum import Enum diff --git a/src/mundane/engine/state.py b/src/mundane/engine/state.py index 29b65ae..f350f74 100644 --- a/src/mundane/engine/state.py +++ b/src/mundane/engine/state.py @@ -7,14 +7,12 @@ :class:`GameState` round-trip through JSON. """ -from __future__ import annotations - from collections.abc import Callable from dataclasses import dataclass, field -from enum import Enum +from enum import StrEnum -class CardType(Enum): +class CardType(StrEnum): """The five kinds of card. The first three are permanents (they stay on the board).""" PERSON = "person" # creature-like; stays on the board once it resolves diff --git a/tests/test_api.py b/tests/test_api.py index dedb0a2..9bae231 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,7 +1,5 @@ """API tests: drive the Litestar app over HTTP and confirm it is a thin shell over the engine.""" -from __future__ import annotations - from typing import TYPE_CHECKING import pytest diff --git a/tests/test_replay.py b/tests/test_replay.py index 3e5b51d..9f4730f 100644 --- a/tests/test_replay.py +++ b/tests/test_replay.py @@ -1,7 +1,5 @@ """Replay tests: a game's state is a pure fold of its action log (the event-sourcing property).""" -from __future__ import annotations - from functools import reduce import pytest diff --git a/tests/test_rules.py b/tests/test_rules.py index 6f46722..c07d229 100644 --- a/tests/test_rules.py +++ b/tests/test_rules.py @@ -1,7 +1,5 @@ """Engine rules tests: the legality preconditions mirrored one-for-one, plus the countered party.""" -from __future__ import annotations - import dataclasses import json from copy import deepcopy