Skip to content

Commit 57836c5

Browse files
Bump mypy from 1.16.1 to 1.17.0 (#11313)
Bumps [mypy](https://github.com/python/mypy) from 1.16.1 to 1.17.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> <h2>Mypy 1.17</h2> <p>We’ve just uploaded mypy 1.17 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 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> <h3>Optionally Check That Match Is Exhaustive</h3> <p>Mypy can now optionally generate an error if a match statement does not match exhaustively, without having to use <code>assert_never(...)</code>. Enable this by using <code>--enable-error-code exhaustive-match</code>.</p> <p>Example:</p> <pre lang="python"><code># mypy: enable-error-code=exhaustive-match <p>import enum</p> <p>class Color(enum.Enum): RED = 1 BLUE = 2</p> <p>def show_color(val: Color) -&gt; None: # error: Unhandled case for values of type &quot;Literal[Color.BLUE]&quot; match val: case Color.RED: print(&quot;red&quot;) </code></pre></p> <p>This feature was contributed by Donal Burns (PR <a href="https://redirect.github.com/python/mypy/pull/19144">19144</a>).</p> <h3>Further Improvements to Attribute Resolution</h3> <p>This release includes additional improvements to how attribute types and kinds are resolved. These fix many bugs and overall improve consistency.</p> <ul> <li>Handle corner case: protocol/class variable/descriptor (Ivan Levkivskyi, PR <a href="https://redirect.github.com/python/mypy/pull/19277">19277</a>)</li> <li>Fix a few inconsistencies in protocol/type object interactions (Ivan Levkivskyi, PR <a href="https://redirect.github.com/python/mypy/pull/19267">19267</a>)</li> <li>Refactor/unify access to static attributes (Ivan Levkivskyi, PR <a href="https://redirect.github.com/python/mypy/pull/19254">19254</a>)</li> <li>Remove inconsistencies in operator handling (Ivan Levkivskyi, PR <a href="https://redirect.github.com/python/mypy/pull/19250">19250</a>)</li> <li>Make protocol subtyping more consistent (Ivan Levkivskyi, PR <a href="https://redirect.github.com/python/mypy/pull/18943">18943</a>)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/python/mypy/commit/0260991f6b055110c3df36bd5539d4f4489bf153"><code>0260991</code></a> Update version string</li> <li><a href="https://github.com/python/mypy/commit/3901aa2f9523ce55e08d94c1716028d840398753"><code>3901aa2</code></a> Updates to 1.17 changelog (<a href="https://redirect.github.com/python/mypy/issues/19436">#19436</a>)</li> <li><a href="https://github.com/python/mypy/commit/7d133961a7e759aab84223bf8038b9489daaa93c"><code>7d13396</code></a> Initial changelog for 1.17 release (<a href="https://redirect.github.com/python/mypy/issues/19427">#19427</a>)</li> <li><a href="https://github.com/python/mypy/commit/a182dec997b418b925fe0c28575c50debba0bb3a"><code>a182dec</code></a> Combine the revealed types of multiple iteration steps in a more robust manne...</li> <li><a href="https://github.com/python/mypy/commit/ab4fd57d45b7f81cf281b17b7d3697ac9f79bc15"><code>ab4fd57</code></a> Improve the handling of &quot;iteration dependent&quot; errors and notes in finally cla...</li> <li><a href="https://github.com/python/mypy/commit/09ba1f6488b3e8d91c5204839421c61c306ff252"><code>09ba1f6</code></a> [mypyc] Fix exception swallowing in async try/finally blocks with await (<a href="https://redirect.github.com/python/mypy/issues/19353">#19353</a>)</li> <li><a href="https://github.com/python/mypy/commit/5c65e330b0e4a188d68c04715a90e1f7d9c18df6"><code>5c65e33</code></a> [mypyc] Fix AttributeError in async try/finally with mixed return paths (<a href="https://redirect.github.com/python/mypy/issues/19361">#19361</a>)</li> <li><a href="https://github.com/python/mypy/commit/934ec50744c766522329c604c6908a6ed05affd6"><code>934ec50</code></a> Lessen dmypy suggest path limitations for Windows machines (<a href="https://redirect.github.com/python/mypy/issues/19337">#19337</a>)</li> <li><a href="https://github.com/python/mypy/commit/a4801f928aaadb19f9893fe45af8e69ab6b509d0"><code>a4801f9</code></a> Type ignore comments erroneously marked as unused by dmypy (<a href="https://redirect.github.com/python/mypy/issues/15043">#15043</a>)</li> <li><a href="https://github.com/python/mypy/commit/c3bfa0d6f3ac3cea78cc497a3c44002ea46437a1"><code>c3bfa0d</code></a> Handle corner case: protocol vs classvar vs descriptor (<a href="https://redirect.github.com/python/mypy/issues/19277">#19277</a>)</li> <li>Additional commits viewable in <a href="https://github.com/python/mypy/compare/v1.16.1...v1.17.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.16.1&new-version=1.17.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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sam Bull <[email protected]>
1 parent 849e75a commit 57836c5

File tree

8 files changed

+132
-132
lines changed

8 files changed

+132
-132
lines changed

requirements/constraints.txt

Lines changed: 56 additions & 56 deletions
Large diffs are not rendered by default.

requirements/dev.txt

Lines changed: 51 additions & 51 deletions
Large diffs are not rendered by default.

requirements/lint.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ markdown-it-py==3.0.0
4545
# via rich
4646
mdurl==0.1.2
4747
# via markdown-it-py
48-
mypy==1.16.1 ; implementation_name == "cpython"
48+
mypy==1.17.0 ; implementation_name == "cpython"
4949
# via -r requirements/lint.in
5050
mypy-extensions==1.1.0
5151
# via mypy

requirements/test.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
# pip-compile --allow-unsafe --output-file=requirements/test.txt --resolver=backtracking --strip-extras requirements/test.in
66
#
77
aiodns==3.5.0
8-
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1382-peqen5/dependabot_20250715-1382-daxu5r/requirements/runtime-deps.in
8+
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1384-v0sr9j/dependabot_20250715-1384-mw23m4/requirements/runtime-deps.in
99
aiohappyeyeballs==2.6.1
10-
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1382-peqen5/dependabot_20250715-1382-daxu5r/requirements/runtime-deps.in
10+
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1384-v0sr9j/dependabot_20250715-1384-mw23m4/requirements/runtime-deps.in
1111
aiosignal==1.4.0
12-
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1382-peqen5/dependabot_20250715-1382-daxu5r/requirements/runtime-deps.in
12+
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1384-v0sr9j/dependabot_20250715-1384-mw23m4/requirements/runtime-deps.in
1313
annotated-types==0.7.0
1414
# via pydantic
1515
async-timeout==5.0.1 ; python_version < "3.11"
16-
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1382-peqen5/dependabot_20250715-1382-daxu5r/requirements/runtime-deps.in
16+
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1384-v0sr9j/dependabot_20250715-1384-mw23m4/requirements/runtime-deps.in
1717
blockbuster==1.5.25
1818
# via -r requirements/test.in
1919
brotli==1.1.0 ; platform_python_implementation == "CPython"
20-
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1382-peqen5/dependabot_20250715-1382-daxu5r/requirements/runtime-deps.in
20+
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1384-v0sr9j/dependabot_20250715-1384-mw23m4/requirements/runtime-deps.in
2121
cffi==1.17.1
2222
# via
2323
# cryptography
@@ -41,10 +41,10 @@ freezegun==1.5.3
4141
# via -r requirements/test.in
4242
frozenlist==1.7.0
4343
# via
44-
# -r /home/dependabot/dependabot-updater/tmp/20250715-1382-peqen5/dependabot_20250715-1382-daxu5r/requirements/runtime-deps.in
44+
# -r /home/dependabot/dependabot-updater/tmp/20250715-1384-v0sr9j/dependabot_20250715-1384-mw23m4/requirements/runtime-deps.in
4545
# aiosignal
4646
gunicorn==23.0.0
47-
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1382-peqen5/dependabot_20250715-1382-daxu5r/requirements/base.in
47+
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1384-v0sr9j/dependabot_20250715-1384-mw23m4/requirements/base.in
4848
idna==3.6
4949
# via
5050
# trustme
@@ -59,9 +59,9 @@ mdurl==0.1.2
5959
# via markdown-it-py
6060
multidict==6.6.3
6161
# via
62-
# -r /home/dependabot/dependabot-updater/tmp/20250715-1382-peqen5/dependabot_20250715-1382-daxu5r/requirements/runtime-deps.in
62+
# -r /home/dependabot/dependabot-updater/tmp/20250715-1384-v0sr9j/dependabot_20250715-1384-mw23m4/requirements/runtime-deps.in
6363
# yarl
64-
mypy==1.16.1 ; implementation_name == "cpython"
64+
mypy==1.17.0 ; implementation_name == "cpython"
6565
# via -r requirements/test.in
6666
mypy-extensions==1.1.0
6767
# via mypy
@@ -79,7 +79,7 @@ pluggy==1.6.0
7979
# pytest-cov
8080
propcache==0.3.2
8181
# via
82-
# -r /home/dependabot/dependabot-updater/tmp/20250715-1382-peqen5/dependabot_20250715-1382-daxu5r/requirements/runtime-deps.in
82+
# -r /home/dependabot/dependabot-updater/tmp/20250715-1384-v0sr9j/dependabot_20250715-1384-mw23m4/requirements/runtime-deps.in
8383
# yarl
8484
proxy-py==2.4.10
8585
# via -r requirements/test.in
@@ -141,12 +141,12 @@ typing-extensions==4.14.1
141141
typing-inspection==0.4.1
142142
# via pydantic
143143
uvloop==0.21.0 ; platform_system != "Windows" and implementation_name == "cpython"
144-
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1382-peqen5/dependabot_20250715-1382-daxu5r/requirements/base.in
144+
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1384-v0sr9j/dependabot_20250715-1384-mw23m4/requirements/base.in
145145
wait-for-it==2.3.0
146146
# via -r requirements/test.in
147147
yarl==1.20.1
148-
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1382-peqen5/dependabot_20250715-1382-daxu5r/requirements/runtime-deps.in
148+
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1384-v0sr9j/dependabot_20250715-1384-mw23m4/requirements/runtime-deps.in
149149
zlib-ng==0.5.1
150150
# via -r requirements/test.in
151151
zstandard==0.23.0 ; platform_python_implementation == "CPython" and python_version < "3.14"
152-
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1382-peqen5/dependabot_20250715-1382-daxu5r/requirements/runtime-deps.in
152+
# via -r /home/dependabot/dependabot-updater/tmp/20250715-1384-v0sr9j/dependabot_20250715-1384-mw23m4/requirements/runtime-deps.in

tests/test_client_functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4910,7 +4910,7 @@ async def final_handler(request: web.Request) -> web.Response:
49104910
client = await aiohttp_client(app)
49114911

49124912
payload_data = b"buffered reader payload"
4913-
buffer = io.BufferedReader(io.BytesIO(payload_data)) # type: ignore[arg-type]
4913+
buffer = io.BufferedReader(io.BytesIO(payload_data))
49144914
payload = BufferedReaderPayload(buffer)
49154915

49164916
resp = await client.post("/redirect", data=payload)

tests/test_client_request.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ async def _mock_write_bytes(
11911191
async def test_data_file(
11921192
loop: asyncio.AbstractEventLoop, buf: bytearray, conn: mock.Mock
11931193
) -> None:
1194-
with io.BufferedReader(io.BytesIO(b"*" * 2)) as file_handle: # type: ignore[arg-type]
1194+
with io.BufferedReader(io.BytesIO(b"*" * 2)) as file_handle:
11951195
req = ClientRequest(
11961196
"POST",
11971197
URL("http://python.org/"),
@@ -1804,7 +1804,7 @@ async def test_warn_if_unclosed_payload_via_body_setter(
18041804

18051805
# First set a payload that needs manual closing (autoclose=False)
18061806
file_payload = payload.BufferedReaderPayload(
1807-
io.BufferedReader(io.BytesIO(b"test data")), # type: ignore[arg-type]
1807+
io.BufferedReader(io.BytesIO(b"test data")),
18081808
encoding="utf-8",
18091809
)
18101810
req.body = file_payload
@@ -1851,7 +1851,7 @@ async def test_no_warn_for_consumed_payload_via_body_setter(
18511851

18521852
# Create a payload that needs manual closing
18531853
file_payload = payload.BufferedReaderPayload(
1854-
io.BufferedReader(io.BytesIO(b"test data")), # type: ignore[arg-type]
1854+
io.BufferedReader(io.BytesIO(b"test data")),
18551855
encoding="utf-8",
18561856
)
18571857
req.body = file_payload
@@ -1881,7 +1881,7 @@ async def test_warn_if_unclosed_payload_via_update_body_from_data(
18811881

18821882
# First set a payload that needs manual closing
18831883
file_payload = payload.BufferedReaderPayload(
1884-
io.BufferedReader(io.BytesIO(b"initial data")), # type: ignore[arg-type]
1884+
io.BufferedReader(io.BytesIO(b"initial data")),
18851885
encoding="utf-8",
18861886
)
18871887
req.update_body_from_data(file_payload)
@@ -1907,11 +1907,11 @@ async def test_warn_via_update_with_file_payload(
19071907
req = make_request("POST", "http://python.org/")
19081908

19091909
# First create a file-like object that results in BufferedReaderPayload
1910-
buffered1 = io.BufferedReader(io.BytesIO(b"file content 1")) # type: ignore[arg-type]
1910+
buffered1 = io.BufferedReader(io.BytesIO(b"file content 1"))
19111911
req.update_body_from_data(buffered1)
19121912

19131913
# Second update should warn about the first payload
1914-
buffered2 = io.BufferedReader(io.BytesIO(b"file content 2")) # type: ignore[arg-type]
1914+
buffered2 = io.BufferedReader(io.BytesIO(b"file content 2"))
19151915

19161916
with pytest.warns(
19171917
ResourceWarning,
@@ -2101,7 +2101,7 @@ async def test_warn_stacklevel_points_to_user_code(
21012101

21022102
# First set a payload that needs manual closing (autoclose=False)
21032103
file_payload = payload.BufferedReaderPayload(
2104-
io.BufferedReader(io.BytesIO(b"test data")), # type: ignore[arg-type]
2104+
io.BufferedReader(io.BytesIO(b"test data")),
21052105
encoding="utf-8",
21062106
)
21072107
req.body = file_payload
@@ -2139,7 +2139,7 @@ async def test_warn_stacklevel_update_body_from_data(
21392139

21402140
# First set a payload that needs manual closing (autoclose=False)
21412141
file_payload = payload.BufferedReaderPayload(
2142-
io.BufferedReader(io.BytesIO(b"test data")), # type: ignore[arg-type]
2142+
io.BufferedReader(io.BytesIO(b"test data")),
21432143
encoding="utf-8",
21442144
)
21452145
req.update_body_from_data(file_payload)

tests/test_payload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ async def test_string_io_payload_reusability() -> None:
874874
async def test_buffered_reader_payload_reusability() -> None:
875875
"""Test that BufferedReaderPayload can be written and read multiple times."""
876876
data = b"test buffered reader payload"
877-
buffer = io.BufferedReader(io.BytesIO(data)) # type: ignore[arg-type]
877+
buffer = io.BufferedReader(io.BytesIO(data))
878878
p = payload.BufferedReaderPayload(buffer)
879879

880880
# First write_with_length

tests/test_web_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ def read(self, size: int = -1) -> bytes:
11061106
(io.StringIO("test"), "test"),
11071107
(io.TextIOWrapper(io.BytesIO(b"test")), "test"),
11081108
(io.BytesIO(b"test"), "test"),
1109-
(io.BufferedReader(io.BytesIO(b"test")), "test"), # type: ignore[arg-type]
1109+
(io.BufferedReader(io.BytesIO(b"test")), "test"),
11101110
(async_iter(), None),
11111111
(BodyPartReader(b"x", CIMultiDictProxy(CIMultiDict()), mock.Mock()), None),
11121112
(

0 commit comments

Comments
 (0)