diff --git a/.github/workflows/stubtest_stdlib.yml b/.github/workflows/stubtest_stdlib.yml index 2a574584ff08..62385f54168c 100644 --- a/.github/workflows/stubtest_stdlib.yml +++ b/.github/workflows/stubtest_stdlib.yml @@ -46,5 +46,9 @@ jobs: check-latest: true - name: Install dependencies run: pip install -r requirements-tests.txt + - name: Install stubdefaulter + run: pip install git+https://github.com/JelleZijlstra/stubdefaulter.git@d861cce40b1734c262d05dee2c1bf32358878103 + - name: Run stubdefaulter + run: stubdefaulter --stdlib stdlib - name: Run stubtest run: python tests/stubtest_stdlib.py diff --git a/requirements-tests.txt b/requirements-tests.txt index 8fe57cf3624a..1b95fb467b8f 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -17,7 +17,6 @@ pre-commit # Required by create_baseline_stubs.py. Must match .pre-commit-config.yaml. ruff==0.12.2 # 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; python_version < "3.11" tomlkit==0.13.3 diff --git a/stdlib/_hashlib.pyi b/stdlib/_hashlib.pyi index 8b7ef52cdffd..2254226566ef 100644 --- a/stdlib/_hashlib.pyi +++ b/stdlib/_hashlib.pyi @@ -63,43 +63,41 @@ def hmac_new(key: bytes | bytearray, msg: ReadableBuffer = b"", digestmod: _Dige if sys.version_info >= (3, 13): def new( - name: str, data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None - ) -> HASH: ... - def openssl_md5( - data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None + name: str, data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"" ) -> HASH: ... + def openssl_md5(data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"") -> HASH: ... def openssl_sha1( - data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None + data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"" ) -> HASH: ... def openssl_sha224( - data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None + data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"" ) -> HASH: ... def openssl_sha256( - data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None + data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"" ) -> HASH: ... def openssl_sha384( - data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None + data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"" ) -> HASH: ... def openssl_sha512( - data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None + data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"" ) -> HASH: ... def openssl_sha3_224( - data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None + data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"" ) -> HASH: ... def openssl_sha3_256( - data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None + data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"" ) -> HASH: ... def openssl_sha3_384( - data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None + data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"" ) -> HASH: ... def openssl_sha3_512( - data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None + data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"" ) -> HASH: ... def openssl_shake_128( - data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None + data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"" ) -> HASHXOF: ... def openssl_shake_256( - data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = None + data: ReadableBuffer = b"", *, usedforsecurity: bool = True, string: ReadableBuffer | None = b"" ) -> HASHXOF: ... else: diff --git a/stdlib/distutils/file_util.pyi b/stdlib/distutils/file_util.pyi index 873d23ea7e50..c763f91a958d 100644 --- a/stdlib/distutils/file_util.pyi +++ b/stdlib/distutils/file_util.pyi @@ -29,10 +29,10 @@ def copy_file( ) -> tuple[_BytesPathT | bytes, bool]: ... @overload def move_file( - src: StrPath, dst: _StrPathT, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0 + src: StrPath, dst: _StrPathT, verbose: bool | Literal[0, 1] = 1, dry_run: bool | Literal[0, 1] = 0 ) -> _StrPathT | str: ... @overload def move_file( - src: BytesPath, dst: _BytesPathT, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0 + src: BytesPath, dst: _BytesPathT, verbose: bool | Literal[0, 1] = 1, dry_run: bool | Literal[0, 1] = 0 ) -> _BytesPathT | bytes: ... def write_file(filename: StrOrBytesPath, contents: Iterable[str]) -> None: ... diff --git a/stdlib/gettext.pyi b/stdlib/gettext.pyi index 937aece03437..2997ffc6c930 100644 --- a/stdlib/gettext.pyi +++ b/stdlib/gettext.pyi @@ -120,7 +120,7 @@ else: languages: Iterable[str] | None = None, class_: None = None, fallback: Literal[False] = False, - codeset: str | None = None, + codeset: str = ..., ) -> GNUTranslations: ... @overload def translation( @@ -130,7 +130,7 @@ else: *, class_: Callable[[io.BufferedReader], _NullTranslationsT], fallback: Literal[False] = False, - codeset: str | None = None, + codeset: str = ..., ) -> _NullTranslationsT: ... @overload def translation( @@ -139,7 +139,7 @@ else: languages: Iterable[str] | None, class_: Callable[[io.BufferedReader], _NullTranslationsT], fallback: Literal[False] = False, - codeset: str | None = None, + codeset: str = ..., ) -> _NullTranslationsT: ... @overload def translation( @@ -148,12 +148,10 @@ else: languages: Iterable[str] | None = None, class_: Callable[[io.BufferedReader], NullTranslations] | None = None, fallback: bool = False, - codeset: str | None = None, + codeset: str = ..., ) -> NullTranslations: ... @overload - def install( - domain: str, localedir: StrPath | None = None, codeset: None = None, names: Container[str] | None = None - ) -> None: ... + def install(domain: str, localedir: StrPath | None = None, names: Container[str] | None = None) -> None: ... @overload @deprecated("The `codeset` parameter is deprecated since Python 3.8; removed in Python 3.11.") def install(domain: str, localedir: StrPath | None, codeset: str, /, names: Container[str] | None = None) -> None: ... diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index 060f8ad2dbd6..3467f86cc5ee 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -3475,7 +3475,7 @@ class Text(Widget, XView, YView): def image_configure( self, index: _TextIndex, - cnf: dict[str, Any] | None = {}, + cnf: dict[str, Any] | None = None, *, align: Literal["baseline", "bottom", "center", "top"] = ..., image: _ImageSpec = ...,