Drop Python 3.8 branches (#13776)

This commit is contained in:
Sebastian Rittau
2025-04-03 10:35:36 +02:00
committed by GitHub
parent 1e43190554
commit 30b16c168d
117 changed files with 1023 additions and 2639 deletions
+54 -589
View File
@@ -1,13 +1,10 @@
import sys
from _typeshed import MaybeNone, ReadableBuffer, StrOrBytesPath
from collections.abc import Callable, Collection, Iterable, Mapping, Sequence
from types import TracebackType
from types import GenericAlias, TracebackType
from typing import IO, Any, AnyStr, Final, Generic, Literal, TypeVar, overload
from typing_extensions import Self, TypeAlias
if sys.version_info >= (3, 9):
from types import GenericAlias
__all__ = [
"Popen",
"PIPE",
@@ -87,8 +84,7 @@ class CompletedProcess(Generic[_T]):
stderr: _T
def __init__(self, args: _CMD, returncode: int, stdout: _T | None = None, stderr: _T | None = None) -> None: ...
def check_returncode(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
if sys.version_info >= (3, 11):
# 3.11 adds "process_group" argument
@@ -500,7 +496,7 @@ elif sys.version_info >= (3, 10):
pipesize: int = -1,
) -> CompletedProcess[Any]: ...
elif sys.version_info >= (3, 9):
else:
# 3.9 adds arguments "user", "group", "extra_groups" and "umask"
@overload
def run(
@@ -696,177 +692,6 @@ elif sys.version_info >= (3, 9):
umask: int = -1,
) -> CompletedProcess[Any]: ...
else:
@overload
def run(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stdout: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
*,
capture_output: bool = False,
check: bool = False,
encoding: str | None = None,
errors: str | None = None,
input: str | None = None,
text: Literal[True],
timeout: float | None = None,
) -> CompletedProcess[str]: ...
@overload
def run(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stdout: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
*,
capture_output: bool = False,
check: bool = False,
encoding: str,
errors: str | None = None,
input: str | None = None,
text: bool | None = None,
timeout: float | None = None,
) -> CompletedProcess[str]: ...
@overload
def run(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stdout: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
*,
capture_output: bool = False,
check: bool = False,
encoding: str | None = None,
errors: str,
input: str | None = None,
text: bool | None = None,
timeout: float | None = None,
) -> CompletedProcess[str]: ...
@overload
def run(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stdout: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
*,
universal_newlines: Literal[True],
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
# where the *real* keyword only args start
capture_output: bool = False,
check: bool = False,
encoding: str | None = None,
errors: str | None = None,
input: str | None = None,
text: bool | None = None,
timeout: float | None = None,
) -> CompletedProcess[str]: ...
@overload
def run(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stdout: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
*,
capture_output: bool = False,
check: bool = False,
encoding: None = None,
errors: None = None,
input: ReadableBuffer | None = None,
text: Literal[False] | None = None,
timeout: float | None = None,
) -> CompletedProcess[bytes]: ...
@overload
def run(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stdout: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
*,
capture_output: bool = False,
check: bool = False,
encoding: str | None = None,
errors: str | None = None,
input: _InputString | None = None,
text: bool | None = None,
timeout: float | None = None,
) -> CompletedProcess[Any]: ...
# Same args as Popen.__init__
if sys.version_info >= (3, 11):
# 3.11 adds "process_group" argument
@@ -931,8 +756,7 @@ elif sys.version_info >= (3, 10):
pipesize: int = -1,
) -> int: ...
elif sys.version_info >= (3, 9):
# 3.9 adds arguments "user", "group", "extra_groups" and "umask"
else:
def call(
args: _CMD,
bufsize: int = -1,
@@ -961,31 +785,6 @@ elif sys.version_info >= (3, 9):
umask: int = -1,
) -> int: ...
else:
def call(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stdout: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
*,
encoding: str | None = None,
timeout: float | None = None,
text: bool | None = None,
) -> int: ...
# Same args as Popen.__init__
if sys.version_info >= (3, 11):
# 3.11 adds "process_group" argument
@@ -1050,8 +849,7 @@ elif sys.version_info >= (3, 10):
pipesize: int = -1,
) -> int: ...
elif sys.version_info >= (3, 9):
# 3.9 adds arguments "user", "group", "extra_groups" and "umask"
else:
def check_call(
args: _CMD,
bufsize: int = -1,
@@ -1080,31 +878,6 @@ elif sys.version_info >= (3, 9):
umask: int = -1,
) -> int: ...
else:
def check_call(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stdout: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
timeout: float | None = ...,
*,
encoding: str | None = None,
text: bool | None = None,
) -> int: ...
if sys.version_info >= (3, 11):
# 3.11 adds "process_group" argument
@overload
@@ -1479,184 +1252,6 @@ elif sys.version_info >= (3, 10):
pipesize: int = -1,
) -> Any: ... # morally: -> str | bytes
elif sys.version_info >= (3, 9):
# 3.9 adds arguments "user", "group", "extra_groups" and "umask"
@overload
def check_output(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
*,
timeout: float | None = None,
input: _InputString | None = ...,
encoding: str | None = None,
errors: str | None = None,
text: Literal[True],
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> str: ...
@overload
def check_output(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
*,
timeout: float | None = None,
input: _InputString | None = ...,
encoding: str,
errors: str | None = None,
text: bool | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> str: ...
@overload
def check_output(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
*,
timeout: float | None = None,
input: _InputString | None = ...,
encoding: str | None = None,
errors: str,
text: bool | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> str: ...
@overload
def check_output(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
*,
universal_newlines: Literal[True],
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
# where the real keyword only ones start
timeout: float | None = None,
input: _InputString | None = ...,
encoding: str | None = None,
errors: str | None = None,
text: bool | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> str: ...
@overload
def check_output(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: Literal[False] | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
*,
timeout: float | None = None,
input: _InputString | None = ...,
encoding: None = None,
errors: None = None,
text: Literal[False] | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> bytes: ...
@overload
def check_output(
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE = None,
stderr: _FILE = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = ...,
*,
timeout: float | None = None,
input: _InputString | None = ...,
encoding: str | None = None,
errors: str | None = None,
text: bool | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> Any: ... # morally: -> str | bytes
else:
@overload
def check_output(
@@ -1682,6 +1277,10 @@ else:
encoding: str | None = None,
errors: str | None = None,
text: Literal[True],
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> str: ...
@overload
def check_output(
@@ -1707,6 +1306,10 @@ else:
encoding: str,
errors: str | None = None,
text: bool | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> str: ...
@overload
def check_output(
@@ -1732,6 +1335,10 @@ else:
encoding: str | None = None,
errors: str,
text: bool | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> str: ...
@overload
def check_output(
@@ -1758,6 +1365,10 @@ else:
encoding: str | None = None,
errors: str | None = None,
text: bool | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> str: ...
@overload
def check_output(
@@ -1783,6 +1394,10 @@ else:
encoding: None = None,
errors: None = None,
text: Literal[False] | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> bytes: ...
@overload
def check_output(
@@ -1808,6 +1423,10 @@ else:
encoding: str | None = None,
errors: str | None = None,
text: bool | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> Any: ... # morally: -> str | bytes
PIPE: Final[int]
@@ -2223,183 +1842,6 @@ class Popen(Generic[AnyStr]):
umask: int = -1,
pipesize: int = -1,
) -> None: ...
elif sys.version_info >= (3, 9):
# user, group, extra_groups, umask were added in 3.9
@overload
def __init__(
self: Popen[str],
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE | None = None,
stdout: _FILE | None = None,
stderr: _FILE | None = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any | None = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
*,
text: bool | None = None,
encoding: str,
errors: str | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> None: ...
@overload
def __init__(
self: Popen[str],
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE | None = None,
stdout: _FILE | None = None,
stderr: _FILE | None = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any | None = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
*,
text: bool | None = None,
encoding: str | None = None,
errors: str,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> None: ...
@overload
def __init__(
self: Popen[str],
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE | None = None,
stdout: _FILE | None = None,
stderr: _FILE | None = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
*,
universal_newlines: Literal[True],
startupinfo: Any | None = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
# where the *real* keyword only args start
text: bool | None = None,
encoding: str | None = None,
errors: str | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> None: ...
@overload
def __init__(
self: Popen[str],
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE | None = None,
stdout: _FILE | None = None,
stderr: _FILE | None = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any | None = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
*,
text: Literal[True],
encoding: str | None = None,
errors: str | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> None: ...
@overload
def __init__(
self: Popen[bytes],
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE | None = None,
stdout: _FILE | None = None,
stderr: _FILE | None = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | 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[False] | None = None,
encoding: None = None,
errors: None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> None: ...
@overload
def __init__(
self: Popen[Any],
args: _CMD,
bufsize: int = -1,
executable: StrOrBytesPath | None = None,
stdin: _FILE | None = None,
stdout: _FILE | None = None,
stderr: _FILE | None = None,
preexec_fn: Callable[[], Any] | None = None,
close_fds: bool = True,
shell: bool = False,
cwd: StrOrBytesPath | None = None,
env: _ENV | None = None,
universal_newlines: bool | None = None,
startupinfo: Any | None = None,
creationflags: int = 0,
restore_signals: bool = True,
start_new_session: bool = False,
pass_fds: Collection[int] = (),
*,
text: bool | None = None,
encoding: str | None = None,
errors: str | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> None: ...
else:
@overload
def __init__(
@@ -2425,6 +1867,10 @@ class Popen(Generic[AnyStr]):
text: bool | None = None,
encoding: str,
errors: str | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> None: ...
@overload
def __init__(
@@ -2450,6 +1896,10 @@ class Popen(Generic[AnyStr]):
text: bool | None = None,
encoding: str | None = None,
errors: str,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> None: ...
@overload
def __init__(
@@ -2476,6 +1926,10 @@ class Popen(Generic[AnyStr]):
text: bool | None = None,
encoding: str | None = None,
errors: str | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> None: ...
@overload
def __init__(
@@ -2501,6 +1955,10 @@ class Popen(Generic[AnyStr]):
text: Literal[True],
encoding: str | None = None,
errors: str | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> None: ...
@overload
def __init__(
@@ -2526,6 +1984,10 @@ class Popen(Generic[AnyStr]):
text: Literal[False] | None = None,
encoding: None = None,
errors: None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> None: ...
@overload
def __init__(
@@ -2551,6 +2013,10 @@ class Popen(Generic[AnyStr]):
text: bool | None = None,
encoding: str | None = None,
errors: str | None = None,
user: str | int | None = None,
group: str | int | None = None,
extra_groups: Iterable[str | int] | None = None,
umask: int = -1,
) -> None: ...
def poll(self) -> int | None: ...
@@ -2567,8 +2033,7 @@ class Popen(Generic[AnyStr]):
self, exc_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def __del__(self) -> None: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
# The result really is always a str.
if sys.version_info >= (3, 11):