Skip to content

Commit 8b31f26

Browse files
Update most test/lint dependencies (#15582)
1 parent 8ffc436 commit 8b31f26

File tree

142 files changed

+310
-357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+310
-357
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
args: [--fix=lf]
1212
- id: check-case-conflict
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.14.10 # must match requirements-tests.txt
14+
rev: v0.15.8 # must match requirements-tests.txt
1515
hooks:
1616
- id: ruff
1717
name: Run ruff on stubs, tests and scripts
@@ -27,7 +27,7 @@ repos:
2727
- "--unsafe-fixes"
2828
files: '.*test_cases/.+\.py$'
2929
- repo: https://github.com/psf/black-pre-commit-mirror
30-
rev: 25.12.0
30+
rev: 26.3.1
3131
hooks:
3232
- id: black
3333
- repo: https://github.com/pycqa/flake8

lib/ts_utils/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def colored(text: str, color: str | None = None, **kwargs: Any) -> str: # type:
5050

5151

5252
def strip_comments(text: str) -> str:
53-
return text.split("#")[0].strip()
53+
return text.split("#", maxsplit=1)[0].strip()
5454

5555

5656
def jsonc_to_json(text: str) -> str:

requirements-tests.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ mypy==1.20.0
44
pyright==1.1.408
55

66
# Libraries used by our various scripts.
7-
aiohttp==3.13.3
7+
aiohttp==3.13.5
88
grpcio-tools>=1.76.0 # For grpc_tools.protoc
9-
mypy-protobuf==4.0.0
10-
packaging==25.0
9+
mypy-protobuf==5.0.0
10+
packaging==26.0
1111
pathspec>=1.0.3
1212
pre-commit
1313
# Required by create_baseline_stubs.py. Must match .pre-commit-config.yaml.
14-
ruff==0.14.10
14+
ruff==0.15.8
1515
stubdefaulter==0.1.0
1616
termcolor>=2.3
17-
tomli==2.3.0; python_version < "3.11"
18-
tomlkit==0.13.3
17+
tomli==2.4.1; python_version < "3.11"
18+
tomlkit==0.14.0
1919
typing_extensions>=4.15.0rc1
20-
uv==0.9.22
20+
uv==0.11.2
2121

2222
# Utilities for typeshed infrastructure scripts.
2323
ts_utils @ file:lib

scripts/create_baseline_stubs.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,10 @@ def add_pyright_exclusion(stub_dir: Path) -> None:
188188

189189

190190
def main() -> None:
191-
parser = argparse.ArgumentParser(
192-
description="""Generate baseline stubs automatically for an installed pip package
191+
parser = argparse.ArgumentParser(description="""Generate baseline stubs automatically for an installed pip package
193192
using stubgen. Also run Black and Ruff. If the name of
194193
the project is different from the runtime Python package name, you may
195-
need to use --package (example: --package yaml PyYAML)."""
196-
)
194+
need to use --package (example: --package yaml PyYAML).""")
197195
parser.add_argument("project", help="name of PyPI project for which to generate stubs under stubs/")
198196
parser.add_argument("--package", help="generate stubs for this Python package (default is autodetected)")
199197
args = parser.parse_args()

scripts/stubsabot.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -844,24 +844,20 @@ def get_update_pr_body(update: Update, metadata: Mapping[str, Any]) -> str:
844844
stubtest_settings: dict[str, Any] = metadata.get("tool", {}).get("stubtest", {})
845845
stubtest_will_run = not stubtest_settings.get("skip", False)
846846
if stubtest_will_run:
847-
body += textwrap.dedent(
848-
"""
847+
body += textwrap.dedent("""
849848
850849
If stubtest fails for this PR:
851850
- Leave this PR open (as a reminder, and to prevent stubsabot from opening another PR)
852851
- Fix stubtest failures in another PR, then close this PR
853852
854853
Note that you will need to close and re-open the PR in order to trigger CI
855-
"""
856-
)
854+
""")
857855
else:
858-
body += textwrap.dedent(
859-
f"""
856+
body += textwrap.dedent(f"""
860857
861858
:warning: Review this PR manually, as stubtest is skipped in CI for {update.distribution}!
862859
Also check whether stubtest can be reenabled. :warning:
863-
"""
864-
)
860+
""")
865861
return body
866862

867863

stdlib/@tests/test_cases/typing/check_all.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"""
33
This tests that star imports work when using "all += " syntax.
44
"""
5+
56
from __future__ import annotations
67

78
from typing import *

stdlib/_socket.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ class socket:
741741
def proto(self) -> int: ...
742742
# F811: "Redefinition of unused `timeout`"
743743
@property
744-
def timeout(self) -> float | None: ... # noqa: F811
744+
def timeout(self) -> float | None: ...
745745
if sys.platform == "win32":
746746
def __init__(
747747
self, family: int = ..., type: int = ..., proto: int = ..., fileno: SupportsIndex | bytes | None = None
@@ -838,7 +838,7 @@ def inet_ntop(address_family: int, packed_ip: ReadableBuffer, /) -> str: ...
838838
def getdefaulttimeout() -> float | None: ...
839839

840840
# F811: "Redefinition of unused `timeout`"
841-
def setdefaulttimeout(timeout: float | None, /) -> None: ... # noqa: F811
841+
def setdefaulttimeout(timeout: float | None, /) -> None: ...
842842

843843
if sys.platform != "win32":
844844
def sethostname(name: str, /) -> None: ...

stdlib/argparse.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class HelpFormatter:
344344
def _metavar_formatter(self, action: Action, default_metavar: str) -> Callable[[int], tuple[str, ...]]: ...
345345
def _format_args(self, action: Action, default_metavar: str) -> str: ...
346346
def _expand_help(self, action: Action) -> str: ...
347-
def _iter_indented_subactions(self, action: Action) -> Generator[Action, None, None]: ...
347+
def _iter_indented_subactions(self, action: Action) -> Generator[Action]: ...
348348
def _split_lines(self, text: str, width: int) -> list[str]: ...
349349
def _fill_text(self, text: str, width: int, indent: str) -> str: ...
350350
def _get_help_string(self, action: Action) -> str | None: ...

stdlib/codecs.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ def open(
196196
filename: str, mode: str = "r", encoding: str | None = None, errors: str = "strict", buffering: int = -1
197197
) -> StreamReaderWriter: ...
198198
def EncodedFile(file: _Stream, data_encoding: str, file_encoding: str | None = None, errors: str = "strict") -> StreamRecoder: ...
199-
def iterencode(iterator: Iterable[str], encoding: str, errors: str = "strict") -> Generator[bytes, None, None]: ...
200-
def iterdecode(iterator: Iterable[bytes], encoding: str, errors: str = "strict") -> Generator[str, None, None]: ...
199+
def iterencode(iterator: Iterable[str], encoding: str, errors: str = "strict") -> Generator[bytes]: ...
200+
def iterdecode(iterator: Iterable[bytes], encoding: str, errors: str = "strict") -> Generator[str]: ...
201201

202202
BOM: Final[Literal[b"\xff\xfe", b"\xfe\xff"]] # depends on `sys.byteorder`
203203
BOM_BE: Final = b"\xfe\xff"

stdlib/concurrent/futures/process.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class _SafeQueue(Queue[Future[Any]]):
9797

9898
def _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ...
9999

100-
def _get_chunks(*iterables: Any, chunksize: int) -> Generator[tuple[Any, ...], None, None]: ...
100+
def _get_chunks(*iterables: Any, chunksize: int) -> Generator[tuple[Any, ...]]: ...
101101
def _process_chunk(fn: Callable[..., _T], chunk: Iterable[tuple[Any, ...]]) -> list[_T]: ...
102102

103103
if sys.version_info >= (3, 11):

0 commit comments

Comments
 (0)