diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3831ed35..55b740b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,3 +24,18 @@ jobs: pip install codecov codecov fi + typing: + name: Typing Check + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: pip install -r requirements-typing.txt + - name: Run mypy + run: mypy metar diff --git a/metar/Metar.pyi b/metar/Metar.pyi index b6c388fe..24e763bb 100644 --- a/metar/Metar.pyi +++ b/metar/Metar.pyi @@ -16,6 +16,8 @@ def _sanitize(code: str) -> str: ... def _report_match(handler: Callable[[dict], None], match: Match) -> None: ... def _unparsedGroup(self: "Metar", d: dict) -> None: ... +class ParserError(Exception): ... + class Metar: code: str type: Literal["METAR", "SPECI"] diff --git a/requirements-typing.txt b/requirements-typing.txt new file mode 100644 index 00000000..a45e2c90 --- /dev/null +++ b/requirements-typing.txt @@ -0,0 +1 @@ +mypy==1.3.0