Skip to content

Commit 06eedff

Browse files
dependabot[bot]Dreamsorcererpre-commit-ci[bot]
authored
Bump mypy from 1.10.1 to 1.11.1 (#8561)
Bumps [mypy](https://github.com/python/mypy) from 1.10.1 to 1.11.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/python/mypy/blob/master/CHANGELOG.md">mypy's changelog</a>.</em></p> <blockquote> <h1>Mypy Release Notes</h1> <h2>Next release</h2> <h2>Mypy 1.11</h2> <p>We’ve just uploaded mypy 1.11 to the Python Package Index (<a href="https://pypi.org/project/mypy/">PyPI</a>). Mypy is a static type checker for Python. This release includes new features, performance improvements and bug fixes. You can install it as follows:</p> <pre><code>python3 -m pip install -U mypy </code></pre> <p>You can read the full documentation for this release on <a href="http://mypy.readthedocs.io">Read the Docs</a>.</p> <h4>Support Python 3.12 Syntax for Generics (PEP 695)</h4> <p>Mypy now supports the new type parameter syntax introduced in Python 3.12 (<a href="https://peps.python.org/pep-0695/">PEP 695</a>). This feature is still experimental and must be enabled with the <code>--enable-incomplete-feature=NewGenericSyntax</code> flag, or with <code>enable_incomplete_feature = NewGenericSyntax</code> in the mypy configuration file. We plan to enable this by default in the next mypy feature release.</p> <p>This example demonstrates the new syntax:</p> <pre lang="python"><code># Generic function def f[T](https://github.com/python/mypy/blob/master/x: T) -&gt; T: ... <p>reveal_type(f(1)) # Revealed type is 'int'</p> <h1>Generic class</h1> <p>class C[T]: def <strong>init</strong>(self, x: T) -&gt; None: self.x = x</p> <p>c = C('a') reveal_type(c.x) # Revealed type is 'str'</p> <h1>Type alias</h1> <p>type A[T] = C[list[T]] </code></pre></p> <p>This feature was contributed by Jukka Lehtosalo.</p> <h4>Support for <code>functools.partial</code></h4> <p>Mypy now type checks uses of <code>functools.partial</code>. Previously mypy would accept arbitrary arguments.</p> <p>This example will now produce an error:</p> <pre lang="python"><code>from functools import partial &lt;/tr&gt;&lt;/table&gt; </code></pre> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/python/mypy/commit/570b90a7a368f04c64f60af339d0ac1808c49c15"><code>570b90a</code></a> Bump version to 1.11</li> <li><a href="https://github.com/python/mypy/commit/b3a102ef31f63a8a8ba32c8dbe160ddef3c43054"><code>b3a102e</code></a> Fix <code>RawExpressionType.accept</code> crash with <code>--cache-fine-grained</code> (<a href="https://redirect.github.com/python/mypy/issues/17588">#17588</a>)</li> <li><a href="https://github.com/python/mypy/commit/aec04c74488d46a81a95ed3553b8e953a6ec59a7"><code>aec04c7</code></a> Fix PEP 604 isinstance caching (<a href="https://redirect.github.com/python/mypy/issues/17563">#17563</a>)</li> <li><a href="https://github.com/python/mypy/commit/cb44e4d8f18b9bc874f1076b33eec7ad67de165c"><code>cb44e4d</code></a> Fix <code>typing.TypeAliasType</code> being undefined on python &lt; 3.12 (<a href="https://redirect.github.com/python/mypy/issues/17558">#17558</a>)</li> <li><a href="https://github.com/python/mypy/commit/6cf9180e1411dab2ee91b57374f696d391eb24f4"><code>6cf9180</code></a> Fix types.GenericAlias lookup crash (<a href="https://redirect.github.com/python/mypy/issues/17543">#17543</a>)</li> <li><a href="https://github.com/python/mypy/commit/64c1ebf7cff51c13b1771174e3bb6bce9fe0d5dc"><code>64c1ebf</code></a> Bump version to 1.11.1+dev</li> <li><a href="https://github.com/python/mypy/commit/dbd5f5cdb62b4dcd1e498c3a91c204b812609fdf"><code>dbd5f5c</code></a> Remove +dev from version for 1.11 release</li> <li><a href="https://github.com/python/mypy/commit/f0a8c6931485364d918f7b4920e5f2832a6be22f"><code>f0a8c69</code></a> Update CHANGELOG for mypy 1.11 (<a href="https://redirect.github.com/python/mypy/issues/17540">#17540</a>)</li> <li><a href="https://github.com/python/mypy/commit/371f7801e9bff13803a228e6cc8dd4cee6c8e472"><code>371f780</code></a> CHANGELOG.md update for 1.11 (<a href="https://redirect.github.com/python/mypy/issues/17539">#17539</a>)</li> <li><a href="https://github.com/python/mypy/commit/2563da0c721a89725bfd009da12dd6378554bfc6"><code>2563da0</code></a> Fix daemon crash on invalid type in TypedDict (<a href="https://redirect.github.com/python/mypy/issues/17495">#17495</a>)</li> <li>Additional commits viewable in <a href="https://github.com/python/mypy/compare/v1.10.1...v1.11.1">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=1.10.1&new-version=1.11.1)](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 show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@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: Sam Bull <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f1e4213 commit 06eedff

File tree

8 files changed

+16
-7
lines changed

8 files changed

+16
-7
lines changed

.mypy.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ disallow_untyped_defs = True
1212
extra_checks = True
1313
implicit_reexport = False
1414
no_implicit_optional = True
15+
pretty = True
16+
show_column_numbers = True
1517
show_error_codes = True
1618
show_error_code_links = True
1719
strict_equality = True

aiohttp/typedefs.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Callable,
88
Iterable,
99
Mapping,
10+
Protocol,
1011
Tuple,
1112
Union,
1213
)
@@ -49,6 +50,12 @@
4950
]
5051

5152
Handler = Callable[["Request"], Awaitable["StreamResponse"]]
52-
Middleware = Callable[["Request", Handler], Awaitable["StreamResponse"]]
53+
54+
55+
class Middleware(Protocol):
56+
def __call__(
57+
self, request: "Request", handler: Handler
58+
) -> Awaitable["StreamResponse"]: ...
59+
5360

5461
PathLike = Union[str, "os.PathLike[str]"]

aiohttp/web_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ async def _handle(self, request: Request) -> StreamResponse:
529529
for m, new_style in app._middlewares_handlers: # type: ignore[union-attr]
530530
if new_style:
531531
handler = update_wrapper(
532-
partial(m, handler=handler), handler
532+
partial(m, handler=handler), handler # type: ignore[misc]
533533
)
534534
else:
535535
handler = await m(app, handler) # type: ignore[arg-type,assignment]

aiohttp/web_urldispatcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def __init__(
206206

207207
@wraps(handler)
208208
async def handler_wrapper(request: Request) -> StreamResponse:
209-
result = old_handler(request)
209+
result = old_handler(request) # type: ignore[call-arg]
210210
if asyncio.iscoroutine(result):
211211
result = await result
212212
assert isinstance(result, StreamResponse)

requirements/constraints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ multidict==6.0.5
116116
# -r requirements/multidict.in
117117
# -r requirements/runtime-deps.in
118118
# yarl
119-
mypy==1.10.1 ; implementation_name == "cpython"
119+
mypy==1.11.1 ; implementation_name == "cpython"
120120
# via
121121
# -r requirements/lint.in
122122
# -r requirements/test.in

requirements/dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ multidict==6.0.5
111111
# via
112112
# -r requirements/runtime-deps.in
113113
# yarl
114-
mypy==1.10.1 ; implementation_name == "cpython"
114+
mypy==1.11.1 ; implementation_name == "cpython"
115115
# via
116116
# -r requirements/lint.in
117117
# -r requirements/test.in

requirements/lint.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ markdown-it-py==3.0.0
4040
# via rich
4141
mdurl==0.1.2
4242
# via markdown-it-py
43-
mypy==1.10.1 ; implementation_name == "cpython"
43+
mypy==1.11.1 ; implementation_name == "cpython"
4444
# via -r requirements/lint.in
4545
mypy-extensions==1.0.0
4646
# via mypy

requirements/test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ multidict==6.0.5
5757
# via
5858
# -r requirements/runtime-deps.in
5959
# yarl
60-
mypy==1.10.1 ; implementation_name == "cpython"
60+
mypy==1.11.1 ; implementation_name == "cpython"
6161
# via -r requirements/test.in
6262
mypy-extensions==1.0.0
6363
# via mypy

0 commit comments

Comments
 (0)