Bump mypy to 1.7.1 (#4069)

This commit is contained in:
Alex Waygood 2023-11-24 14:19:54 +00:00 committed by GitHub
parent fb5e5d2be6
commit 69d49c5a6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 9 deletions

View File

@ -39,7 +39,7 @@ repos:
exclude: ^src/blib2to3/ exclude: ^src/blib2to3/
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1 rev: v1.7.1
hooks: hooks:
- id: mypy - id: mypy
exclude: ^docs/conf.py exclude: ^docs/conf.py

View File

@ -26,7 +26,7 @@
### Packaging ### Packaging
- Upgrade to mypy 1.6.1 (#4049) - Upgrade to mypy 1.7.1 (#4049) (#4069)
### Parser ### Parser

View File

@ -121,7 +121,7 @@ macos-max-compat = true
enable-by-default = false enable-by-default = false
dependencies = [ dependencies = [
"hatch-mypyc>=0.16.0", "hatch-mypyc>=0.16.0",
"mypy==1.6.1", "mypy==1.7.1",
"click==8.1.3", # avoid https://github.com/pallets/click/issues/2558 "click==8.1.3", # avoid https://github.com/pallets/click/issues/2558
] ]
require-runtime-dependencies = true require-runtime-dependencies = true
@ -187,7 +187,7 @@ CC = "clang"
build-frontend = { name = "build", args = ["--no-isolation"] } build-frontend = { name = "build", args = ["--no-isolation"] }
# Unfortunately, hatch doesn't respect MACOSX_DEPLOYMENT_TARGET # Unfortunately, hatch doesn't respect MACOSX_DEPLOYMENT_TARGET
before-build = [ before-build = [
"python -m pip install 'hatchling==1.18.0' hatch-vcs hatch-fancy-pypi-readme 'hatch-mypyc>=0.16.0' 'mypy==1.6.1' 'click==8.1.3'", "python -m pip install 'hatchling==1.18.0' hatch-vcs hatch-fancy-pypi-readme 'hatch-mypyc>=0.16.0' 'mypy==1.7.1' 'click==8.1.3'",
"""sed -i '' -e "600,700s/'10_16'/os.environ['MACOSX_DEPLOYMENT_TARGET'].replace('.', '_')/" $(python -c 'import hatchling.builders.wheel as h; print(h.__file__)') """, """sed -i '' -e "600,700s/'10_16'/os.environ['MACOSX_DEPLOYMENT_TARGET'].replace('.', '_')/" $(python -c 'import hatchling.builders.wheel as h; print(h.__file__)') """,
] ]

View File

@ -39,7 +39,6 @@
Set, Set,
Tuple, Tuple,
Union, Union,
cast,
) )
from blib2to3.pgen2.grammar import Grammar from blib2to3.pgen2.grammar import Grammar
@ -262,11 +261,9 @@ def add_whitespace(self, start: Coord) -> None:
def untokenize(self, iterable: Iterable[TokenInfo]) -> str: def untokenize(self, iterable: Iterable[TokenInfo]) -> str:
for t in iterable: for t in iterable:
if len(t) == 2: if len(t) == 2:
self.compat(cast(Tuple[int, str], t), iterable) self.compat(t, iterable)
break break
tok_type, token, start, end, line = cast( tok_type, token, start, end, line = t
Tuple[int, str, Coord, Coord, str], t
)
self.add_whitespace(start) self.add_whitespace(start)
self.tokens.append(token) self.tokens.append(token)
self.prev_row, self.prev_col = end self.prev_row, self.prev_col = end