Skip to content

Commit 57a4612

Browse files
authored
Fix mypy type issue (#4745)
1 parent 4f6ad7c commit 57a4612

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.github/workflows/pypi_upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
# Keep cibuildwheel version in sync with below
5151
- name: Install cibuildwheel and pypyp
5252
run: |
53-
pipx install cibuildwheel==2.22.0
53+
pipx install cibuildwheel==2.23.3
5454
pipx install pypyp==1.3.0
5555
- name: generate matrix
5656
if: github.event_name != 'pull_request'

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ repos:
3939
exclude: ^src/blib2to3/
4040

4141
- repo: https://github.com/pre-commit/mirrors-mypy
42-
rev: v1.16.1
42+
rev: v1.17.1
4343
hooks:
4444
- id: mypy
4545
exclude: ^(docs/conf.py|scripts/generate_schema.py)$

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ macos-max-compat = true
126126
enable-by-default = false
127127
dependencies = [
128128
"hatch-mypyc>=0.16.0",
129-
"mypy>=1.12",
129+
"mypy==1.17.1",
130130
"click>=8.1.7",
131131
]
132132
require-runtime-dependencies = true

src/black/trans.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ class CustomSplit:
334334
break_idx: int
335335

336336

337+
CustomSplitMapKey = tuple[StringID, str]
338+
339+
337340
@trait
338341
class CustomSplitMapMixin:
339342
"""
@@ -342,13 +345,12 @@ class CustomSplitMapMixin:
342345
the resultant substrings go over the configured max line length.
343346
"""
344347

345-
_Key: ClassVar = tuple[StringID, str]
346-
_CUSTOM_SPLIT_MAP: ClassVar[dict[_Key, tuple[CustomSplit, ...]]] = defaultdict(
347-
tuple
348+
_CUSTOM_SPLIT_MAP: ClassVar[dict[CustomSplitMapKey, tuple[CustomSplit, ...]]] = (
349+
defaultdict(tuple)
348350
)
349351

350352
@staticmethod
351-
def _get_key(string: str) -> "CustomSplitMapMixin._Key":
353+
def _get_key(string: str) -> CustomSplitMapKey:
352354
"""
353355
Returns:
354356
A unique identifier that is used internally to map @string to a

0 commit comments

Comments
 (0)