From ec196107e2270b7aa45549ca072726592ab4c9e5 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Mon, 10 Jun 2024 13:40:05 -0700 Subject: [PATCH] Updated typeshed stubs to the latest version (to pick up recent fix in `shutil.pyi`). --- .../typeshed-fallback/commit.txt | 2 +- .../typeshed-fallback/stdlib/ast.pyi | 3 +++ .../typeshed-fallback/stdlib/shutil.pyi | 16 ++++++++++++++-- .../typeshed-fallback/stdlib/types.pyi | 5 ++++- .../stubs/jsonschema/METADATA.toml | 2 ++ 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/packages/pyright-internal/typeshed-fallback/commit.txt b/packages/pyright-internal/typeshed-fallback/commit.txt index 24b4341b4..79f3d310a 100644 --- a/packages/pyright-internal/typeshed-fallback/commit.txt +++ b/packages/pyright-internal/typeshed-fallback/commit.txt @@ -1 +1 @@ -b3fc7e2cece78d1e81df2af0b718c1af0fd05871 +58f2a795bac5924367d21961af53a32af7bb5727 diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ast.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ast.pyi index 2525c3642..90ede461f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ast.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ast.pyi @@ -365,3 +365,6 @@ def walk(node: AST) -> Iterator[AST]: ... if sys.version_info >= (3, 9): def main() -> None: ... + +if sys.version_info >= (3, 14): + def compare(left: AST, right: AST, /, *, compare_attributes: bool = False) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/shutil.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/shutil.pyi index f6c8a390d..dcff18d11 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/shutil.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/shutil.pyi @@ -78,13 +78,25 @@ class _RmtreeType(Protocol): avoids_symlink_attacks: bool if sys.version_info >= (3, 12): @overload - @deprecated("The `onerror` parameter is deprecated and will be removed in Python 3.14. Use `onexc` instead.") + @deprecated("The `onerror` parameter is deprecated. Use `onexc` instead.") + def __call__( + self, + path: StrOrBytesPath, + ignore_errors: bool, + onerror: _OnErrorCallback, + *, + onexc: None = None, + dir_fd: int | None = None, + ) -> None: ... + @overload + @deprecated("The `onerror` parameter is deprecated. Use `onexc` instead.") def __call__( self, path: StrOrBytesPath, ignore_errors: bool = False, - onerror: _OnErrorCallback | None = None, *, + onerror: _OnErrorCallback, + onexc: None = None, dir_fd: int | None = None, ) -> None: ... @overload diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/types.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/types.pyi index 54465339c..9e9dc56b8 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/types.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/types.pyi @@ -81,7 +81,7 @@ class FunctionType: __name__: str __qualname__: str __annotations__: dict[str, Any] - __kwdefaults__: dict[str, Any] + __kwdefaults__: dict[str, Any] | None if sys.version_info >= (3, 10): @property def __builtins__(self) -> dict[str, Any]: ... @@ -591,6 +591,9 @@ if sys.version_info >= (3, 9): def __unpacked__(self) -> bool: ... @property def __typing_unpacked_tuple_args__(self) -> tuple[Any, ...] | None: ... + if sys.version_info >= (3, 10): + def __or__(self, value: Any, /) -> UnionType: ... + def __ror__(self, value: Any, /) -> UnionType: ... # GenericAlias delegates attr access to `__origin__` def __getattr__(self, name: str) -> Any: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml index 872dfc95d..a523ab6cb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/jsonschema/METADATA.toml @@ -6,3 +6,5 @@ partial_stub = true [tool.stubtest] ignore_missing_stub = true extras = ["format"] +# see https://github.com/python/typeshed/issues/12107 for the reason for the pin +stubtest_requirements = ["webcolors<24.6.0"]