Bump flake8-pyi to 23.11.0 (#10997)

This commit is contained in:
Alex Waygood
2023-11-08 16:01:24 +00:00
committed by GitHub
parent b36f3c5229
commit 516f665505
19 changed files with 57 additions and 57 deletions

View File

@@ -26,7 +26,7 @@ repos:
additional_dependencies:
- "flake8-bugbear==23.9.16" # must match requirements-tests.txt
- "flake8-noqa==1.3.2" # must match requirements-tests.txt
- "flake8-pyi==23.10.0" # must match requirements-tests.txt
- "flake8-pyi==23.11.0" # must match requirements-tests.txt
types: [file]
types_or: [python, pyi]

View File

@@ -5,7 +5,7 @@ black==23.9.1 # must match .pre-commit-config.yaml
flake8==6.1.0 # must match .pre-commit-config.yaml
flake8-bugbear==23.9.16 # must match .pre-commit-config.yaml
flake8-noqa==1.3.2 # must match .pre-commit-config.yaml
flake8-pyi==23.10.0 # must match .pre-commit-config.yaml
flake8-pyi==23.11.0 # must match .pre-commit-config.yaml
mypy==1.6.1
pre-commit-hooks==4.5.0 # must match .pre-commit-config.yaml
pytype==2023.10.17; platform_system != "Windows" and python_version < "3.12"

View File

@@ -553,7 +553,7 @@ if sys.version_info >= (3, 10):
class MatchSingleton(pattern):
__match_args__ = ("value",)
value: Literal[True, False, None]
value: Literal[True, False] | None
class MatchSequence(pattern):
__match_args__ = ("patterns",)

View File

@@ -423,7 +423,7 @@ class BaseEventLoop(AbstractEventLoop):
bufsize: Literal[0] = 0,
encoding: None = None,
errors: None = None,
text: Literal[False, None] = None,
text: Literal[False] | None = None,
**kwargs: Any,
) -> tuple[SubprocessTransport, _ProtocolT]: ...
async def subprocess_exec(

View File

@@ -522,7 +522,7 @@ class AbstractEventLoop:
bufsize: Literal[0] = 0,
encoding: None = None,
errors: None = None,
text: Literal[False, None] = ...,
text: Literal[False] | None = ...,
**kwargs: Any,
) -> tuple[SubprocessTransport, _ProtocolT]: ...
@abstractmethod

View File

@@ -54,7 +54,7 @@ if sys.version_info >= (3, 11):
bufsize: Literal[0] = 0,
encoding: None = None,
errors: None = None,
text: Literal[False, None] = None,
text: Literal[False] | None = None,
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
executable: StrOrBytesPath | None = None,
preexec_fn: Callable[[], Any] | None = None,
@@ -120,7 +120,7 @@ elif sys.version_info >= (3, 10):
bufsize: Literal[0] = 0,
encoding: None = None,
errors: None = None,
text: Literal[False, None] = None,
text: Literal[False] | None = None,
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
executable: StrOrBytesPath | None = None,
preexec_fn: Callable[[], Any] | None = None,
@@ -185,7 +185,7 @@ else: # >= 3.9
bufsize: Literal[0] = 0,
encoding: None = None,
errors: None = None,
text: Literal[False, None] = None,
text: Literal[False] | None = None,
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
executable: StrOrBytesPath | None = None,
preexec_fn: Callable[[], Any] | None = None,

View File

@@ -248,7 +248,7 @@ if sys.version_info >= (3, 11):
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False, None] = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
@@ -260,7 +260,7 @@ if sys.version_info >= (3, 11):
encoding: None = None,
errors: None = None,
input: ReadableBuffer | None = None,
text: Literal[None, False] = None,
text: Literal[False] | None = None,
timeout: float | None = None,
user: str | int | None = None,
group: str | int | None = None,
@@ -452,7 +452,7 @@ elif sys.version_info >= (3, 10):
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False, None] = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
@@ -464,7 +464,7 @@ elif sys.version_info >= (3, 10):
encoding: None = None,
errors: None = None,
input: ReadableBuffer | None = None,
text: Literal[None, False] = None,
text: Literal[False] | None = None,
timeout: float | None = None,
user: str | int | None = None,
group: str | int | None = None,
@@ -650,7 +650,7 @@ elif sys.version_info >= (3, 9):
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False, None] = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
@@ -662,7 +662,7 @@ elif sys.version_info >= (3, 9):
encoding: None = None,
errors: None = None,
input: ReadableBuffer | None = None,
text: Literal[None, False] = None,
text: Literal[False] | None = None,
timeout: float | None = None,
user: str | int | None = None,
group: str | int | None = None,
@@ -829,7 +829,7 @@ else:
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False, None] = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
@@ -841,7 +841,7 @@ else:
encoding: None = None,
errors: None = None,
input: ReadableBuffer | None = None,
text: Literal[None, False] = None,
text: Literal[False] | None = None,
timeout: float | None = None,
) -> CompletedProcess[bytes]: ...
@overload
@@ -1242,7 +1242,7 @@ if sys.version_info >= (3, 11):
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False, None] = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
@@ -1253,7 +1253,7 @@ if sys.version_info >= (3, 11):
input: _InputString | None = ...,
encoding: None = None,
errors: None = None,
text: Literal[None, False] = None,
text: Literal[False] | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
@@ -1428,7 +1428,7 @@ elif sys.version_info >= (3, 10):
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False, None] = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
@@ -1439,7 +1439,7 @@ elif sys.version_info >= (3, 10):
input: _InputString | None = ...,
encoding: None = None,
errors: None = None,
text: Literal[None, False] = None,
text: Literal[False] | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
@@ -1608,7 +1608,7 @@ elif sys.version_info >= (3, 9):
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False, None] = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
@@ -1619,7 +1619,7 @@ elif sys.version_info >= (3, 9):
input: _InputString | None = ...,
encoding: None = None,
errors: None = None,
text: Literal[None, False] = None,
text: Literal[False] | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
@@ -1769,7 +1769,7 @@ else:
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False, None] = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
@@ -1780,7 +1780,7 @@ else:
input: _InputString | None = ...,
encoding: None = None,
errors: None = None,
text: Literal[None, False] = None,
text: Literal[False] | None = None,
) -> bytes: ...
@overload
def check_output(
@@ -1990,14 +1990,14 @@ class Popen(Generic[AnyStr]):
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False, None] = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any | None = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
*,
text: Literal[None, False] = None,
text: Literal[False] | None = None,
encoding: None = None,
errors: None = None,
user: str | int | None = None,
@@ -2175,14 +2175,14 @@ class Popen(Generic[AnyStr]):
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False, None] = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any | None = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
*,
text: Literal[None, False] = None,
text: Literal[False] | None = None,
encoding: None = None,
errors: None = None,
user: str | int | None = None,
@@ -2354,14 +2354,14 @@ class Popen(Generic[AnyStr]):
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False, None] = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any | None = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
*,
text: Literal[None, False] = None,
text: Literal[False] | None = None,
encoding: None = None,
errors: None = None,
user: str | int | None = None,
@@ -2514,14 +2514,14 @@ class Popen(Generic[AnyStr]):
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False, None] = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any | None = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
*,
text: Literal[None, False] = None,
text: Literal[False] | None = None,
encoding: None = None,
errors: None = None,
) -> None: ...

View File

@@ -9,10 +9,10 @@ from .ImageFile import ImageFile
split: Incomplete
field: Incomplete
if sys.platform == "win32":
gs_binary: Literal["gswin32c", "gswin64c", "gs", False, None]
gs_windows_binary: Literal["gswin32c", "gswin64c", "gs", False, None]
gs_binary: Literal["gswin32c", "gswin64c", "gs", False] | None
gs_windows_binary: Literal["gswin32c", "gswin64c", "gs", False] | None
else:
gs_binary: Literal["gs", False, None]
gs_binary: Literal["gs", False] | None
gs_windows_binary: None
def has_ghostscript(): ...

View File

@@ -1,6 +1,6 @@
from _typeshed import Incomplete, Unused
from collections import defaultdict
from collections.abc import Generator, Iterable
from collections.abc import Iterable, Iterator
from .encryption import StandardSecurityHandler
from .syntax import PDFArray, PDFObject, PDFString
@@ -45,4 +45,4 @@ class StructureTreeBuilder:
) -> tuple[Incomplete, Incomplete]: ...
def next_mcid_for_page(self, page_number: int) -> int: ...
def empty(self) -> bool: ...
def __iter__(self) -> Generator[Incomplete, None, None]: ...
def __iter__(self) -> Iterator[Incomplete]: ...

View File

@@ -32,7 +32,7 @@ TYPE_FORMULA_CACHE_STRING: Final = "str"
VALID_TYPES: Final[tuple[str, ...]]
def get_type(t: type, value: object) -> Literal["n", "s", "d", "f", None]: ...
def get_type(t: type, value: object) -> Literal["n", "s", "d", "f"] | None: ...
def get_time_format(t: _TimeTypes) -> str: ...
class Cell(StyleableObject):

View File

@@ -16,7 +16,7 @@ _T = TypeVar("_T")
LOGGER: Incomplete
class ClosableDeferredQueue(DeferredQueue[_T], Generic[_T]): # pyright: ignore[reportUntypedBaseClass]
class ClosableDeferredQueue(DeferredQueue[_T], Generic[_T]): # pyright: ignore[reportUntypedBaseClass] # noqa: Y060
closed: Failure | BaseException | None
def __init__(self, size: Incomplete | None = ..., backlog: Incomplete | None = ...) -> None: ...
# Returns a Deferred with an error if fails. None if success

View File

@@ -45,7 +45,7 @@ ALL_SUFFIXES: Final[list[str]]
architecture: Final[Literal["64bit", "n32bit", "32bit"]]
system: Final[Literal["Cygwin", "Linux", "Darwin", "Java", "Windows"]]
machine: Final[Literal["sw_64", "loongarch64", "arm", "intel", "ppc", "mips", "riscv", "s390x", "unknown", None]]
machine: Final[Literal["sw_64", "loongarch64", "arm", "intel", "ppc", "mips", "riscv", "s390x", "unknown"] | None]
def is_wine_dll(filename: FileDescriptorOrPath) -> bool: ...
@overload

View File

@@ -66,5 +66,5 @@ class PostGraphAPI:
def add_binaries(self, binaries: TOC | Iterable[tuple[StrOrBytesPath, StrOrBytesPath]]) -> None: ...
def add_datas(self, datas: TOC | Iterable[tuple[StrOrBytesPath, StrOrBytesPath]]) -> None: ...
def set_module_collection_mode(
self, name: str | None, mode: Literal["pyz", "pyc", "py", "pyz+py", "py+pyz", None]
self, name: str | None, mode: Literal["pyz", "pyc", "py", "pyz+py", "py+pyz"] | None
) -> None: ...

View File

@@ -9,11 +9,11 @@ from Xlib._typing import Unused
if sys.platform == "darwin":
SUPPORTED_PROTOCOLS: Final[tuple[None, Literal["tcp"], Literal["unix"], Literal["darwin"]]]
_Protocol: TypeAlias = Literal[None, "tcp", "unix", "darwin"]
_Protocol: TypeAlias = Literal["tcp", "unix", "darwin"] | None
DARWIN_DISPLAY_RE: Final[Pattern[str]]
else:
SUPPORTED_PROTOCOLS: Final[tuple[None, Literal["tcp"], Literal["unix"]]]
_Protocol: TypeAlias = Literal[None, "tcp", "unix"]
_Protocol: TypeAlias = Literal["tcp", "unix"] | None
uname: uname_result
DISPLAY_RE: Final[Pattern[str]]

View File

@@ -238,12 +238,12 @@ class IniFile:
list: bool = False,
) -> None: ...
def checkExtras(self) -> None: ...
def checkBoolean(self, value: str) -> Literal[1, 2, None]: ...
def checkNumber(self, value: str) -> Literal[1, 2, None]: ...
def checkInteger(self, value: str) -> Literal[1, None]: ...
def checkPoint(self, value: str) -> Literal[1, None]: ...
def checkBoolean(self, value: str) -> Literal[1, 2] | None: ...
def checkNumber(self, value: str) -> Literal[1, 2] | None: ...
def checkInteger(self, value: str) -> Literal[1] | None: ...
def checkPoint(self, value: str) -> Literal[1] | None: ...
def checkString(self, value: str) -> Literal[0, 1]: ...
def checkRegex(self, value: str) -> Literal[1, None]: ...
def checkRegex(self, value: str) -> Literal[1] | None: ...
def write(self, filename: str | None = None, trusted: bool = False) -> None: ...
def set(self, key: str, value: str, group: str | None = None, locale: bool = False) -> None: ...
def addGroup(self, group: str) -> None: ...

View File

@@ -1,6 +1,6 @@
from _typeshed import Incomplete
from typing import Generic, NamedTuple, TypeVar, overload
from typing_extensions import Literal, TypeAlias
from typing_extensions import TypeAlias
from qrcode.image.base import BaseImage
@@ -57,9 +57,9 @@ class QRCode(Generic[GenericImage]):
def print_tty(self, out: Incomplete | None = None) -> None: ...
def print_ascii(self, out: Incomplete | None = None, tty: bool = False, invert: bool = False): ...
@overload
def make_image(self, image_factory: Literal[None] = None, **kwargs) -> GenericImage: ...
def make_image(self, image_factory: None = None, **kwargs) -> GenericImage: ...
@overload
def make_image(self, image_factory: type[GenericImageLocal] | None = None, **kwargs) -> GenericImageLocal: ...
def make_image(self, image_factory: type[GenericImageLocal], **kwargs) -> GenericImageLocal: ...
def is_constrained(self, row: int, col: int) -> bool: ...
def setup_timing_pattern(self) -> None: ...
def setup_position_adjust_pattern(self) -> None: ...

View File

@@ -1,4 +1,4 @@
from collections.abc import Generator
from collections.abc import Iterator
from typing import Any
from matplotlib.axes import Axes
@@ -15,5 +15,5 @@ class Subplots:
figure_kws: dict[str, Any] | None = None,
target: Axes | Figure | SubFigure | None = None,
) -> Figure: ...
def __iter__(self) -> Generator[dict[str, Any], None, None]: ...
def __iter__(self) -> Iterator[dict[str, Any]]: ...
def __len__(self) -> int: ...

View File

@@ -3,7 +3,7 @@ import types
import zipimport
from _typeshed import Incomplete
from abc import ABCMeta
from collections.abc import Callable, Generator, Iterable, Sequence
from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
from io import BytesIO
from re import Pattern
from typing import IO, Any, ClassVar, Protocol, TypeVar, overload, type_check_only
@@ -32,7 +32,7 @@ class WorkingSet:
def iter_entry_points(self, group: str, name: str | None = None) -> Generator[EntryPoint, None, None]: ...
def add_entry(self, entry: str) -> None: ...
def __contains__(self, dist: Distribution) -> bool: ...
def __iter__(self) -> Generator[Distribution, None, None]: ...
def __iter__(self) -> Iterator[Distribution]: ...
def find(self, req: Requirement) -> Distribution | None: ...
def resolve(
self,
@@ -61,7 +61,7 @@ class Environment:
self, search_path: Sequence[str] | None = None, platform: str | None = ..., python: str | None = ...
) -> None: ...
def __getitem__(self, project_name: str) -> list[Distribution]: ...
def __iter__(self) -> Generator[str, None, None]: ...
def __iter__(self) -> Iterator[str]: ...
def add(self, dist: Distribution) -> None: ...
def remove(self, dist: Distribution) -> None: ...
def can_add(self, dist: Distribution) -> bool: ...

View File

@@ -38,7 +38,7 @@ class InputSpec:
# Most layers have input and output type of just Tensor and when we support default type variables,
# maybe worth trying.
class Layer(Generic[_InputT, _OutputT], tf.Module):
class Layer(tf.Module, Generic[_InputT, _OutputT]):
# The most general type is _ContainerGeneric[InputSpec] as it really
# depends on _InputT. For most Layers it is just InputSpec
# though. Maybe describable with HKT?