Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
Enable mypy in CI (#1101)
Browse files Browse the repository at this point in the history
* Enable mypy in CI
* Add change file.

* Lint

* Show diff in CI.

* Black

* Readd "unreachable" code.

* Fix typing for ConnectionError.

* Black

* Add client.py

* Fixes

* Black

* Imports

* Simplify cmds.

* Simplify cmds further.

* Give up

* Fix

* Rename to _Sentinel.

* Move self.encoder check.

* More precise type for auth_args.
  • Loading branch information
Dreamsorcerer committed Oct 31, 2021
1 parent 98ed30e commit 2f217e1
Show file tree
Hide file tree
Showing 9 changed files with 317 additions and 193 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -39,6 +39,10 @@ jobs:
uses: py-actions/py-dependency-install@v2.1.0
with:
path: tests/requirements.txt
- name: Run mypy
run: |
pip install -r tests/requirements-mypy.txt
mypy
- name: Run linter
run: |
make lint
Expand Down
26 changes: 26 additions & 0 deletions .mypy.ini
@@ -0,0 +1,26 @@
[mypy]
#, docs/examples, tests
files = aioredis
check_untyped_defs = True
follow_imports_for_stubs = True
#disallow_any_decorated = True
#disallow_any_generics = True
#disallow_incomplete_defs = True
disallow_subclassing_any = True
#disallow_untyped_calls = True
disallow_untyped_decorators = True
#disallow_untyped_defs = True
implicit_reexport = False
no_implicit_optional = True
show_error_codes = True
strict_equality = True
warn_incomplete_stub = True
warn_redundant_casts = True
warn_unreachable = True
warn_unused_ignores = True
disallow_any_unimported = True
#warn_return_any = True

[mypy-aioredis.lock]
# TODO: Remove once locks has been rewritten
ignore_errors = True
1 change: 1 addition & 0 deletions CHANGES/1101.misc
@@ -0,0 +1 @@
Enable Mypy in CI.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -17,7 +17,7 @@ spelling:
$(MAKE) -C docs spelling

mypy:
$(MYPY) aioredis --ignore-missing-imports
$(MYPY)

test:
$(PYTEST)
Expand All @@ -38,7 +38,7 @@ init-hooks:
pre-commit install-hooks

lint: init-hooks
pre-commit run --all-files
pre-commit run --all-files --show-diff-on-failure

devel: aioredis.egg-info init-hooks
pip install -U pip
Expand Down

0 comments on commit 2f217e1

Please sign in to comment.