Skip to content

Commit

Permalink
Bump mypy from 0.931 to 0.981 (#6976)
Browse files Browse the repository at this point in the history
Bumps [mypy](https://github.com/python/mypy) from 0.931 to 0.981.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/python/mypy/commit/c7b4714e1f5e3cb8f3fec7426b6538fe1a3dcab1"><code>c7b4714</code></a>
Update version to 0.981</li>
<li><a
href="https://github.com/python/mypy/commit/2bd7da21462a59643f2aec546304db1a624ba285"><code>2bd7da2</code></a>
[0.980 backport] build changes (<a
href="https://github-redirect.dependabot.com/python/mypy/issues/13688">#13688</a>)</li>
<li><a
href="https://github.com/python/mypy/commit/2b2953a1392368f623331d5168ccdfd39e37bbee"><code>2b2953a</code></a>
[0.980 backport] Update pos-only unit tests for Python 3.10.7 (<a
href="https://github-redirect.dependabot.com/python/mypy/issues/13660">#13660</a>)
(<a
href="https://github-redirect.dependabot.com/python/mypy/issues/13665">#13665</a>)</li>
<li><a
href="https://github.com/python/mypy/commit/ada007841f6a96f68d114769624a0f7b523814a7"><code>ada0078</code></a>
Remove dev from version</li>
<li><a
href="https://github.com/python/mypy/commit/efd1d38fb1db188e56fe6068ebe69d2164462b34"><code>efd1d38</code></a>
[0.980 backport] Fix stubtest custom_typeshed_dir regression (<a
href="https://github-redirect.dependabot.com/python/mypy/issues/13656">#13656</a>)
(<a
href="https://github-redirect.dependabot.com/python/mypy/issues/13658">#13658</a>)</li>
<li><a
href="https://github.com/python/mypy/commit/70bc34837ecbafc528e511a46219262736781d43"><code>70bc348</code></a>
[0.980 backport] Allow unpacking from TypeVars with iterable bounds (<a
href="https://github-redirect.dependabot.com/python/mypy/issues/13425">#13425</a>)
...</li>
<li><a
href="https://github.com/python/mypy/commit/e43dbb91be8eb167875bb8a9468cf7d286cf0c3e"><code>e43dbb9</code></a>
Work around mypyc test failures in CI (<a
href="https://github-redirect.dependabot.com/python/mypy/issues/13593">#13593</a>)</li>
<li><a
href="https://github.com/python/mypy/commit/64add912d9b58340b055df58c8c0e16ba2e8e667"><code>64add91</code></a>
Another cherry-pick fix</li>
<li><a
href="https://github.com/python/mypy/commit/228bd29babd95373867e845b049f0938fe083f44"><code>228bd29</code></a>
Fix error codes option serialization (<a
href="https://github-redirect.dependabot.com/python/mypy/issues/13523">#13523</a>)</li>
<li><a
href="https://github.com/python/mypy/commit/1f8061167faac10c02eafba260f6ab8543496f90"><code>1f80611</code></a>
Allow per-module error codes (<a
href="https://github-redirect.dependabot.com/python/mypy/issues/13502">#13502</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/python/mypy/compare/v0.931...v0.981">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mypy&package-manager=pip&previous-version=0.931&new-version=0.981)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sam Bull <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2022
1 parent 0af182a commit d7ebbeb
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Python 3.8
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9
- name: Cache PyPI
uses: actions/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ async def _create_connection(
raise
raise UnixClientConnectorError(self.path, req.connection_key, exc) from exc

return cast(ResponseHandler, proto)
return proto


class NamedPipeConnector(BaseConnector):
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def __await__(self) -> Generator[None, None, None]:
iscoroutinefunction = asyncio.iscoroutinefunction
else:

def iscoroutinefunction(func: Any) -> bool:
def iscoroutinefunction(func: Any) -> bool: # type: ignore[misc]
while isinstance(func, functools.partial):
func = func.func
return asyncio.iscoroutinefunction(func)
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/web_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ async def start(self) -> None:
assert server is not None
self._server = await loop.create_unix_server(
server,
self._path, # type: ignore[arg-type]
self._path,
ssl=self._ssl_context,
backlog=self._backlog,
)
Expand Down
41 changes: 18 additions & 23 deletions examples/client_ws.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
#!/usr/bin/env python3
"""websocket cmd client for wssrv.py example."""
"""websocket cmd client for web_ws.py example."""

import argparse
import asyncio
import signal
import sys
from contextlib import suppress

import aiohttp


async def start_client(loop: asyncio.AbstractEventLoop, url: str) -> None:
async def start_client(url: str) -> None:
name = input("Please enter your name: ")

# input reader
def stdin_callback() -> None:
line = sys.stdin.buffer.readline().decode("utf-8")
if not line:
loop.stop()
else:
ws.send_str(name + ": " + line)

loop.add_reader(sys.stdin.fileno(), stdin_callback)

async def dispatch() -> None:
async def dispatch(ws: aiohttp.ClientWebSocketResponse) -> None:
while True:
msg = await ws.receive()

Expand All @@ -43,10 +34,18 @@ async def dispatch() -> None:

break

# send request
async with aiohttp.ClientSession() as client:
async with client.ws_connect(url, autoclose=False, autoping=False) as ws:
await dispatch()
async with aiohttp.ClientSession() as session:
async with session.ws_connect(url, autoclose=False, autoping=False) as ws:
# send request
dispatch_task = asyncio.create_task(dispatch(ws))

# Exit with Ctrl+D
while line := await asyncio.to_thread(sys.stdin.readline):
await ws.send_str(name + ": " + line)

dispatch_task.cancel()
with suppress(asyncio.CancelledError):
await dispatch_task


ARGS = argparse.ArgumentParser(
Expand All @@ -67,8 +66,4 @@ async def dispatch() -> None:

url = f"http://{args.host}:{args.port}"

loop = asyncio.get_event_loop()

loop.add_signal_handler(signal.SIGINT, loop.stop)
loop.create_task(start_client(loop, url))
loop.run_forever()
asyncio.run(start_client(url))
2 changes: 1 addition & 1 deletion examples/curl.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async def curl(url: str) -> None:
from asyncio import events, windows_events

# https://github.com/python/mypy/issues/12286
el = windows_events.ProactorEventLoop()
el = windows_events.ProactorEventLoop() # type: ignore[attr-defined]
events.set_event_loop(el)

loop = asyncio.get_event_loop()
Expand Down
2 changes: 1 addition & 1 deletion examples/fake_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async def resolve(
return await self._resolver.resolve(host, port, family)

async def close(self) -> None:
self._resolver.close()
await self._resolver.close()


class FakeFacebook:
Expand Down
2 changes: 1 addition & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ multidict==5.2.0
# via
# -r requirements/multidict.txt
# yarl
mypy==0.931 ; implementation_name == "cpython"
mypy==0.981 ; implementation_name == "cpython"
# via
# -r requirements/lint.txt
# -r requirements/test.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/lint.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-r typing-extensions.txt
aioredis==2.0.1
mypy==0.931; implementation_name=="cpython"
mypy==0.981; implementation_name=="cpython"
pre-commit==2.17.0
pytest==7.1.3
slotscheck==0.8.0
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Brotli==1.0.9
coverage==6.4.2
cryptography==36.0.1; platform_machine!="i686" # no 32-bit wheels; no python 3.9 wheels yet
freezegun==1.1.0
mypy==0.931; implementation_name=="cpython"
mypy==0.981; implementation_name=="cpython"
mypy-extensions==0.4.3; implementation_name=="cpython"
proxy.py ~= 2.4.4rc3
pytest==7.1.3
Expand Down
4 changes: 2 additions & 2 deletions tests/test_base_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def test_resume_drain_waited() -> None:

assert pr._drain_waiter is not None
pr.resume_writing()
assert (await t) is None
await t
assert pr._drain_waiter is None


Expand All @@ -111,7 +111,7 @@ async def test_lost_drain_waited_ok() -> None:

assert pr._drain_waiter is not None
pr.connection_lost(None)
assert (await t) is None
await t
assert pr._drain_waiter is None


Expand Down
8 changes: 4 additions & 4 deletions tests/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ async def test_async_resolver_multiple_replies(loop: Any) -> None:
mock().gethostbyname.return_value = fake_result(ips)
resolver = AsyncResolver()
real = await resolver.resolve("www.google.com")
ips = [ipaddress.ip_address(x["host"]) for x in real]
assert len(ips) > 3, "Expecting multiple addresses"
ipaddrs = [ipaddress.ip_address(x["host"]) for x in real]
assert len(ipaddrs) > 3, "Expecting multiple addresses"


@pytest.mark.skipif(not gethostbyname, reason="aiodns 1.1 required")
Expand Down Expand Up @@ -105,8 +105,8 @@ async def test_threaded_resolver_multiple_replies() -> None:
resolver = ThreadedResolver()
resolver._loop = loop
real = await resolver.resolve("www.google.com")
ips = [ipaddress.ip_address(x["host"]) for x in real]
assert len(ips) > 3, "Expecting multiple addresses"
ipaddrs = [ipaddress.ip_address(x["host"]) for x in real]
assert len(ipaddrs) > 3, "Expecting multiple addresses"


async def test_threaded_negative_lookup() -> None:
Expand Down

0 comments on commit d7ebbeb

Please sign in to comment.