Skip to content

Commit

Permalink
Update to Mypy 0.910 (#5890)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Jul 18, 2021
1 parent e3dcc71 commit ae23fd6
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[mypy]
files = aiohttp, examples, tests
check_untyped_defs = True
exclude = examples/legacy/
follow_imports_for_stubs = True
#disallow_any_decorated = True
disallow_any_generics = True
Expand Down
1 change: 1 addition & 0 deletions CHANGES/5890.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update to Mypy 0.910.
4 changes: 3 additions & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ multidict==5.1.0
# via
# -r requirements/multidict.txt
# yarl
mypy==0.790 ; implementation_name == "cpython"
mypy==0.910 ; implementation_name == "cpython"
# via
# -r requirements/lint.txt
# -r requirements/test.txt
Expand Down Expand Up @@ -265,6 +265,8 @@ typed-ast==1.4.2
# via
# -r requirements/lint.txt
# mypy
types-chardet==0.1.3
# via -r requirements/lint.txt
typing-extensions==3.7.4.3
# via
# -r requirements/base.txt
Expand Down
3 changes: 2 additions & 1 deletion requirements/lint.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ black==21.6b0; implementation_name=="cpython"
flake8==3.9.2
flake8-pyi==20.10.0
isort==5.9.2
mypy==0.790; implementation_name=="cpython"
mypy==0.910; implementation_name=="cpython"
pre-commit==2.13.0
pytest==6.2.2
types-chardet==0.1.3
4 changes: 3 additions & 1 deletion requirements/lint.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ isort==5.9.2
# via -r requirements/lint.in
mccabe==0.6.1
# via flake8
mypy==0.790 ; implementation_name == "cpython"
mypy==0.910 ; implementation_name == "cpython"
# via -r requirements/lint.in
mypy-extensions==0.4.3
# via
Expand Down Expand Up @@ -77,6 +77,8 @@ toml==0.10.2
# pytest
typed-ast==1.4.2
# via mypy
types-chardet==0.1.3
# via -r requirements/lint.txt
typing-extensions==3.7.4.3
# via mypy
virtualenv==20.4.2
Expand Down
3 changes: 2 additions & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ Brotli==1.0.9
coverage==5.5
cryptography==3.3.1; platform_machine!="i686" and python_version<"3.9" # no 32-bit wheels; no python 3.9 wheels yet
freezegun==1.1.0
mypy==0.790; implementation_name=="cpython"
mypy==0.910; implementation_name=="cpython"
mypy-extensions==0.4.3; implementation_name=="cpython"
pytest==6.2.2
pytest-cov==2.12.1
pytest-mock==3.6.1
re-assert==1.1.0
setuptools-git==1.2
trustme==0.8.0; platform_machine!="i686" # no 32-bit wheels
types-chardet==0.1.3
4 changes: 2 additions & 2 deletions tests/autobahn/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import aiohttp


async def client(url, name):
async def client(url: str, name: str) -> None:
async with aiohttp.ClientSession() as session:
async with session.ws_connect(url + "/getCaseCount") as ws:
num_tests = int((await ws.receive()).data)
Expand All @@ -28,7 +28,7 @@ async def client(url, name):
print("finally requesting %s" % url)


async def run(url, name):
async def run(url: str, name: str) -> None:
try:
await client(url, name)
except Exception:
Expand Down
6 changes: 3 additions & 3 deletions tests/autobahn/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from aiohttp import WSCloseCode, web


async def wshandler(request):
async def wshandler(request: web.Request) -> web.WebSocketResponse:
ws = web.WebSocketResponse(autoclose=False)
is_ws = ws.can_prepare(request)
if not is_ws:
return web.HTTPBadRequest()
raise web.HTTPBadRequest()

await ws.prepare(request)

Expand All @@ -29,7 +29,7 @@ async def wshandler(request):
return ws


async def on_shutdown(app):
async def on_shutdown(app: web.Application) -> None:
for ws in set(app["websockets"]):
await ws.close(code=WSCloseCode.GOING_AWAY, message="Server shutdown")

Expand Down

0 comments on commit ae23fd6

Please sign in to comment.