Skip to content

Commit 9d712f2

Browse files
dependabot[bot]Dreamsorcererpre-commit-ci[bot]
authored
Bump mypy from 1.6.1 to 1.7.0 (#7833)
Bumps [mypy](https://github.com/python/mypy) from 1.6.1 to 1.7.0. <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> <p>Stubgen will now include <code>__all__</code> in its output if it is in the input file (PR <a href="https://redirect.github.com/python/mypy/pull/16356">16356</a>).</p> <h2>Mypy 1.7</h2> <p>We’ve just uploaded mypy 1.7 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>Using TypedDict for <code>**kwargs</code> Typing</h4> <p>Mypy now has support for using <code>Unpack[...]</code> with a TypedDict type to annotate <code>**kwargs</code> arguments enabled by default. Example:</p> <pre><code># Or 'from typing_extensions import ...' from typing import TypedDict, Unpack <p>class Person(TypedDict): name: str age: int</p> <p>def foo(**kwargs: Unpack[Person]) -&gt; None: ...</p> <p>foo(name=&quot;x&quot;, age=1) # Ok foo(name=1) # Error </code></pre></p> <p>The definition of <code>foo</code> above is equivalent to the one below, with keyword-only arguments <code>name</code> and <code>age</code>:</p> <pre><code>def foo(*, name: str, age: int) -&gt; None: ... </code></pre> <p>Refer to <a href="https://peps.python.org/pep-0692/">PEP 692</a> for more information. Note that unlike in the current version of the PEP, mypy always treats signatures with <code>Unpack[SomeTypedDict]</code> as equivalent to their expanded forms with explicit keyword arguments, and there aren't special type checking rules for TypedDict arguments.</p> <p>This was contributed by Ivan Levkivskyi back in 2022 (PR <a href="https://redirect.github.com/python/mypy/pull/13471">13471</a>).</p> <h4>TypeVarTuple Support Enabled (Experimental)</h4> <p>Mypy now has support for variadic generics (TypeVarTuple) enabled by default, as an experimental feature. Refer to <a href="https://peps.python.org/pep-0646/">PEP 646</a> for the details.</p> <p>TypeVarTuple was implemented by Jared Hance and Ivan Levkivskyi over several mypy releases, with help from Jukka Lehtosalo.</p> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/python/mypy/commit/f6b9972329d5d68f6defc92a10cc4c3bc339c27b"><code>f6b9972</code></a> Remove +dev from version</li> <li><a href="https://github.com/python/mypy/commit/62bcae2d9bad12c5d3b5dda23dc031e1c7ddf136"><code>62bcae2</code></a> Fix handling of tuple type context with unpacks (<a href="https://redirect.github.com/python/mypy/issues/16444">#16444</a>)</li> <li><a href="https://github.com/python/mypy/commit/c22294a80b000ea673e407994ac5111644944486"><code>c22294a</code></a> Handle TypeVarTupleType when checking overload constraints (<a href="https://redirect.github.com/python/mypy/issues/16428">#16428</a>)</li> <li><a href="https://github.com/python/mypy/commit/8813968abb657113df5edfa207db46b0649c9dce"><code>8813968</code></a> Fix type narrowing in lambda expressions (<a href="https://redirect.github.com/python/mypy/issues/16407">#16407</a>)</li> <li><a href="https://github.com/python/mypy/commit/681e54cfe1642adddc41c4ff11198b8bc955d5af"><code>681e54c</code></a> Fix crash on unpack call special-casing (<a href="https://redirect.github.com/python/mypy/issues/16381">#16381</a>)</li> <li><a href="https://github.com/python/mypy/commit/f68f46351e30644aefd19900ba1634595adc1d09"><code>f68f463</code></a> Fix file reloading in dmypy with --export-types (<a href="https://redirect.github.com/python/mypy/issues/16359">#16359</a>)</li> <li><a href="https://github.com/python/mypy/commit/5624f401b3786ebdbe167c27297ed778cce3faa5"><code>5624f40</code></a> Fix daemon crash caused by deleted submodule (<a href="https://redirect.github.com/python/mypy/issues/16370">#16370</a>)</li> <li><a href="https://github.com/python/mypy/commit/ad0e183b0df7cc3dd94d9e1cd6f5710859beda96"><code>ad0e183</code></a> Enable Unpack/TypeVarTuple support (<a href="https://redirect.github.com/python/mypy/issues/16354">#16354</a>)</li> <li><a href="https://github.com/python/mypy/commit/b064a5c183b53a84d895bb8e3c36a3a74e24be9c"><code>b064a5c</code></a> Fix dmypy inspect on Windows (<a href="https://redirect.github.com/python/mypy/issues/16355">#16355</a>)</li> <li><a href="https://github.com/python/mypy/commit/4e30e896486b774cdecaef6d3521a585b8acf8bc"><code>4e30e89</code></a> Fix dmypy inspect for namespace packages (<a href="https://redirect.github.com/python/mypy/issues/16357">#16357</a>)</li> <li>Additional commits viewable in <a href="https://github.com/python/mypy/compare/v1.6.1...v1.7.0">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.6.1&new-version=1.7.0)](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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sam Bull <git@sambull.org> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 63a805e commit 9d712f2

File tree

10 files changed

+15
-17
lines changed

10 files changed

+15
-17
lines changed

aiohttp/client_reqrep.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ def update_cookies(self, cookies: Optional[LooseCookies]) -> None:
462462
if not cookies:
463463
return
464464

465-
c: SimpleCookie[str] = SimpleCookie()
465+
c = SimpleCookie()
466466
if hdrs.COOKIE in self.headers:
467467
c.load(self.headers.get(hdrs.COOKIE, ""))
468468
del self.headers[hdrs.COOKIE]
@@ -789,7 +789,7 @@ def __init__(
789789
assert isinstance(url, URL)
790790

791791
self.method = method
792-
self.cookies: SimpleCookie[str] = SimpleCookie()
792+
self.cookies = SimpleCookie()
793793

794794
self._real_url = url
795795
self._url = url.with_fragment(None)

aiohttp/connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def __init__(
248248
self._loop = loop
249249
self._factory = functools.partial(ResponseHandler, loop=loop)
250250

251-
self.cookies: SimpleCookie[str] = SimpleCookie()
251+
self.cookies = SimpleCookie()
252252

253253
# start keep-alive connection cleanup task
254254
self._cleanup_handle: Optional[asyncio.TimerHandle] = None

aiohttp/cookiejar.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def __init__(
6565
loop: Optional[asyncio.AbstractEventLoop] = None,
6666
) -> None:
6767
super().__init__(loop=loop)
68-
self._cookies: DefaultDict[Tuple[str, str], SimpleCookie[str]] = defaultdict(
68+
self._cookies: DefaultDict[Tuple[str, str], SimpleCookie] = defaultdict(
6969
SimpleCookie
7070
)
7171
self._host_only_cookies: Set[Tuple[str, str]] = set()
@@ -168,7 +168,7 @@ def update_cookies(self, cookies: LooseCookies, response_url: URL = URL()) -> No
168168

169169
for name, cookie in cookies:
170170
if not isinstance(cookie, Morsel):
171-
tmp: SimpleCookie[str] = SimpleCookie()
171+
tmp = SimpleCookie()
172172
tmp[name] = cookie # type: ignore[assignment]
173173
cookie = tmp[name]
174174

@@ -232,11 +232,9 @@ def update_cookies(self, cookies: LooseCookies, response_url: URL = URL()) -> No
232232

233233
self._do_expiration()
234234

235-
def filter_cookies(
236-
self, request_url: URL = URL()
237-
) -> Union["BaseCookie[str]", "SimpleCookie[str]"]:
235+
def filter_cookies(self, request_url: URL = URL()) -> "BaseCookie[str]":
238236
"""Returns this jar's cookies filtered by their attributes."""
239-
filtered: Union["SimpleCookie[str]", "BaseCookie[str]"] = (
237+
filtered: Union[SimpleCookie, "BaseCookie[str]"] = (
240238
SimpleCookie() if self._quote_cookie else BaseCookie()
241239
)
242240
if not self._cookies:

aiohttp/resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def resolve(
4545
# IPv6 is not supported by Python build,
4646
# or IPv6 is not enabled in the host
4747
continue
48-
if address[3]: # type: ignore[misc]
48+
if address[3]:
4949
# This is essential for link-local IPv6 addresses.
5050
# LL IPv6 is a VERY rare case. Strictly speaking, we should use
5151
# getnameinfo() unconditionally, but performance makes sense.

aiohttp/web_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ def cookies(self) -> Mapping[str, str]:
582582
A read-only dictionary-like object.
583583
"""
584584
raw = self.headers.get(hdrs.COOKIE, "")
585-
parsed: SimpleCookie[str] = SimpleCookie(raw)
585+
parsed = SimpleCookie(raw)
586586
return MappingProxyType({key: val.value for key, val in parsed.items()})
587587

588588
@reify

aiohttp/web_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(
8383
self._chunked = False
8484
self._compression = False
8585
self._compression_force: Optional[ContentCoding] = None
86-
self._cookies: SimpleCookie[str] = SimpleCookie()
86+
self._cookies = SimpleCookie()
8787

8888
self._req: Optional[BaseRequest] = None
8989
self._payload_writer: Optional[AbstractStreamWriter] = None
@@ -193,7 +193,7 @@ def headers(self) -> "CIMultiDict[str]":
193193
return self._headers
194194

195195
@property
196-
def cookies(self) -> "SimpleCookie[str]":
196+
def cookies(self) -> SimpleCookie:
197197
return self._cookies
198198

199199
def set_cookie(

requirements/constraints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ multidict==6.0.4
108108
# -r requirements/multidict.in
109109
# -r requirements/runtime-deps.in
110110
# yarl
111-
mypy==1.6.1 ; implementation_name == "cpython"
111+
mypy==1.7.0 ; implementation_name == "cpython"
112112
# via
113113
# -r requirements/lint.in
114114
# -r requirements/test.in

requirements/dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ multidict==6.0.4
103103
# via
104104
# -r requirements/runtime-deps.in
105105
# yarl
106-
mypy==1.6.1 ; implementation_name == "cpython"
106+
mypy==1.7.0 ; implementation_name == "cpython"
107107
# via
108108
# -r requirements/lint.in
109109
# -r requirements/test.in

requirements/lint.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ identify==2.5.26
2222
# via pre-commit
2323
iniconfig==2.0.0
2424
# via pytest
25-
mypy==1.6.1 ; implementation_name == "cpython"
25+
mypy==1.7.0 ; implementation_name == "cpython"
2626
# via -r requirements/lint.in
2727
mypy-extensions==1.0.0
2828
# via mypy

requirements/test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ multidict==6.0.4
5353
# via
5454
# -r requirements/runtime-deps.in
5555
# yarl
56-
mypy==1.6.1 ; implementation_name == "cpython"
56+
mypy==1.7.0 ; implementation_name == "cpython"
5757
# via -r requirements/test.in
5858
mypy-extensions==1.0.0
5959
# via mypy

0 commit comments

Comments
 (0)