diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 172d8c7..818a05a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -37,3 +37,19 @@ jobs: cache-dependency-path: requirements*/*.txt - run: pip install tox - run: tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }} + typing: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + with: + python-version: '3.x' + cache: pip + cache-dependency-path: requirements*/*.txt + - name: cache mypy + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + with: + path: ./.mypy_cache + key: mypy|${{ hashFiles('pyproject.toml') }} + - run: pip install tox + - run: tox run -e typing \ No newline at end of file diff --git a/requirements/typing.in b/requirements/typing.in index f7d9470..278e04d 100644 --- a/requirements/typing.in +++ b/requirements/typing.in @@ -1,2 +1,3 @@ pyright pytest +mypy \ No newline at end of file diff --git a/requirements/typing.txt b/requirements/typing.txt index a1e763c..a8e3af3 100644 --- a/requirements/typing.txt +++ b/requirements/typing.txt @@ -1,11 +1,15 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile typing.in +# pip-compile --output-file=requirements/typing.txt requirements/typing.in # iniconfig==2.0.0 # via pytest +mypy==1.13.0 + # via -r requirements/typing.in +mypy-extensions==1.0.0 + # via mypy nodeenv==1.8.0 # via pyright packaging==24.0 @@ -13,11 +17,13 @@ packaging==24.0 pluggy==1.5.0 # via pytest pyright==1.1.387 - # via -r typing.in + # via -r requirements/typing.in pytest==8.3.3 - # via -r typing.in + # via -r requirements/typing.in typing-extensions==4.12.2 - # via pyright + # via + # mypy + # pyright # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/tox.ini b/tox.ini index 01606ec..837b9fb 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ envlist = py3{12,11,10,9,8} minimal + typing style docs skip_missing_interpreters = true @@ -23,6 +24,12 @@ deps = pre-commit skip_install = true commands = pre-commit run --all-files +[testenv:typing] +deps = -r requirements/typing.txt +commands = + mypy src + pyright src + [testenv:docs] deps = -r requirements/docs.txt commands = sphinx-build -E -W -b dirhtml docs docs/_build/dirhtml