From 75d8c88ec5da2829f9e74b867998d058f454c3c7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 10:59:15 +0100 Subject: [PATCH] Update most test/lint dependencies (#14354) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alex Waygood --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 ++ requirements-tests.txt | 12 ++++++------ stdlib/asyncio/__init__.pyi | 2 +- stdlib/typing.pyi | 1 - tests/pyright_test.py | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 133c3c6fc..de927ebff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: args: [--fix=lf] - id: check-case-conflict - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.4 # must match requirements-tests.txt + rev: v0.12.1 # must match requirements-tests.txt hooks: - id: ruff name: Run ruff on stubs, tests and scripts diff --git a/pyproject.toml b/pyproject.toml index b4a430f75..322a383e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -159,6 +159,8 @@ ignore = [ # Used for direct, non-subclass type comparison, for example: `type(val) is str` # see https://github.com/astral-sh/ruff/issues/6465 "E721", # Do not compare types, use `isinstance()` + # Highly opinionated, and it's often necessary to violate it + "PLC0415", # `import` should be at the top-level of a file # Leave the size and complexity of tests to human interpretation "PLR09", # Too many ... # Too many magic number "2" that are preferable inline. https://github.com/astral-sh/ruff/issues/10009 diff --git a/requirements-tests.txt b/requirements-tests.txt index 33ec06e6f..794605e19 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,6 +1,6 @@ # Type checkers that we test our stubs against. These should always # be pinned to a specific version to make failure reproducible. -mypy==1.16.0 +mypy==1.16.1 pyright==1.1.400 # pytype can be installed on Windows, but requires building wheels, let's not do that on the CI pytype==2024.10.11; platform_system != "Windows" and python_version >= "3.10" and python_version < "3.13" @@ -8,23 +8,23 @@ pytype==2024.10.11; platform_system != "Windows" and python_version >= "3.10" an # Libraries used by our various scripts. # TODO (2025-05-09): Installing this on Python 3.14 on Windows fails at # the moment. -aiohttp==3.11.15; python_version < "3.14" +aiohttp==3.12.13; python_version < "3.14" # TODO (2025-05-09): No wheels exist for Python 3.14 yet, slowing down CI # considerably and prone to fail. grpcio-tools>=1.66.2; python_version < "3.14" # For grpc_tools.protoc mypy-protobuf==3.6.0 -packaging==24.2 +packaging==25.0 pathspec>=0.11.1 pre-commit # Required by create_baseline_stubs.py. Must match .pre-commit-config.yaml. -ruff==0.11.4 +ruff==0.12.1 # TODO (2025-05-07): Dependency libcst doesn't support Python 3.14 yet. stubdefaulter==0.1.0; python_version < "3.14" termcolor>=2.3 tomli==2.2.1 -tomlkit==0.13.2 +tomlkit==0.13.3 typing_extensions>=4.14.0rc1 -uv==0.7.4 +uv==0.7.17 # Utilities for typeshed infrastructure scripts. ts_utils @ file:lib diff --git a/stdlib/asyncio/__init__.pyi b/stdlib/asyncio/__init__.pyi index 68e44a88f..58739816a 100644 --- a/stdlib/asyncio/__init__.pyi +++ b/stdlib/asyncio/__init__.pyi @@ -1,4 +1,4 @@ -# ruff: noqa: PLR5501 # This condition is so big, it's clearer to keep to platform condition in two blocks +# This condition is so big, it's clearer to keep to platform condition in two blocks # Can't NOQA on a specific line: https://github.com/plinss/flake8-noqa/issues/22 import sys from collections.abc import Awaitable, Coroutine, Generator diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 79ab9eee9..b1c93dfe7 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -1,5 +1,4 @@ # Since this module defines "overload" it is not recognized by Ruff as typing.overload -# ruff: noqa: F811 # TODO: The collections import is required, otherwise mypy crashes. # https://github.com/python/mypy/issues/16744 import collections # noqa: F401 # pyright: ignore[reportUnusedImport] diff --git a/tests/pyright_test.py b/tests/pyright_test.py index 04b3df6fa..c97ca44fe 100755 --- a/tests/pyright_test.py +++ b/tests/pyright_test.py @@ -37,7 +37,7 @@ def main() -> None: # version installed into the virtual environment, due to failures on some # platforms. https://github.com/python/typeshed/issues/11614 os.environ["PYRIGHT_PYTHON_FORCE_VERSION"] = pyright_version - command = [npx, f"pyright@{pyright_version}"] + sys.argv[1:] + command = [npx, f"pyright@{pyright_version}", *sys.argv[1:]] print_command(command) ret = subprocess.run(command, check=False).returncode