Skip to content

Try running stubdefaulter in CI #14621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/stubtest_stdlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 13 additions & 15 deletions stdlib/_hashlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions stdlib/distutils/file_util.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
12 changes: 5 additions & 7 deletions stdlib/gettext.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -130,7 +130,7 @@ else:
*,
class_: Callable[[io.BufferedReader], _NullTranslationsT],
fallback: Literal[False] = False,
codeset: str | None = None,
codeset: str = ...,
) -> _NullTranslationsT: ...
@overload
def translation(
Expand All @@ -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(
Expand All @@ -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: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/tkinter/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ...,
Expand Down
Loading