Bump various test dependencies (#11249)

This commit is contained in:
Alex Waygood
2024-01-05 22:09:02 +00:00
committed by GitHub
parent a7c5d8bc14
commit ccc81f224d
7 changed files with 25 additions and 14 deletions

View File

@@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
version: "0.1.9" # must match .pre-commit-config.yaml and requirements-test.txt
version: "0.1.11" # must match .pre-commit-config.yaml and requirements-test.txt
flake8:
name: Lint with Flake8

View File

@@ -15,7 +15,7 @@ repos:
- id: black
language_version: python3.10
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9 # must match requirements-tests.txt and tests.yml
rev: v0.1.11 # must match requirements-tests.txt and tests.yml
hooks:
- id: ruff
args: [--exit-non-zero-on-fix, --fix-only]
@@ -26,7 +26,7 @@ repos:
additional_dependencies:
- "flake8-bugbear==23.12.2" # must match requirements-tests.txt
- "flake8-noqa==1.3.2" # must match requirements-tests.txt
- "flake8-pyi==23.11.0" # must match requirements-tests.txt
- "flake8-pyi==24.1.0" # must match requirements-tests.txt
types: [file]
types_or: [python, pyi]

View File

@@ -5,11 +5,11 @@ black==23.12.1 # must match .pre-commit-config.yaml
flake8==6.1.0 # must match .pre-commit-config.yaml
flake8-bugbear==23.12.2 # must match .pre-commit-config.yaml
flake8-noqa==1.3.2 # must match .pre-commit-config.yaml
flake8-pyi==23.11.0 # must match .pre-commit-config.yaml
flake8-pyi==24.1.0 # must match .pre-commit-config.yaml
mypy==1.8.0
pre-commit-hooks==4.5.0 # must match .pre-commit-config.yaml
pytype==2023.12.18; platform_system != "Windows" and python_version < "3.12"
ruff==0.1.9 # must match .pre-commit-config.yaml and tests.yml
ruff==0.1.11 # must match .pre-commit-config.yaml and tests.yml
# Libraries used by our various scripts.
aiohttp==3.9.1

View File

@@ -56,7 +56,19 @@ from typing import ( # noqa: Y022
overload,
type_check_only,
)
from typing_extensions import Concatenate, Literal, LiteralString, ParamSpec, Self, TypeAlias, TypeGuard, TypeVarTuple, deprecated
# we can't import `Literal` from typing or mypy crashes: see #11247
from typing_extensions import ( # noqa: Y023
Concatenate,
Literal,
LiteralString,
ParamSpec,
Self,
TypeAlias,
TypeGuard,
TypeVarTuple,
deprecated,
)
if sys.version_info >= (3, 9):
from types import GenericAlias

View File

@@ -29,7 +29,7 @@ class _HasText(Protocol):
class _HasAttrib(Protocol):
attrib: Iterable[Any] # AnyOf[dict[str, str], Iterable[tuple[str, str]]]
class _HasTagAndGet(_HasTag, _HasGet[_T_co], Protocol[_T_co]): ...
class _HasTagAndGet(_HasTag, _HasGet[_T_co], Protocol[_T_co]): ... # noqa: Y046
class _HasTagAndText(_HasTag, _HasText, Protocol): ... # noqa: Y046
class _HasTagAndTextAndAttrib(_HasTag, _HasText, _HasAttrib, Protocol): ... # noqa: Y046

View File

@@ -1,10 +1,9 @@
from collections.abc import Callable, Iterable, Iterator, MutableMapping, Sequence
from typing import Any, SupportsIndex, TypeVar, overload
from typing import Any, Protocol, SupportsIndex, TypeVar, overload
from google.protobuf.descriptor import Descriptor
from google.protobuf.internal.message_listener import MessageListener
from google.protobuf.internal.python_message import GeneratedProtocolMessageType
from google.protobuf.internal.type_checkers import _ValueChecker
from google.protobuf.message import Message
_T = TypeVar("_T")
@@ -13,6 +12,10 @@ _ScalarV = TypeVar("_ScalarV", bound=bool | int | float | str | bytes)
_MessageV = TypeVar("_MessageV", bound=Message)
_M = TypeVar("_M")
class _ValueChecker(Protocol[_T]):
def CheckValue(self, proposed_value: _T) -> _T: ...
def DefaultValue(self) -> _T: ...
class BaseContainer(Sequence[_T]):
def __init__(self, message_listener: MessageListener) -> None: ...
def __len__(self) -> int: ...

View File

@@ -1,11 +1,7 @@
from typing import Generic, Protocol, TypeVar
from typing import Generic, TypeVar
_T = TypeVar("_T")
class _ValueChecker(Protocol[_T]):
def CheckValue(self, proposed_value: _T) -> _T: ...
def DefaultValue(self) -> _T: ...
class TypeChecker(Generic[_T]):
def __init__(self, *acceptable_types: _T): ...
def CheckValue(self, proposed_value: _T) -> _T: ...