Add github action to run mypy

This commit is contained in:
Alessio Bogon 2022-02-24 16:52:23 +01:00
parent 644df2ee52
commit 32bb62f3e6
4 changed files with 18 additions and 2 deletions

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
@ -24,6 +24,10 @@ jobs:
python -m pip install --upgrade pip
pip install -U setuptools
pip install tox tox-gh-actions codecov
- name: Type checking
continue-on-error: true
run: |
tox -e mypy
- name: Test with tox
run: |
tox

View File

@ -23,3 +23,9 @@ repos:
hooks:
- id: pyupgrade
args: ["--py37-plus"]
# TODO: Enable mypy checker when the checks succeed
#- repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.931
# hooks:
# - id: mypy
# additional_dependencies: [types-setuptools]

View File

@ -12,7 +12,7 @@ line_length = 120
multi_line_output = 3
[tool.mypy]
python_version = "3.6"
python_version = "3.7"
warn_return_any = true
warn_unused_configs = true
files = "pytest_bdd/**/*.py"

View File

@ -34,6 +34,12 @@ commands = {env:_PYTEST_CMD:pytest} {env:_PYTEST_MORE_ARGS:} {posargs:-vvl}
deps = black==22.1.0
commands = black --check --verbose setup.py docs pytest_bdd tests
[testenv:mypy]
deps =
mypy==0.931
types-setuptools
commands = mypy
[gh-actions]
python =
3.7: py37