From beee84dfb1a89298966bab6f89dbe9feb57c43ab Mon Sep 17 00:00:00 2001 From: Lachlan Jones <13636221+LachJones@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:41:05 +1100 Subject: [PATCH] Add type checking to standard tests --- .github/workflows/ci.yml | 4 ++++ CONTRIBUTING.md | 3 ++- requirements-dev.txt | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97efa07..d9f84f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,10 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install . + - name: Type Checking + run: | + python -m pip install mypy + python -m mypy iso639 - name: Test run: | pip install pytest diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 86a9dbe..fe91e92 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,9 +64,10 @@ Pushing changes to your forked repository should trigger a [workflow](https://gi flake8 black --check . isort --check-only . +mypy iso639 ``` -`iso639-lang` uses `flake8` for linting, `black` for formatting and `isort` for sorting imports. The configuration of these tools is available in the `.flake8` and `pyproject.toml` files. +`iso639-lang` uses `flake8` for linting, `black` for formatting, `isort` for sorting imports and `mypy` for type checking. The configuration of these tools is available in the `.flake8` and `pyproject.toml` files. ## Submitting Changes diff --git a/requirements-dev.txt b/requirements-dev.txt index f338895..99c1039 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,4 +5,5 @@ isort>=5.13.2 lxml>=5.3.0 pandas>=2.0.3 requests>=2.32.3 -pytest>=8.3.2 \ No newline at end of file +pytest>=8.3.2 +mypy>=1.13.0 \ No newline at end of file