diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 61926ae..ccc3630 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,3 +10,10 @@ repos: - id: ruff args: [--fix] - id: ruff-format + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.10.0 + hooks: + - id: mypy + args: [--disable-error-code=import-untyped] + additional_dependencies: + [anyio, attrs, httpx, loguru, python-dateutil, tenacity] diff --git a/main.py b/main.py index 82eeea4..78a2a85 100644 --- a/main.py +++ b/main.py @@ -6,7 +6,7 @@ from asyncio import CancelledError from collections.abc import Callable, Iterable, Sequence from itertools import product -from typing import Literal, Self +from typing import Literal, Self, TypeAlias import httpx from anyio import create_task_group, run, sleep @@ -28,7 +28,8 @@ from flights import Availability from utils import beep, httpx_client, pretty_printer -type DiffLine = tuple[Literal[" ", "+", "-"], Availability] +# TODO(https://github.com/python/mypy/issues/15238): Switch back to PEP 695 type alias when supported by mypy +DiffLine: TypeAlias = tuple[Literal[" ", "+", "-"], Availability] @frozen