Skip to content

Commit

Permalink
Check type hints with mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-k authored and markpeek committed Mar 27, 2021
1 parent 40ffe43 commit 345c47b
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ jobs:
PYVERSION=$(python -c "import sys; print(''.join([str(sys.version_info.major), str(sys.version_info.minor)]))")
python -m tox -f $(python -m tox --listenvs | grep "^py${PYVERSION}" | tr '\n' ',')
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Run mypy
run: python -m tox -e mypy

lint:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.py[cod]
.mypy_cache

# C extensions
*.so
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ recursive-include examples *.py
recursive-include tests *.py

exclude Makefile
exclude mypy.ini
recursive-exclude scrape *
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ test:
python -m tox -e package
python -m tox --listenvs | grep "^py${PYVERSION}" | tr "\n" "," | xargs python -m tox -e
black --check ${PYDIRS}
mypy awacs
11 changes: 11 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[mypy]
check_untyped_defs = True
disallow_untyped_calls = True
disallow_untyped_defs = True
follow_imports = silent
ignore_missing_imports = True
python_version = 3.6
strict_optional = True
warn_redundant_casts = True
warn_unused_ignores = True
show_error_codes = True
6 changes: 6 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ envlist =
[testenv]
commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning setup.py test {posargs}

[testenv:mypy]
deps =
mypy
commands =
mypy awacs

[testenv:qa]
deps =
pycodestyle
Expand Down

0 comments on commit 345c47b

Please sign in to comment.