Skip to content

Commit

Permalink
Prepare tooling for mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
rdunklau committed Nov 5, 2021
1 parent b476914 commit 035565a
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
- id: pylint
run: make lint

- id: mypy
run: make mypy

- id: validate-style
run: |
make fmt
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ unittest: version
lint: version
$(PYTHON) -m pylint --rcfile .pylintrc $(PYTHON_SOURCE_DIRS)

.PHONY: mypy
mypy: version
$(PYTHON) -m mypy $(PYTHON_SOURCE_DIRS)

.PHONY: fmt
fmt: version
unify --quote '"' --recursive --in-place $(PYTHON_SOURCE_DIRS)
Expand Down
29 changes: 29 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[mypy]
python_version = 3.9
warn_redundant_casts = True


[mypy-azure.*]
ignore_missing_imports = True

[mypy-azure.common.*]
ignore_missing_imports = True

[mypy-dataclasses.*]
ignore_missing_imports = True

[mypy-googleapiclient.*]
ignore_missing_imports = True

[mypy-oauth2client.*]
ignore_missing_imports = True

[mypy-snappy.*]
ignore_missing_imports = True

[mypy-swiftclient.*]
ignore_missing_imports = True

[mypy-systemd.*]
ignore_missing_imports = True

9 changes: 9 additions & 0 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Use pip for build requirements to harmonize between OS versions
mock
mypy
pylint>=2.4.3,<=2.7.2
pylint-quotes
pytest
Expand All @@ -12,3 +13,11 @@ coverage
coveralls
responses
unify
types-botocore
types-httplib2
types-mock
types-paramiko
types-psycopg2
types-python-dateutil
types-requests
types-six
1 change: 1 addition & 0 deletions test/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from pghoard.rohmu.object_storage.google import MediaStreamUpload

try:
# type: ignore
from . import \
test_storage_configs # pylint: disable=no-name-in-module, import-error
except ImportError:
Expand Down

0 comments on commit 035565a

Please sign in to comment.