Skip to content

Commit 516f665

Browse files
authored
Bump flake8-pyi to 23.11.0 (#10997)
1 parent b36f3c5 commit 516f665

File tree

19 files changed

+57
-57
lines changed

19 files changed

+57
-57
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repos:
2626
additional_dependencies:
2727
- "flake8-bugbear==23.9.16" # must match requirements-tests.txt
2828
- "flake8-noqa==1.3.2" # must match requirements-tests.txt
29-
- "flake8-pyi==23.10.0" # must match requirements-tests.txt
29+
- "flake8-pyi==23.11.0" # must match requirements-tests.txt
3030
types: [file]
3131
types_or: [python, pyi]
3232

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ black==23.9.1 # must match .pre-commit-config.yaml
55
flake8==6.1.0 # must match .pre-commit-config.yaml
66
flake8-bugbear==23.9.16 # must match .pre-commit-config.yaml
77
flake8-noqa==1.3.2 # must match .pre-commit-config.yaml
8-
flake8-pyi==23.10.0 # must match .pre-commit-config.yaml
8+
flake8-pyi==23.11.0 # must match .pre-commit-config.yaml
99
mypy==1.6.1
1010
pre-commit-hooks==4.5.0 # must match .pre-commit-config.yaml
1111
pytype==2023.10.17; platform_system != "Windows" and python_version < "3.12"

stdlib/_ast.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ if sys.version_info >= (3, 10):
553553

554554
class MatchSingleton(pattern):
555555
__match_args__ = ("value",)
556-
value: Literal[True, False, None]
556+
value: Literal[True, False] | None
557557

558558
class MatchSequence(pattern):
559559
__match_args__ = ("patterns",)

stdlib/asyncio/base_events.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ class BaseEventLoop(AbstractEventLoop):
423423
bufsize: Literal[0] = 0,
424424
encoding: None = None,
425425
errors: None = None,
426-
text: Literal[False, None] = None,
426+
text: Literal[False] | None = None,
427427
**kwargs: Any,
428428
) -> tuple[SubprocessTransport, _ProtocolT]: ...
429429
async def subprocess_exec(

stdlib/asyncio/events.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ class AbstractEventLoop:
522522
bufsize: Literal[0] = 0,
523523
encoding: None = None,
524524
errors: None = None,
525-
text: Literal[False, None] = ...,
525+
text: Literal[False] | None = ...,
526526
**kwargs: Any,
527527
) -> tuple[SubprocessTransport, _ProtocolT]: ...
528528
@abstractmethod

stdlib/asyncio/subprocess.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if sys.version_info >= (3, 11):
5454
bufsize: Literal[0] = 0,
5555
encoding: None = None,
5656
errors: None = None,
57-
text: Literal[False, None] = None,
57+
text: Literal[False] | None = None,
5858
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
5959
executable: StrOrBytesPath | None = None,
6060
preexec_fn: Callable[[], Any] | None = None,
@@ -120,7 +120,7 @@ elif sys.version_info >= (3, 10):
120120
bufsize: Literal[0] = 0,
121121
encoding: None = None,
122122
errors: None = None,
123-
text: Literal[False, None] = None,
123+
text: Literal[False] | None = None,
124124
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
125125
executable: StrOrBytesPath | None = None,
126126
preexec_fn: Callable[[], Any] | None = None,
@@ -185,7 +185,7 @@ else: # >= 3.9
185185
bufsize: Literal[0] = 0,
186186
encoding: None = None,
187187
errors: None = None,
188-
text: Literal[False, None] = None,
188+
text: Literal[False] | None = None,
189189
# These parameters are taken by subprocess.Popen, which this ultimately delegates to
190190
executable: StrOrBytesPath | None = None,
191191
preexec_fn: Callable[[], Any] | None = None,

stdlib/subprocess.pyi

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ if sys.version_info >= (3, 11):
248248
shell: bool = False,
249249
cwd: StrOrBytesPath | None = None,
250250
env: _ENV | None = None,
251-
universal_newlines: Literal[False, None] = None,
251+
universal_newlines: Literal[False] | None = None,
252252
startupinfo: Any = None,
253253
creationflags: int = 0,
254254
restore_signals: bool = True,
@@ -260,7 +260,7 @@ if sys.version_info >= (3, 11):
260260
encoding: None = None,
261261
errors: None = None,
262262
input: ReadableBuffer | None = None,
263-
text: Literal[None, False] = None,
263+
text: Literal[False] | None = None,
264264
timeout: float | None = None,
265265
user: str | int | None = None,
266266
group: str | int | None = None,
@@ -452,7 +452,7 @@ elif sys.version_info >= (3, 10):
452452
shell: bool = False,
453453
cwd: StrOrBytesPath | None = None,
454454
env: _ENV | None = None,
455-
universal_newlines: Literal[False, None] = None,
455+
universal_newlines: Literal[False] | None = None,
456456
startupinfo: Any = None,
457457
creationflags: int = 0,
458458
restore_signals: bool = True,
@@ -464,7 +464,7 @@ elif sys.version_info >= (3, 10):
464464
encoding: None = None,
465465
errors: None = None,
466466
input: ReadableBuffer | None = None,
467-
text: Literal[None, False] = None,
467+
text: Literal[False] | None = None,
468468
timeout: float | None = None,
469469
user: str | int | None = None,
470470
group: str | int | None = None,
@@ -650,7 +650,7 @@ elif sys.version_info >= (3, 9):
650650
shell: bool = False,
651651
cwd: StrOrBytesPath | None = None,
652652
env: _ENV | None = None,
653-
universal_newlines: Literal[False, None] = None,
653+
universal_newlines: Literal[False] | None = None,
654654
startupinfo: Any = None,
655655
creationflags: int = 0,
656656
restore_signals: bool = True,
@@ -662,7 +662,7 @@ elif sys.version_info >= (3, 9):
662662
encoding: None = None,
663663
errors: None = None,
664664
input: ReadableBuffer | None = None,
665-
text: Literal[None, False] = None,
665+
text: Literal[False] | None = None,
666666
timeout: float | None = None,
667667
user: str | int | None = None,
668668
group: str | int | None = None,
@@ -829,7 +829,7 @@ else:
829829
shell: bool = False,
830830
cwd: StrOrBytesPath | None = None,
831831
env: _ENV | None = None,
832-
universal_newlines: Literal[False, None] = None,
832+
universal_newlines: Literal[False] | None = None,
833833
startupinfo: Any = None,
834834
creationflags: int = 0,
835835
restore_signals: bool = True,
@@ -841,7 +841,7 @@ else:
841841
encoding: None = None,
842842
errors: None = None,
843843
input: ReadableBuffer | None = None,
844-
text: Literal[None, False] = None,
844+
text: Literal[False] | None = None,
845845
timeout: float | None = None,
846846
) -> CompletedProcess[bytes]: ...
847847
@overload
@@ -1242,7 +1242,7 @@ if sys.version_info >= (3, 11):
12421242
shell: bool = False,
12431243
cwd: StrOrBytesPath | None = None,
12441244
env: _ENV | None = None,
1245-
universal_newlines: Literal[False, None] = None,
1245+
universal_newlines: Literal[False] | None = None,
12461246
startupinfo: Any = None,
12471247
creationflags: int = 0,
12481248
restore_signals: bool = True,
@@ -1253,7 +1253,7 @@ if sys.version_info >= (3, 11):
12531253
input: _InputString | None = ...,
12541254
encoding: None = None,
12551255
errors: None = None,
1256-
text: Literal[None, False] = None,
1256+
text: Literal[False] | None = None,
12571257
user: str | int | None = None,
12581258
group: str | int | None = None,
12591259
extra_groups: Iterable[str | int] | None = None,
@@ -1428,7 +1428,7 @@ elif sys.version_info >= (3, 10):
14281428
shell: bool = False,
14291429
cwd: StrOrBytesPath | None = None,
14301430
env: _ENV | None = None,
1431-
universal_newlines: Literal[False, None] = None,
1431+
universal_newlines: Literal[False] | None = None,
14321432
startupinfo: Any = None,
14331433
creationflags: int = 0,
14341434
restore_signals: bool = True,
@@ -1439,7 +1439,7 @@ elif sys.version_info >= (3, 10):
14391439
input: _InputString | None = ...,
14401440
encoding: None = None,
14411441
errors: None = None,
1442-
text: Literal[None, False] = None,
1442+
text: Literal[False] | None = None,
14431443
user: str | int | None = None,
14441444
group: str | int | None = None,
14451445
extra_groups: Iterable[str | int] | None = None,
@@ -1608,7 +1608,7 @@ elif sys.version_info >= (3, 9):
16081608
shell: bool = False,
16091609
cwd: StrOrBytesPath | None = None,
16101610
env: _ENV | None = None,
1611-
universal_newlines: Literal[False, None] = None,
1611+
universal_newlines: Literal[False] | None = None,
16121612
startupinfo: Any = None,
16131613
creationflags: int = 0,
16141614
restore_signals: bool = True,
@@ -1619,7 +1619,7 @@ elif sys.version_info >= (3, 9):
16191619
input: _InputString | None = ...,
16201620
encoding: None = None,
16211621
errors: None = None,
1622-
text: Literal[None, False] = None,
1622+
text: Literal[False] | None = None,
16231623
user: str | int | None = None,
16241624
group: str | int | None = None,
16251625
extra_groups: Iterable[str | int] | None = None,
@@ -1769,7 +1769,7 @@ else:
17691769
shell: bool = False,
17701770
cwd: StrOrBytesPath | None = None,
17711771
env: _ENV | None = None,
1772-
universal_newlines: Literal[False, None] = None,
1772+
universal_newlines: Literal[False] | None = None,
17731773
startupinfo: Any = None,
17741774
creationflags: int = 0,
17751775
restore_signals: bool = True,
@@ -1780,7 +1780,7 @@ else:
17801780
input: _InputString | None = ...,
17811781
encoding: None = None,
17821782
errors: None = None,
1783-
text: Literal[None, False] = None,
1783+
text: Literal[False] | None = None,
17841784
) -> bytes: ...
17851785
@overload
17861786
def check_output(
@@ -1990,14 +1990,14 @@ class Popen(Generic[AnyStr]):
19901990
shell: bool = False,
19911991
cwd: StrOrBytesPath | None = None,
19921992
env: _ENV | None = None,
1993-
universal_newlines: Literal[False, None] = None,
1993+
universal_newlines: Literal[False] | None = None,
19941994
startupinfo: Any | None = None,
19951995
creationflags: int = 0,
19961996
restore_signals: bool = True,
19971997
start_new_session: bool = False,
19981998
pass_fds: Collection[int] = (),
19991999
*,
2000-
text: Literal[None, False] = None,
2000+
text: Literal[False] | None = None,
20012001
encoding: None = None,
20022002
errors: None = None,
20032003
user: str | int | None = None,
@@ -2175,14 +2175,14 @@ class Popen(Generic[AnyStr]):
21752175
shell: bool = False,
21762176
cwd: StrOrBytesPath | None = None,
21772177
env: _ENV | None = None,
2178-
universal_newlines: Literal[False, None] = None,
2178+
universal_newlines: Literal[False] | None = None,
21792179
startupinfo: Any | None = None,
21802180
creationflags: int = 0,
21812181
restore_signals: bool = True,
21822182
start_new_session: bool = False,
21832183
pass_fds: Collection[int] = (),
21842184
*,
2185-
text: Literal[None, False] = None,
2185+
text: Literal[False] | None = None,
21862186
encoding: None = None,
21872187
errors: None = None,
21882188
user: str | int | None = None,
@@ -2354,14 +2354,14 @@ class Popen(Generic[AnyStr]):
23542354
shell: bool = False,
23552355
cwd: StrOrBytesPath | None = None,
23562356
env: _ENV | None = None,
2357-
universal_newlines: Literal[False, None] = None,
2357+
universal_newlines: Literal[False] | None = None,
23582358
startupinfo: Any | None = None,
23592359
creationflags: int = 0,
23602360
restore_signals: bool = True,
23612361
start_new_session: bool = False,
23622362
pass_fds: Collection[int] = (),
23632363
*,
2364-
text: Literal[None, False] = None,
2364+
text: Literal[False] | None = None,
23652365
encoding: None = None,
23662366
errors: None = None,
23672367
user: str | int | None = None,
@@ -2514,14 +2514,14 @@ class Popen(Generic[AnyStr]):
25142514
shell: bool = False,
25152515
cwd: StrOrBytesPath | None = None,
25162516
env: _ENV | None = None,
2517-
universal_newlines: Literal[False, None] = None,
2517+
universal_newlines: Literal[False] | None = None,
25182518
startupinfo: Any | None = None,
25192519
creationflags: int = 0,
25202520
restore_signals: bool = True,
25212521
start_new_session: bool = False,
25222522
pass_fds: Collection[int] = (),
25232523
*,
2524-
text: Literal[None, False] = None,
2524+
text: Literal[False] | None = None,
25252525
encoding: None = None,
25262526
errors: None = None,
25272527
) -> None: ...

stubs/Pillow/PIL/EpsImagePlugin.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ from .ImageFile import ImageFile
99
split: Incomplete
1010
field: Incomplete
1111
if sys.platform == "win32":
12-
gs_binary: Literal["gswin32c", "gswin64c", "gs", False, None]
13-
gs_windows_binary: Literal["gswin32c", "gswin64c", "gs", False, None]
12+
gs_binary: Literal["gswin32c", "gswin64c", "gs", False] | None
13+
gs_windows_binary: Literal["gswin32c", "gswin64c", "gs", False] | None
1414
else:
15-
gs_binary: Literal["gs", False, None]
15+
gs_binary: Literal["gs", False] | None
1616
gs_windows_binary: None
1717

1818
def has_ghostscript(): ...

stubs/fpdf2/fpdf/structure_tree.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from _typeshed import Incomplete, Unused
22
from collections import defaultdict
3-
from collections.abc import Generator, Iterable
3+
from collections.abc import Iterable, Iterator
44

55
from .encryption import StandardSecurityHandler
66
from .syntax import PDFArray, PDFObject, PDFString
@@ -45,4 +45,4 @@ class StructureTreeBuilder:
4545
) -> tuple[Incomplete, Incomplete]: ...
4646
def next_mcid_for_page(self, page_number: int) -> int: ...
4747
def empty(self) -> bool: ...
48-
def __iter__(self) -> Generator[Incomplete, None, None]: ...
48+
def __iter__(self) -> Iterator[Incomplete]: ...

stubs/openpyxl/openpyxl/cell/cell.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ TYPE_FORMULA_CACHE_STRING: Final = "str"
3232

3333
VALID_TYPES: Final[tuple[str, ...]]
3434

35-
def get_type(t: type, value: object) -> Literal["n", "s", "d", "f", None]: ...
35+
def get_type(t: type, value: object) -> Literal["n", "s", "d", "f"] | None: ...
3636
def get_time_format(t: _TimeTypes) -> str: ...
3737

3838
class Cell(StyleableObject):

stubs/pika/pika/adapters/twisted_connection.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ _T = TypeVar("_T")
1616

1717
LOGGER: Incomplete
1818

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

stubs/pyinstaller/PyInstaller/compat.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ALL_SUFFIXES: Final[list[str]]
4545

4646
architecture: Final[Literal["64bit", "n32bit", "32bit"]]
4747
system: Final[Literal["Cygwin", "Linux", "Darwin", "Java", "Windows"]]
48-
machine: Final[Literal["sw_64", "loongarch64", "arm", "intel", "ppc", "mips", "riscv", "s390x", "unknown", None]]
48+
machine: Final[Literal["sw_64", "loongarch64", "arm", "intel", "ppc", "mips", "riscv", "s390x", "unknown"] | None]
4949

5050
def is_wine_dll(filename: FileDescriptorOrPath) -> bool: ...
5151
@overload

stubs/pyinstaller/PyInstaller/depend/imphookapi.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ class PostGraphAPI:
6666
def add_binaries(self, binaries: TOC | Iterable[tuple[StrOrBytesPath, StrOrBytesPath]]) -> None: ...
6767
def add_datas(self, datas: TOC | Iterable[tuple[StrOrBytesPath, StrOrBytesPath]]) -> None: ...
6868
def set_module_collection_mode(
69-
self, name: str | None, mode: Literal["pyz", "pyc", "py", "pyz+py", "py+pyz", None]
69+
self, name: str | None, mode: Literal["pyz", "pyc", "py", "pyz+py", "py+pyz"] | None
7070
) -> None: ...

stubs/python-xlib/Xlib/support/unix_connect.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ from Xlib._typing import Unused
99

1010
if sys.platform == "darwin":
1111
SUPPORTED_PROTOCOLS: Final[tuple[None, Literal["tcp"], Literal["unix"], Literal["darwin"]]]
12-
_Protocol: TypeAlias = Literal[None, "tcp", "unix", "darwin"]
12+
_Protocol: TypeAlias = Literal["tcp", "unix", "darwin"] | None
1313
DARWIN_DISPLAY_RE: Final[Pattern[str]]
1414
else:
1515
SUPPORTED_PROTOCOLS: Final[tuple[None, Literal["tcp"], Literal["unix"]]]
16-
_Protocol: TypeAlias = Literal[None, "tcp", "unix"]
16+
_Protocol: TypeAlias = Literal["tcp", "unix"] | None
1717
uname: uname_result
1818
DISPLAY_RE: Final[Pattern[str]]
1919

stubs/pyxdg/xdg/IniFile.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,12 @@ class IniFile:
238238
list: bool = False,
239239
) -> None: ...
240240
def checkExtras(self) -> None: ...
241-
def checkBoolean(self, value: str) -> Literal[1, 2, None]: ...
242-
def checkNumber(self, value: str) -> Literal[1, 2, None]: ...
243-
def checkInteger(self, value: str) -> Literal[1, None]: ...
244-
def checkPoint(self, value: str) -> Literal[1, None]: ...
241+
def checkBoolean(self, value: str) -> Literal[1, 2] | None: ...
242+
def checkNumber(self, value: str) -> Literal[1, 2] | None: ...
243+
def checkInteger(self, value: str) -> Literal[1] | None: ...
244+
def checkPoint(self, value: str) -> Literal[1] | None: ...
245245
def checkString(self, value: str) -> Literal[0, 1]: ...
246-
def checkRegex(self, value: str) -> Literal[1, None]: ...
246+
def checkRegex(self, value: str) -> Literal[1] | None: ...
247247
def write(self, filename: str | None = None, trusted: bool = False) -> None: ...
248248
def set(self, key: str, value: str, group: str | None = None, locale: bool = False) -> None: ...
249249
def addGroup(self, group: str) -> None: ...

stubs/qrcode/qrcode/main.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from _typeshed import Incomplete
22
from typing import Generic, NamedTuple, TypeVar, overload
3-
from typing_extensions import Literal, TypeAlias
3+
from typing_extensions import TypeAlias
44

55
from qrcode.image.base import BaseImage
66

@@ -57,9 +57,9 @@ class QRCode(Generic[GenericImage]):
5757
def print_tty(self, out: Incomplete | None = None) -> None: ...
5858
def print_ascii(self, out: Incomplete | None = None, tty: bool = False, invert: bool = False): ...
5959
@overload
60-
def make_image(self, image_factory: Literal[None] = None, **kwargs) -> GenericImage: ...
60+
def make_image(self, image_factory: None = None, **kwargs) -> GenericImage: ...
6161
@overload
62-
def make_image(self, image_factory: type[GenericImageLocal] | None = None, **kwargs) -> GenericImageLocal: ...
62+
def make_image(self, image_factory: type[GenericImageLocal], **kwargs) -> GenericImageLocal: ...
6363
def is_constrained(self, row: int, col: int) -> bool: ...
6464
def setup_timing_pattern(self) -> None: ...
6565
def setup_position_adjust_pattern(self) -> None: ...

0 commit comments

Comments
 (0)