Skip to content

Commit

Permalink
Update mypy to 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Jul 22, 2024
1 parent a9010f3 commit 377a3ef
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ jobs:
fail-fast: false
matrix:
# mypy 1.5 dropped support for Python 3.7
# mypy won't understand "3.13-dev", keeping the CI simple by just omitting it
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
Expand All @@ -139,7 +140,7 @@ jobs:
cache: pip
cache-dependency-path: .github/workflows/main.yml
check-latest: true
- run: pip install types-regex types-setuptools mypy==1.9
- run: pip install types-regex types-setuptools mypy==1.11
- run: mypy . --python-version=${{ matrix.python-version }}

pyright:
Expand Down
2 changes: 1 addition & 1 deletion Pythonwin/pywin/framework/stdin.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@ def fake_input(prompt=None):
finally:
get_input_line = input
else:
sys.stdin = Stdin() # type: ignore[assignment] # Not an actual TextIO
sys.stdin = Stdin()
6 changes: 5 additions & 1 deletion com/win32com/makegw/makegwparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
interface
"""

from __future__ import annotations

import re
import traceback

Expand Down Expand Up @@ -701,7 +703,9 @@ def _GetPythonTypeDesc(self):
return ConvertSimpleTypes[self.arg.type][1]


AllConverters = {
AllConverters: dict[
str, tuple[type[ArgFormatter], int, int] | tuple[type[ArgFormatter], int]
] = {
"const OLECHAR": (ArgFormatterOLECHAR, 0, 1),
"WCHAR": (ArgFormatterOLECHAR, 0, 1),
"OLECHAR": (ArgFormatterOLECHAR, 0, 1),
Expand Down
3 changes: 1 addition & 2 deletions com/win32comext/axscript/client/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ def _BuildFromOther(self, site: COMScript, value: BaseException | None):
tb_top = tb

bits = ["Traceback (most recent call last):\n"]
# Fixed in https://github.com/python/typeshed/pull/11675 , to be included in next mypy release
bits.extend(traceback.format_list(format_items)) # type: ignore[arg-type]
bits.extend(traceback.format_list(format_items))
if isinstance(value, pythoncom.com_error):
desc = f"{value.strerror} (0x{value.hresult:x})"
if (
Expand Down
4 changes: 2 additions & 2 deletions pywin32_postinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def flush(self):
if sys.stdout is None: # pyright: ignore[reportUnnecessaryComparison]
sys.stdout = sys.stderr

sys.stderr = Tee(sys.stderr) # type: ignore[assignment] # Not an actual TextIO
sys.stdout = Tee(sys.stdout) # type: ignore[assignment] # Not an actual TextIO
sys.stderr = Tee(sys.stderr)
sys.stdout = Tee(sys.stdout)

com_modules = [
# module_name, class_names
Expand Down

0 comments on commit 377a3ef

Please sign in to comment.