diff --git a/packages/pyright-internal/typeshed-fallback/commit.txt b/packages/pyright-internal/typeshed-fallback/commit.txt index 0f5926abb1b3..255e06eab0d2 100644 --- a/packages/pyright-internal/typeshed-fallback/commit.txt +++ b/packages/pyright-internal/typeshed-fallback/commit.txt @@ -1 +1 @@ -a7ff1be4394cef089dd62090a2e2ad10cc77cfe6 +9d6fc1dafdf9d27a9ea87e210ff6e287d00a61d5 diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_ast.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_ast.pyi index 5431f31cd2ae..1dbceac428c1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_ast.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_ast.pyi @@ -1,7 +1,7 @@ import sys import typing_extensions from typing import Any, ClassVar, Generic, Literal, TypedDict, overload -from typing_extensions import Unpack +from typing_extensions import Self, Unpack PyCF_ONLY_AST: Literal[1024] PyCF_TYPE_COMMENTS: Literal[4096] @@ -34,6 +34,9 @@ class AST: if sys.version_info >= (3, 13): _field_types: ClassVar[dict[str, Any]] + if sys.version_info >= (3, 14): + def __replace__(self) -> Self: ... + class mod(AST): ... class type_ignore(AST): ... @@ -44,6 +47,9 @@ class TypeIgnore(type_ignore): tag: str def __init__(self, lineno: int, tag: str) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, lineno: int = ..., tag: str = ...) -> Self: ... + class FunctionType(mod): if sys.version_info >= (3, 10): __match_args__ = ("argtypes", "returns") @@ -57,6 +63,9 @@ class FunctionType(mod): else: def __init__(self, argtypes: list[expr], returns: expr) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, argtypes: list[expr] = ..., returns: expr = ...) -> Self: ... + class Module(mod): if sys.version_info >= (3, 10): __match_args__ = ("body", "type_ignores") @@ -67,6 +76,9 @@ class Module(mod): else: def __init__(self, body: list[stmt], type_ignores: list[TypeIgnore]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, body: list[stmt] = ..., type_ignores: list[TypeIgnore] = ...) -> Self: ... + class Interactive(mod): if sys.version_info >= (3, 10): __match_args__ = ("body",) @@ -76,12 +88,18 @@ class Interactive(mod): else: def __init__(self, body: list[stmt]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, body: list[stmt] = ...) -> Self: ... + class Expression(mod): if sys.version_info >= (3, 10): __match_args__ = ("body",) body: expr def __init__(self, body: expr) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, body: expr = ...) -> Self: ... + class stmt(AST): lineno: int col_offset: int @@ -89,6 +107,9 @@ class stmt(AST): end_col_offset: int | None def __init__(self, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, **kwargs: Unpack[_Attributes]) -> Self: ... + class FunctionDef(stmt): if sys.version_info >= (3, 12): __match_args__ = ("name", "args", "body", "decorator_list", "returns", "type_comment", "type_params") @@ -152,6 +173,19 @@ class FunctionDef(stmt): **kwargs: Unpack[_Attributes], ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + name: _Identifier = ..., + args: arguments = ..., + body: list[stmt] = ..., + decorator_list: list[expr] = ..., + returns: expr | None = ..., + type_comment: str | None = ..., + type_params: list[type_param] = ..., + ) -> Self: ... + class AsyncFunctionDef(stmt): if sys.version_info >= (3, 12): __match_args__ = ("name", "args", "body", "decorator_list", "returns", "type_comment", "type_params") @@ -215,6 +249,19 @@ class AsyncFunctionDef(stmt): **kwargs: Unpack[_Attributes], ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + name: _Identifier = ..., + args: arguments = ..., + body: list[stmt], + decorator_list: list[expr], + returns: expr | None, + type_comment: str | None, + type_params: list[type_param], + ) -> Self: ... + class ClassDef(stmt): if sys.version_info >= (3, 12): __match_args__ = ("name", "bases", "keywords", "body", "decorator_list", "type_params") @@ -260,12 +307,28 @@ class ClassDef(stmt): **kwargs: Unpack[_Attributes], ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + name: _Identifier, + bases: list[expr], + keywords: list[keyword], + body: list[stmt], + decorator_list: list[expr], + type_params: list[type_param], + **kwargs: Unpack[_Attributes], + ) -> Self: ... + class Return(stmt): if sys.version_info >= (3, 10): __match_args__ = ("value",) value: expr | None def __init__(self, value: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, value: expr | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class Delete(stmt): if sys.version_info >= (3, 10): __match_args__ = ("targets",) @@ -275,6 +338,9 @@ class Delete(stmt): else: def __init__(self, targets: list[expr], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, targets: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class Assign(stmt): if sys.version_info >= (3, 10): __match_args__ = ("targets", "value", "type_comment") @@ -295,6 +361,11 @@ class Assign(stmt): self, targets: list[expr], value: expr, type_comment: str | None = None, **kwargs: Unpack[_Attributes] ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, targets: list[expr] = ..., value: expr = ..., type_comment: str | None = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class AugAssign(stmt): if sys.version_info >= (3, 10): __match_args__ = ("target", "op", "value") @@ -305,6 +376,16 @@ class AugAssign(stmt): self, target: Name | Attribute | Subscript, op: operator, value: expr, **kwargs: Unpack[_Attributes] ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + target: Name | Attribute | Subscript = ..., + op: operator = ..., + value: expr = ..., + **kwargs: Unpack[_Attributes], + ) -> Self: ... + class AnnAssign(stmt): if sys.version_info >= (3, 10): __match_args__ = ("target", "annotation", "value", "simple") @@ -332,6 +413,17 @@ class AnnAssign(stmt): **kwargs: Unpack[_Attributes], ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + target: Name | Attribute | Subscript = ..., + annotation: expr = ..., + value: expr | None = ..., + simple: int = ..., + **kwargs: Unpack[_Attributes], + ) -> Self: ... + class For(stmt): if sys.version_info >= (3, 10): __match_args__ = ("target", "iter", "body", "orelse", "type_comment") @@ -361,6 +453,18 @@ class For(stmt): **kwargs: Unpack[_Attributes], ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + target: expr = ..., + iter: expr = ..., + body: list[stmt] = ..., + orelse: list[stmt] = ..., + type_comment: str | None = ..., + **kwargs: Unpack[_Attributes], + ) -> Self: ... + class AsyncFor(stmt): if sys.version_info >= (3, 10): __match_args__ = ("target", "iter", "body", "orelse", "type_comment") @@ -390,6 +494,18 @@ class AsyncFor(stmt): **kwargs: Unpack[_Attributes], ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + target: expr = ..., + iter: expr = ..., + body: list[stmt] = ..., + orelse: list[stmt] = ..., + type_comment: str | None = ..., + **kwargs: Unpack[_Attributes], + ) -> Self: ... + class While(stmt): if sys.version_info >= (3, 10): __match_args__ = ("test", "body", "orelse") @@ -403,6 +519,9 @@ class While(stmt): else: def __init__(self, test: expr, body: list[stmt], orelse: list[stmt], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, test: expr, body: list[stmt], orelse: list[stmt], **kwargs: Unpack[_Attributes]) -> Self: ... + class If(stmt): if sys.version_info >= (3, 10): __match_args__ = ("test", "body", "orelse") @@ -416,6 +535,11 @@ class If(stmt): else: def __init__(self, test: expr, body: list[stmt], orelse: list[stmt], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, test: expr = ..., body: list[stmt] = ..., orelse: list[stmt] = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class With(stmt): if sys.version_info >= (3, 10): __match_args__ = ("items", "body", "type_comment") @@ -435,6 +559,16 @@ class With(stmt): self, items: list[withitem], body: list[stmt], type_comment: str | None = None, **kwargs: Unpack[_Attributes] ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + items: list[withitem] = ..., + body: list[stmt] = ..., + type_comment: str | None = ..., + **kwargs: Unpack[_Attributes], + ) -> Self: ... + class AsyncWith(stmt): if sys.version_info >= (3, 10): __match_args__ = ("items", "body", "type_comment") @@ -454,6 +588,16 @@ class AsyncWith(stmt): self, items: list[withitem], body: list[stmt], type_comment: str | None = None, **kwargs: Unpack[_Attributes] ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + items: list[withitem] = ..., + body: list[stmt] = ..., + type_comment: str | None = ..., + **kwargs: Unpack[_Attributes], + ) -> Self: ... + class Raise(stmt): if sys.version_info >= (3, 10): __match_args__ = ("exc", "cause") @@ -461,6 +605,9 @@ class Raise(stmt): cause: expr | None def __init__(self, exc: expr | None = None, cause: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, exc: expr | None = ..., cause: expr | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class Try(stmt): if sys.version_info >= (3, 10): __match_args__ = ("body", "handlers", "orelse", "finalbody") @@ -487,6 +634,17 @@ class Try(stmt): **kwargs: Unpack[_Attributes], ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + body: list[stmt] = ..., + handlers: list[ExceptHandler] = ..., + orelse: list[stmt] = ..., + finalbody: list[stmt] = ..., + **kwargs: Unpack[_Attributes], + ) -> Self: ... + if sys.version_info >= (3, 11): class TryStar(stmt): __match_args__ = ("body", "handlers", "orelse", "finalbody") @@ -513,6 +671,17 @@ if sys.version_info >= (3, 11): **kwargs: Unpack[_Attributes], ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + body: list[stmt] = ..., + handlers: list[ExceptHandler] = ..., + orelse: list[stmt] = ..., + finalbody: list[stmt] = ..., + **kwargs: Unpack[_Attributes], + ) -> Self: ... + class Assert(stmt): if sys.version_info >= (3, 10): __match_args__ = ("test", "msg") @@ -520,6 +689,9 @@ class Assert(stmt): msg: expr | None def __init__(self, test: expr, msg: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, test: expr, msg: expr | None, **kwargs: Unpack[_Attributes]) -> Self: ... + class Import(stmt): if sys.version_info >= (3, 10): __match_args__ = ("names",) @@ -529,6 +701,9 @@ class Import(stmt): else: def __init__(self, names: list[alias], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, names: list[alias] = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class ImportFrom(stmt): if sys.version_info >= (3, 10): __match_args__ = ("module", "names", "level") @@ -550,6 +725,11 @@ class ImportFrom(stmt): self, module: str | None = None, *, names: list[alias], level: int, **kwargs: Unpack[_Attributes] ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, module: str | None = ..., names: list[alias] = ..., level: int = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class Global(stmt): if sys.version_info >= (3, 10): __match_args__ = ("names",) @@ -559,6 +739,9 @@ class Global(stmt): else: def __init__(self, names: list[_Identifier], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, names: list[_Identifier], **kwargs: Unpack[_Attributes]) -> Self: ... + class Nonlocal(stmt): if sys.version_info >= (3, 10): __match_args__ = ("names",) @@ -568,12 +751,18 @@ class Nonlocal(stmt): else: def __init__(self, names: list[_Identifier], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, names: list[_Identifier] = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class Expr(stmt): if sys.version_info >= (3, 10): __match_args__ = ("value",) value: expr def __init__(self, value: expr, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class Pass(stmt): ... class Break(stmt): ... class Continue(stmt): ... @@ -585,6 +774,9 @@ class expr(AST): end_col_offset: int | None def __init__(self, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, **kwargs: Unpack[_Attributes]) -> Self: ... + class BoolOp(expr): if sys.version_info >= (3, 10): __match_args__ = ("op", "values") @@ -595,6 +787,9 @@ class BoolOp(expr): else: def __init__(self, op: boolop, values: list[expr], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, op: boolop = ..., values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class BinOp(expr): if sys.version_info >= (3, 10): __match_args__ = ("left", "op", "right") @@ -603,6 +798,11 @@ class BinOp(expr): right: expr def __init__(self, left: expr, op: operator, right: expr, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, left: expr = ..., op: operator = ..., right: expr = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class UnaryOp(expr): if sys.version_info >= (3, 10): __match_args__ = ("op", "operand") @@ -610,6 +810,9 @@ class UnaryOp(expr): operand: expr def __init__(self, op: unaryop, operand: expr, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, op: unaryop = ..., operand: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class Lambda(expr): if sys.version_info >= (3, 10): __match_args__ = ("args", "body") @@ -617,6 +820,9 @@ class Lambda(expr): body: expr def __init__(self, args: arguments, body: expr, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, args: arguments = ..., body: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class IfExp(expr): if sys.version_info >= (3, 10): __match_args__ = ("test", "body", "orelse") @@ -625,6 +831,11 @@ class IfExp(expr): orelse: expr def __init__(self, test: expr, body: expr, orelse: expr, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, test: expr = ..., body: expr = ..., orelse: expr = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class Dict(expr): if sys.version_info >= (3, 10): __match_args__ = ("keys", "values") @@ -635,6 +846,11 @@ class Dict(expr): else: def __init__(self, keys: list[expr | None], values: list[expr], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, keys: list[expr | None] = ..., values: list[expr] = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class Set(expr): if sys.version_info >= (3, 10): __match_args__ = ("elts",) @@ -644,6 +860,9 @@ class Set(expr): else: def __init__(self, elts: list[expr], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, elts: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class ListComp(expr): if sys.version_info >= (3, 10): __match_args__ = ("elt", "generators") @@ -654,6 +873,11 @@ class ListComp(expr): else: def __init__(self, elt: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, elt: expr = ..., generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class SetComp(expr): if sys.version_info >= (3, 10): __match_args__ = ("elt", "generators") @@ -664,6 +888,11 @@ class SetComp(expr): else: def __init__(self, elt: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, elt: expr = ..., generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class DictComp(expr): if sys.version_info >= (3, 10): __match_args__ = ("key", "value", "generators") @@ -677,6 +906,11 @@ class DictComp(expr): else: def __init__(self, key: expr, value: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, key: expr = ..., value: expr = ..., generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class GeneratorExp(expr): if sys.version_info >= (3, 10): __match_args__ = ("elt", "generators") @@ -687,24 +921,38 @@ class GeneratorExp(expr): else: def __init__(self, elt: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, elt: expr = ..., generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class Await(expr): if sys.version_info >= (3, 10): __match_args__ = ("value",) value: expr def __init__(self, value: expr, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class Yield(expr): if sys.version_info >= (3, 10): __match_args__ = ("value",) value: expr | None def __init__(self, value: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, value: expr | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class YieldFrom(expr): if sys.version_info >= (3, 10): __match_args__ = ("value",) value: expr def __init__(self, value: expr, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class Compare(expr): if sys.version_info >= (3, 10): __match_args__ = ("left", "ops", "comparators") @@ -718,6 +966,11 @@ class Compare(expr): else: def __init__(self, left: expr, ops: list[cmpop], comparators: list[expr], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, left: expr = ..., ops: list[cmpop] = ..., comparators: list[expr] = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class Call(expr): if sys.version_info >= (3, 10): __match_args__ = ("func", "args", "keywords") @@ -731,6 +984,11 @@ class Call(expr): else: def __init__(self, func: expr, args: list[expr], keywords: list[keyword], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, func: expr = ..., args: list[expr] = ..., keywords: list[keyword] = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class FormattedValue(expr): if sys.version_info >= (3, 10): __match_args__ = ("value", "conversion", "format_spec") @@ -739,6 +997,11 @@ class FormattedValue(expr): format_spec: expr | None def __init__(self, value: expr, conversion: int, format_spec: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, value: expr = ..., conversion: int = ..., format_spec: expr | None = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class JoinedStr(expr): if sys.version_info >= (3, 10): __match_args__ = ("values",) @@ -748,6 +1011,9 @@ class JoinedStr(expr): else: def __init__(self, values: list[expr], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class Constant(expr): if sys.version_info >= (3, 10): __match_args__ = ("value", "kind") @@ -760,6 +1026,9 @@ class Constant(expr): def __init__(self, value: Any, kind: str | None = None, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, value: Any = ..., kind: str | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class NamedExpr(expr): if sys.version_info >= (3, 10): __match_args__ = ("target", "value") @@ -767,6 +1036,9 @@ class NamedExpr(expr): value: expr def __init__(self, target: Name, value: expr, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, target: Name = ..., value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class Attribute(expr): if sys.version_info >= (3, 10): __match_args__ = ("value", "attr", "ctx") @@ -775,6 +1047,11 @@ class Attribute(expr): ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__` def __init__(self, value: expr, attr: _Identifier, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, value: expr = ..., attr: _Identifier = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + if sys.version_info >= (3, 9): _Slice: typing_extensions.TypeAlias = expr _SliceAttributes: typing_extensions.TypeAlias = _Attributes @@ -794,6 +1071,16 @@ class Slice(_Slice): self, lower: expr | None = None, upper: expr | None = None, step: expr | None = None, **kwargs: Unpack[_SliceAttributes] ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + lower: expr | None = ..., + upper: expr | None = ..., + step: expr | None = ..., + **kwargs: Unpack[_SliceAttributes], + ) -> Self: ... + if sys.version_info < (3, 9): class ExtSlice(slice): dims: list[slice] @@ -811,6 +1098,11 @@ class Subscript(expr): ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__` def __init__(self, value: expr, slice: _Slice, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, value: expr = ..., slice: _Slice = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class Starred(expr): if sys.version_info >= (3, 10): __match_args__ = ("value", "ctx") @@ -818,6 +1110,9 @@ class Starred(expr): ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__` def __init__(self, value: expr, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, value: expr = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class Name(expr): if sys.version_info >= (3, 10): __match_args__ = ("id", "ctx") @@ -825,6 +1120,9 @@ class Name(expr): ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__` def __init__(self, id: _Identifier, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, id: _Identifier = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class List(expr): if sys.version_info >= (3, 10): __match_args__ = ("elts", "ctx") @@ -835,6 +1133,9 @@ class List(expr): else: def __init__(self, elts: list[expr], ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, elts: list[expr] = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class Tuple(expr): if sys.version_info >= (3, 10): __match_args__ = ("elts", "ctx") @@ -847,6 +1148,9 @@ class Tuple(expr): else: def __init__(self, elts: list[expr], ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, elts: list[expr] = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class expr_context(AST): ... if sys.version_info < (3, 9): @@ -910,6 +1214,9 @@ class comprehension(AST): else: def __init__(self, target: expr, iter: expr, ifs: list[expr], is_async: int) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, target: expr = ..., iter: expr = ..., ifs: list[expr] = ..., is_async: int = ...) -> Self: ... + class excepthandler(AST): lineno: int col_offset: int @@ -917,6 +1224,11 @@ class excepthandler(AST): end_col_offset: int | None def __init__(self, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, lineno: int = ..., col_offset: int = ..., end_lineno: int | None = ..., end_col_offset: int | None = ... + ) -> Self: ... + class ExceptHandler(excepthandler): if sys.version_info >= (3, 10): __match_args__ = ("type", "name", "body") @@ -937,6 +1249,16 @@ class ExceptHandler(excepthandler): self, type: expr | None = None, name: _Identifier | None = None, *, body: list[stmt], **kwargs: Unpack[_Attributes] ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + type: expr | None = ..., + name: _Identifier | None = ..., + body: list[stmt] = ..., + **kwargs: Unpack[_Attributes], + ) -> Self: ... + class arguments(AST): if sys.version_info >= (3, 10): __match_args__ = ("posonlyargs", "args", "vararg", "kwonlyargs", "kw_defaults", "kwarg", "defaults") @@ -995,6 +1317,19 @@ class arguments(AST): defaults: list[expr], ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + posonlyargs: list[arg] = ..., + args: list[arg] = ..., + vararg: arg | None = ..., + kwonlyargs: list[arg] = ..., + kw_defaults: list[expr | None] = ..., + kwarg: arg | None = ..., + defaults: list[expr] = ..., + ) -> Self: ... + class arg(AST): lineno: int col_offset: int @@ -1009,6 +1344,16 @@ class arg(AST): self, arg: _Identifier, annotation: expr | None = None, type_comment: str | None = None, **kwargs: Unpack[_Attributes] ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + arg: _Identifier = ..., + annotation: expr | None = ..., + type_comment: str | None = ..., + **kwargs: Unpack[_Attributes], + ) -> Self: ... + class keyword(AST): lineno: int col_offset: int @@ -1023,6 +1368,9 @@ class keyword(AST): @overload def __init__(self, arg: _Identifier | None = None, *, value: expr, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, arg: _Identifier | None = ..., value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class alias(AST): lineno: int col_offset: int @@ -1034,6 +1382,9 @@ class alias(AST): asname: _Identifier | None def __init__(self, name: str, asname: _Identifier | None = None, **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, name: str = ..., asname: _Identifier | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ... + class withitem(AST): if sys.version_info >= (3, 10): __match_args__ = ("context_expr", "optional_vars") @@ -1041,6 +1392,9 @@ class withitem(AST): optional_vars: expr | None def __init__(self, context_expr: expr, optional_vars: expr | None = None) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, context_expr: expr = ..., optional_vars: expr | None = ...) -> Self: ... + if sys.version_info >= (3, 10): class Match(stmt): __match_args__ = ("subject", "cases") @@ -1051,6 +1405,11 @@ if sys.version_info >= (3, 10): else: def __init__(self, subject: expr, cases: list[match_case], **kwargs: Unpack[_Attributes]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, subject: expr = ..., cases: list[match_case] = ..., **kwargs: Unpack[_Attributes] + ) -> Self: ... + class pattern(AST): lineno: int col_offset: int @@ -1058,6 +1417,11 @@ if sys.version_info >= (3, 10): end_col_offset: int def __init__(self, **kwargs: Unpack[_Attributes[int]]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, lineno: int = ..., col_offset: int = ..., end_lineno: int = ..., end_col_offset: int = ... + ) -> Self: ... + # Without the alias, Pyright complains variables named pattern are recursively defined _Pattern: typing_extensions.TypeAlias = pattern @@ -1074,16 +1438,25 @@ if sys.version_info >= (3, 10): @overload def __init__(self, pattern: _Pattern, guard: expr | None = None, *, body: list[stmt]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, pattern: _Pattern = ..., guard: expr | None = ..., body: list[stmt] = ...) -> Self: ... + class MatchValue(pattern): __match_args__ = ("value",) value: expr def __init__(self, value: expr, **kwargs: Unpack[_Attributes[int]]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, value: expr = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ... + class MatchSingleton(pattern): __match_args__ = ("value",) value: Literal[True, False] | None def __init__(self, value: Literal[True, False] | None, **kwargs: Unpack[_Attributes[int]]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, value: Literal[True, False] | None = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ... + class MatchSequence(pattern): __match_args__ = ("patterns",) patterns: list[pattern] @@ -1092,11 +1465,17 @@ if sys.version_info >= (3, 10): else: def __init__(self, patterns: list[pattern], **kwargs: Unpack[_Attributes[int]]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, patterns: list[pattern] = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ... + class MatchStar(pattern): __match_args__ = ("name",) name: _Identifier | None def __init__(self, name: _Identifier | None, **kwargs: Unpack[_Attributes[int]]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, name: _Identifier | None = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ... + class MatchMapping(pattern): __match_args__ = ("keys", "patterns", "rest") keys: list[expr] @@ -1119,6 +1498,16 @@ if sys.version_info >= (3, 10): **kwargs: Unpack[_Attributes[int]], ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + keys: list[expr] = ..., + patterns: list[pattern] = ..., + rest: _Identifier | None = ..., + **kwargs: Unpack[_Attributes[int]], + ) -> Self: ... + class MatchClass(pattern): __match_args__ = ("cls", "patterns", "kwd_attrs", "kwd_patterns") cls: expr @@ -1144,6 +1533,17 @@ if sys.version_info >= (3, 10): **kwargs: Unpack[_Attributes[int]], ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + cls: expr = ..., + patterns: list[pattern] = ..., + kwd_attrs: list[_Identifier] = ..., + kwd_patterns: list[pattern] = ..., + **kwargs: Unpack[_Attributes[int]], + ) -> Self: ... + class MatchAs(pattern): __match_args__ = ("pattern", "name") pattern: _Pattern | None @@ -1152,6 +1552,11 @@ if sys.version_info >= (3, 10): self, pattern: _Pattern | None = None, name: _Identifier | None = None, **kwargs: Unpack[_Attributes[int]] ) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, pattern: _Pattern | None = ..., name: _Identifier | None = ..., **kwargs: Unpack[_Attributes[int]] + ) -> Self: ... + class MatchOr(pattern): __match_args__ = ("patterns",) patterns: list[pattern] @@ -1160,6 +1565,9 @@ if sys.version_info >= (3, 10): else: def __init__(self, patterns: list[pattern], **kwargs: Unpack[_Attributes[int]]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, *, patterns: list[pattern] = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ... + if sys.version_info >= (3, 12): class type_param(AST): lineno: int @@ -1168,6 +1576,9 @@ if sys.version_info >= (3, 12): end_col_offset: int def __init__(self, **kwargs: Unpack[_Attributes[int]]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__(self, **kwargs: Unpack[_Attributes[int]]) -> Self: ... + class TypeVar(type_param): if sys.version_info >= (3, 13): __match_args__ = ("name", "bound", "default_value") @@ -1187,6 +1598,16 @@ if sys.version_info >= (3, 12): else: def __init__(self, name: _Identifier, bound: expr | None = None, **kwargs: Unpack[_Attributes[int]]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + name: _Identifier = ..., + bound: expr | None = ..., + default_value: expr | None = ..., + **kwargs: Unpack[_Attributes[int]], + ) -> Self: ... + class ParamSpec(type_param): if sys.version_info >= (3, 13): __match_args__ = ("name", "default_value") @@ -1201,6 +1622,11 @@ if sys.version_info >= (3, 12): else: def __init__(self, name: _Identifier, **kwargs: Unpack[_Attributes[int]]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, name: _Identifier = ..., default_value: expr | None = ..., **kwargs: Unpack[_Attributes[int]] + ) -> Self: ... + class TypeVarTuple(type_param): if sys.version_info >= (3, 13): __match_args__ = ("name", "default_value") @@ -1215,6 +1641,11 @@ if sys.version_info >= (3, 12): else: def __init__(self, name: _Identifier, **kwargs: Unpack[_Attributes[int]]) -> None: ... + if sys.version_info >= (3, 14): + def __replace__( + self, *, name: _Identifier = ..., default_value: expr | None = ..., **kwargs: Unpack[_Attributes[int]] + ) -> Self: ... + class TypeAlias(stmt): __match_args__ = ("name", "type_params", "value") name: Name @@ -1233,3 +1664,13 @@ if sys.version_info >= (3, 12): def __init__( self, name: Name, type_params: list[type_param], value: expr, **kwargs: Unpack[_Attributes[int]] ) -> None: ... + + if sys.version_info >= (3, 14): + def __replace__( + self, + *, + name: Name = ..., + type_params: list[type_param] = ..., + value: expr = ..., + **kwargs: Unpack[_Attributes[int]], + ) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_curses.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_curses.pyi index 505637574af1..b68c8925a041 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_curses.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_curses.pyi @@ -493,7 +493,7 @@ class _CursesWindow: def instr(self, y: int, x: int, n: int = ...) -> bytes: ... def is_linetouched(self, line: int, /) -> bool: ... def is_wintouched(self) -> bool: ... - def keypad(self, yes: bool) -> None: ... + def keypad(self, yes: bool, /) -> None: ... def leaveok(self, yes: bool) -> None: ... def move(self, new_y: int, new_x: int) -> None: ... def mvderwin(self, y: int, x: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_locale.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_locale.pyi index 0825e12034f4..ccce7a0d9d70 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_locale.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_locale.pyi @@ -1,17 +1,38 @@ import sys from _typeshed import StrPath -from collections.abc import Mapping +from typing import Final, Literal, TypedDict, type_check_only -LC_CTYPE: int -LC_COLLATE: int -LC_TIME: int -LC_MONETARY: int -LC_NUMERIC: int -LC_ALL: int -CHAR_MAX: int +@type_check_only +class _LocaleConv(TypedDict): + decimal_point: str + grouping: list[int] + thousands_sep: str + int_curr_symbol: str + currency_symbol: str + p_cs_precedes: Literal[0, 1, 127] + n_cs_precedes: Literal[0, 1, 127] + p_sep_by_space: Literal[0, 1, 127] + n_sep_by_space: Literal[0, 1, 127] + mon_decimal_point: str + frac_digits: int + int_frac_digits: int + mon_thousands_sep: str + mon_grouping: list[int] + positive_sign: str + negative_sign: str + p_sign_posn: Literal[0, 1, 2, 3, 4, 127] + n_sign_posn: Literal[0, 1, 2, 3, 4, 127] + +LC_CTYPE: Final[int] +LC_COLLATE: Final[int] +LC_TIME: Final[int] +LC_MONETARY: Final[int] +LC_NUMERIC: Final[int] +LC_ALL: Final[int] +CHAR_MAX: Final = 127 def setlocale(category: int, locale: str | None = None, /) -> str: ... -def localeconv() -> Mapping[str, int | str | list[int]]: ... +def localeconv() -> _LocaleConv: ... if sys.version_info >= (3, 11): def getencoding() -> str: ... @@ -25,67 +46,67 @@ def strxfrm(string: str, /) -> str: ... if sys.platform != "win32": LC_MESSAGES: int - ABDAY_1: int - ABDAY_2: int - ABDAY_3: int - ABDAY_4: int - ABDAY_5: int - ABDAY_6: int - ABDAY_7: int + ABDAY_1: Final[int] + ABDAY_2: Final[int] + ABDAY_3: Final[int] + ABDAY_4: Final[int] + ABDAY_5: Final[int] + ABDAY_6: Final[int] + ABDAY_7: Final[int] - ABMON_1: int - ABMON_2: int - ABMON_3: int - ABMON_4: int - ABMON_5: int - ABMON_6: int - ABMON_7: int - ABMON_8: int - ABMON_9: int - ABMON_10: int - ABMON_11: int - ABMON_12: int + ABMON_1: Final[int] + ABMON_2: Final[int] + ABMON_3: Final[int] + ABMON_4: Final[int] + ABMON_5: Final[int] + ABMON_6: Final[int] + ABMON_7: Final[int] + ABMON_8: Final[int] + ABMON_9: Final[int] + ABMON_10: Final[int] + ABMON_11: Final[int] + ABMON_12: Final[int] - DAY_1: int - DAY_2: int - DAY_3: int - DAY_4: int - DAY_5: int - DAY_6: int - DAY_7: int + DAY_1: Final[int] + DAY_2: Final[int] + DAY_3: Final[int] + DAY_4: Final[int] + DAY_5: Final[int] + DAY_6: Final[int] + DAY_7: Final[int] - ERA: int - ERA_D_T_FMT: int - ERA_D_FMT: int - ERA_T_FMT: int + ERA: Final[int] + ERA_D_T_FMT: Final[int] + ERA_D_FMT: Final[int] + ERA_T_FMT: Final[int] - MON_1: int - MON_2: int - MON_3: int - MON_4: int - MON_5: int - MON_6: int - MON_7: int - MON_8: int - MON_9: int - MON_10: int - MON_11: int - MON_12: int + MON_1: Final[int] + MON_2: Final[int] + MON_3: Final[int] + MON_4: Final[int] + MON_5: Final[int] + MON_6: Final[int] + MON_7: Final[int] + MON_8: Final[int] + MON_9: Final[int] + MON_10: Final[int] + MON_11: Final[int] + MON_12: Final[int] - CODESET: int - D_T_FMT: int - D_FMT: int - T_FMT: int - T_FMT_AMPM: int - AM_STR: int - PM_STR: int + CODESET: Final[int] + D_T_FMT: Final[int] + D_FMT: Final[int] + T_FMT: Final[int] + T_FMT_AMPM: Final[int] + AM_STR: Final[int] + PM_STR: Final[int] - RADIXCHAR: int - THOUSEP: int - YESEXPR: int - NOEXPR: int - CRNCYSTR: int - ALT_DIGITS: int + RADIXCHAR: Final[int] + THOUSEP: Final[int] + YESEXPR: Final[int] + NOEXPR: Final[int] + CRNCYSTR: Final[int] + ALT_DIGITS: Final[int] def nl_langinfo(key: int, /) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/_thread.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/_thread.pyi index 304cb79ec96b..b75e7608fa77 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/_thread.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/_thread.pyi @@ -1,3 +1,4 @@ +import signal import sys from _typeshed import structseq from collections.abc import Callable @@ -16,16 +17,39 @@ class LockType: def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ... def release(self) -> None: ... def locked(self) -> bool: ... + def acquire_lock(self, blocking: bool = True, timeout: float = -1) -> bool: ... + def release_lock(self) -> None: ... + def locked_lock(self) -> bool: ... def __enter__(self) -> bool: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None ) -> None: ... +if sys.version_info >= (3, 13): + @final + class _ThreadHandle: + ident: int + + def join(self, timeout: float | None = None, /) -> None: ... + def is_done(self) -> bool: ... + def _set_done(self) -> None: ... + + def start_joinable_thread( + function: Callable[[], object], handle: _ThreadHandle | None = None, daemon: bool = True + ) -> _ThreadHandle: ... + lock = LockType + @overload def start_new_thread(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpack[_Ts]], /) -> int: ... @overload def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any], /) -> int: ... -def interrupt_main() -> None: ... + +if sys.version_info >= (3, 10): + def interrupt_main(signum: signal.Signals = ..., /) -> None: ... + +else: + def interrupt_main() -> None: ... + def exit() -> NoReturn: ... def allocate_lock() -> LockType: ... def get_ident() -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi index 95335d241ea1..f70e3d6db1b1 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/builtins.pyi @@ -1,3 +1,4 @@ +# ruff: noqa: PYI036 # This is the module declaring BaseException import _ast import _typeshed import sys @@ -968,7 +969,9 @@ class tuple(Sequence[_T_co]): if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... -# Doesn't exist at runtime, but deleting this breaks mypy. See #2999 +# Doesn't exist at runtime, but deleting this breaks mypy and pyright. See: +# https://github.com/python/typeshed/issues/7580 +# https://github.com/python/mypy/issues/8240 @final @type_check_only class function: diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi index 9bc098dbc6d7..a41df9752d33 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/codecs.pyi @@ -80,7 +80,7 @@ class _Encoder(Protocol): def __call__(self, input: str, errors: str = ..., /) -> tuple[bytes, int]: ... # signature of Codec().encode class _Decoder(Protocol): - def __call__(self, input: bytes, errors: str = ..., /) -> tuple[str, int]: ... # signature of Codec().decode + def __call__(self, input: ReadableBuffer, errors: str = ..., /) -> tuple[str, int]: ... # signature of Codec().decode class _StreamReader(Protocol): def __call__(self, stream: _ReadableStream, errors: str = ..., /) -> StreamReader: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/collections/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/collections/__init__.pyi index 9097287cea3d..b2ed53e4427e 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/collections/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/collections/__init__.pyi @@ -345,15 +345,15 @@ class _OrderedDictValuesView(ValuesView[_VT_co], Reversible[_VT_co]): # but they are not exposed anywhere) # pyright doesn't have a specific error code for subclassing error! @final -class _odict_keys(dict_keys[_KT_co, _VT_co], Reversible[_KT_co]): # type: ignore[misc] # pyright: ignore +class _odict_keys(dict_keys[_KT_co, _VT_co], Reversible[_KT_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] def __reversed__(self) -> Iterator[_KT_co]: ... @final -class _odict_items(dict_items[_KT_co, _VT_co], Reversible[tuple[_KT_co, _VT_co]]): # type: ignore[misc] # pyright: ignore +class _odict_items(dict_items[_KT_co, _VT_co], Reversible[tuple[_KT_co, _VT_co]]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ... @final -class _odict_values(dict_values[_KT_co, _VT_co], Reversible[_VT_co], Generic[_KT_co, _VT_co]): # type: ignore[misc] # pyright: ignore +class _odict_values(dict_values[_KT_co, _VT_co], Reversible[_VT_co], Generic[_KT_co, _VT_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] def __reversed__(self) -> Iterator[_VT_co]: ... class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/ctypes/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/ctypes/__init__.pyi index dfd61c8f8ffc..40a073d107c7 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/ctypes/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/ctypes/__init__.pyi @@ -185,3 +185,8 @@ if sys.version_info >= (3, 12): c_time_t: type[c_int32 | c_int64] # alias for one or the other at runtime class py_object(_CanCastTo, _SimpleCData[_T]): ... + +if sys.version_info >= (3, 14): + class c_float_complex(_SimpleCData[complex]): ... + class c_double_complex(_SimpleCData[complex]): ... + class c_longdouble_complex(_SimpleCData[complex]): ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/dataclasses.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/dataclasses.pyi index f93797583a83..3295b1c1f835 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/dataclasses.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/dataclasses.pyi @@ -229,18 +229,17 @@ if sys.version_info >= (3, 9): else: class _InitVarMeta(type): # Not used, instead `InitVar.__class_getitem__` is called. - # pyright ignore is needed because pyright (not unreasonably) thinks this - # is an invalid use of InitVar. - def __getitem__(self, params: Any) -> InitVar[Any]: ... # pyright: ignore + # pyright (not unreasonably) thinks this is an invalid use of InitVar. + def __getitem__(self, params: Any) -> InitVar[Any]: ... # pyright: ignore[reportInvalidTypeForm] class InitVar(Generic[_T], metaclass=_InitVarMeta): type: Type[_T] def __init__(self, type: Type[_T]) -> None: ... if sys.version_info >= (3, 9): @overload - def __class_getitem__(cls, type: Type[_T]) -> InitVar[_T]: ... # pyright: ignore + def __class_getitem__(cls, type: Type[_T]) -> InitVar[_T]: ... # pyright: ignore[reportInvalidTypeForm] @overload - def __class_getitem__(cls, type: Any) -> InitVar[Any]: ... # pyright: ignore + def __class_getitem__(cls, type: Any) -> InitVar[Any]: ... # pyright: ignore[reportInvalidTypeForm] if sys.version_info >= (3, 12): def make_dataclass( diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/cmd.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/cmd.pyi index 1f3f31c9c48a..dcb423a49b09 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/cmd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/cmd.pyi @@ -30,6 +30,7 @@ _CommandT = TypeVar("_CommandT", bound=Command) _Ts = TypeVarTuple("_Ts") class Command: + dry_run: Literal[0, 1] # Exposed from __getattr_. Same as Distribution.dry_run distribution: Distribution # Any to work around variance issues sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dist.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dist.pyi index e32fd70f7baa..75fc7dbb388d 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/distutils/dist.pyi @@ -88,9 +88,9 @@ class Distribution: display_options: ClassVar[_OptionsList] display_option_names: ClassVar[list[str]] negative_opt: ClassVar[dict[str, str]] - verbose: int - dry_run: int - help: int + verbose: Literal[0, 1] + dry_run: Literal[0, 1] + help: Literal[0, 1] command_packages: list[str] | None script_name: str | None script_args: list[str] | None @@ -270,7 +270,7 @@ class Distribution: def has_data_files(self) -> bool: ... def is_pure(self) -> bool: ... - # Getter methods generated in __init__ + # Default getter methods generated in __init__ from self.metadata._METHOD_BASENAMES def get_name(self) -> str: ... def get_version(self) -> str: ... def get_fullname(self) -> str: ... @@ -292,3 +292,26 @@ class Distribution: def get_requires(self) -> list[str]: ... def get_provides(self) -> list[str]: ... def get_obsoletes(self) -> list[str]: ... + + # Default attributes generated in __init__ from self.display_option_names + help_commands: bool | Literal[0] + name: str | Literal[0] + version: str | Literal[0] + fullname: str | Literal[0] + author: str | Literal[0] + author_email: str | Literal[0] + maintainer: str | Literal[0] + maintainer_email: str | Literal[0] + contact: str | Literal[0] + contact_email: str | Literal[0] + url: str | Literal[0] + license: str | Literal[0] + licence: str | Literal[0] + description: str | Literal[0] + long_description: str | Literal[0] + platforms: str | list[str] | Literal[0] + classifiers: str | list[str] | Literal[0] + keywords: str | list[str] | Literal[0] + provides: list[str] | Literal[0] + requires: list[str] | Literal[0] + obsoletes: list[str] | Literal[0] diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/doctest.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/doctest.pyi index 7e334ef0c504..4380083027a6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/doctest.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/doctest.pyi @@ -1,9 +1,10 @@ +import sys import types import unittest from _typeshed import ExcInfo from collections.abc import Callable -from typing import Any, NamedTuple -from typing_extensions import TypeAlias +from typing import Any, ClassVar, NamedTuple +from typing_extensions import Self, TypeAlias __all__ = [ "register_optionflag", @@ -41,9 +42,22 @@ __all__ = [ "debug", ] -class TestResults(NamedTuple): - failed: int - attempted: int +# MyPy errors on conditionals within named tuples. + +if sys.version_info >= (3, 13): + class TestResults(NamedTuple): + def __new__(cls, failed: int, attempted: int, *, skipped: int = 0) -> Self: ... # type: ignore[misc] + skipped: int + failed: int + attempted: int + _fields: ClassVar = ("failed", "attempted") # type: ignore[misc] + __match_args__ = ("failed", "attempted") # type: ignore[misc] + __doc__: None # type: ignore[misc] + +else: + class TestResults(NamedTuple): + failed: int + attempted: int OPTIONFLAGS_BY_NAME: dict[str, int] @@ -134,6 +148,8 @@ class DocTestRunner: original_optionflags: int tries: int failures: int + if sys.version_info >= (3, 13): + skips: int test: DocTest def __init__(self, checker: OutputChecker | None = None, verbose: bool | None = None, optionflags: int = 0) -> None: ... def report_start(self, out: _Out, test: DocTest, example: Example) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/email/message.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/email/message.pyi index e5b46fbf8e6f..7e80f13adb8f 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/email/message.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/email/message.pyi @@ -147,7 +147,11 @@ class Message(Generic[_HeaderT, _HeaderParamT]): class MIMEPart(Message[_HeaderRegistryT, _HeaderRegistryParamT]): def __init__(self, policy: Policy | None = None) -> None: ... def get_body(self, preferencelist: Sequence[str] = ("related", "html", "plain")) -> MIMEPart[_HeaderRegistryT] | None: ... - def iter_attachments(self) -> Iterator[MIMEPart[_HeaderRegistryT]]: ... + def attach(self, payload: Self) -> None: ... # type: ignore[override] + # The attachments are created via type(self) in the attach method. It's theoretically + # possible to sneak other attachment types into a MIMEPart instance, but could cause + # cause unforseen consequences. + def iter_attachments(self) -> Iterator[Self]: ... def iter_parts(self) -> Iterator[MIMEPart[_HeaderRegistryT]]: ... def get_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> Any: ... def set_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/io.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/io.pyi index 2d64d261951d..7607608696dd 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/io.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/io.pyi @@ -84,7 +84,6 @@ class RawIOBase(IOBase): def read(self, size: int = -1, /) -> bytes | None: ... class BufferedIOBase(IOBase): - raw: RawIOBase # This is not part of the BufferedIOBase API and may not exist on some implementations. def detach(self) -> RawIOBase: ... def readinto(self, buffer: WriteableBuffer, /) -> int: ... def write(self, buffer: ReadableBuffer, /) -> int: ... @@ -119,11 +118,13 @@ class BytesIO(BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible d def read1(self, size: int | None = -1, /) -> bytes: ... class BufferedReader(BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes + raw: RawIOBase def __enter__(self) -> Self: ... def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... def peek(self, size: int = 0, /) -> bytes: ... class BufferedWriter(BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of writelines in the base classes + raw: RawIOBase def __enter__(self) -> Self: ... def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... def write(self, buffer: ReadableBuffer, /) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/socketserver.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/socketserver.pyi index 5753d1d661b9..ae6575d85082 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/socketserver.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/socketserver.pyi @@ -3,8 +3,9 @@ import types from _socket import _Address, _RetAddress from _typeshed import ReadableBuffer from collections.abc import Callable +from io import BufferedIOBase from socket import socket as _socket -from typing import Any, BinaryIO, ClassVar +from typing import Any, ClassVar from typing_extensions import Self, TypeAlias __all__ = [ @@ -158,11 +159,11 @@ class StreamRequestHandler(BaseRequestHandler): timeout: ClassVar[float | None] # undocumented disable_nagle_algorithm: ClassVar[bool] # undocumented connection: Any # undocumented - rfile: BinaryIO - wfile: BinaryIO + rfile: BufferedIOBase + wfile: BufferedIOBase class DatagramRequestHandler(BaseRequestHandler): - packet: _socket # undocumented + packet: bytes # undocumented socket: _socket # undocumented - rfile: BinaryIO - wfile: BinaryIO + rfile: BufferedIOBase + wfile: BufferedIOBase diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tempfile.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tempfile.pyi index 62422b84eb37..0c19d56fc7a6 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tempfile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tempfile.pyi @@ -253,11 +253,11 @@ class _TemporaryFileWrapper(IO[AnyStr]): def truncate(self, size: int | None = ...) -> int: ... def writable(self) -> bool: ... @overload - def write(self: _TemporaryFileWrapper[str], s: str) -> int: ... + def write(self: _TemporaryFileWrapper[str], s: str, /) -> int: ... @overload - def write(self: _TemporaryFileWrapper[bytes], s: ReadableBuffer) -> int: ... + def write(self: _TemporaryFileWrapper[bytes], s: ReadableBuffer, /) -> int: ... @overload - def write(self, s: AnyStr) -> int: ... + def write(self, s: AnyStr, /) -> int: ... @overload def writelines(self: _TemporaryFileWrapper[str], lines: Iterable[str]) -> None: ... @overload diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/typing.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/typing.pyi index f6fb00e4b280..cadd06358d4a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/typing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/typing.pyi @@ -2,7 +2,7 @@ # ruff: noqa: F811 # TODO: The collections import is required, otherwise mypy crashes. # https://github.com/python/mypy/issues/16744 -import collections # noqa: F401 # pyright: ignore +import collections # noqa: F401 # pyright: ignore[reportUnusedImport] import sys import typing_extensions from _collections_abc import dict_items, dict_keys, dict_values @@ -800,18 +800,12 @@ class IO(Iterator[AnyStr]): def writable(self) -> bool: ... @abstractmethod @overload - def write(self: IO[str], s: str, /) -> int: ... - @abstractmethod - @overload def write(self: IO[bytes], s: ReadableBuffer, /) -> int: ... @abstractmethod @overload def write(self, s: AnyStr, /) -> int: ... @abstractmethod @overload - def writelines(self: IO[str], lines: Iterable[str], /) -> None: ... - @abstractmethod - @overload def writelines(self: IO[bytes], lines: Iterable[ReadableBuffer], /) -> None: ... @abstractmethod @overload diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/runner.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/runner.pyi index 0033083ac406..46da85619d30 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/unittest/runner.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/unittest/runner.pyi @@ -2,36 +2,52 @@ import sys import unittest.case import unittest.result import unittest.suite -from _typeshed import Incomplete +from _typeshed import SupportsFlush, SupportsWrite from collections.abc import Callable, Iterable -from typing import TextIO -from typing_extensions import TypeAlias +from typing import Any, Generic, Protocol, TypeVar +from typing_extensions import Never, TypeAlias -_ResultClassType: TypeAlias = Callable[[TextIO, bool, int], unittest.result.TestResult] +_ResultClassType: TypeAlias = Callable[[_TextTestStream, bool, int], TextTestResult] -class TextTestResult(unittest.result.TestResult): +class _SupportsWriteAndFlush(SupportsWrite[str], SupportsFlush, Protocol): ... + +# All methods used by unittest.runner.TextTestResult's stream +class _TextTestStream(_SupportsWriteAndFlush, Protocol): + def writeln(self, arg: str | None = None) -> str: ... + +# _WritelnDecorator should have all the same attrs as its stream param. +# But that's not feasible to do Generically +# We can expand the attributes if requested +class _WritelnDecorator(_TextTestStream): + def __init__(self, stream: _TextTestStream) -> None: ... + def __getattr__(self, attr: str) -> Any: ... # Any attribute from the stream type passed to __init__ + # These attributes are prevented by __getattr__ + stream: Never + __getstate__: Never + +_StreamT = TypeVar("_StreamT", bound=_TextTestStream, default=_WritelnDecorator) + +class TextTestResult(unittest.result.TestResult, Generic[_StreamT]): descriptions: bool # undocumented dots: bool # undocumented separator1: str separator2: str showAll: bool # undocumented - stream: TextIO # undocumented + stream: _StreamT # undocumented if sys.version_info >= (3, 12): durations: unittest.result._DurationsType | None def __init__( - self, stream: TextIO, descriptions: bool, verbosity: int, *, durations: unittest.result._DurationsType | None = None + self, stream: _StreamT, descriptions: bool, verbosity: int, *, durations: unittest.result._DurationsType | None = None ) -> None: ... else: - def __init__(self, stream: TextIO, descriptions: bool, verbosity: int) -> None: ... + def __init__(self, stream: _StreamT, descriptions: bool, verbosity: int) -> None: ... def getDescription(self, test: unittest.case.TestCase) -> str: ... def printErrorList(self, flavour: str, errors: Iterable[tuple[unittest.case.TestCase, str]]) -> None: ... class TextTestRunner: resultclass: _ResultClassType - # TODO: add `_WritelnDecorator` type - # stream: _WritelnDecorator - stream: Incomplete + stream: _WritelnDecorator descriptions: bool verbosity: int failfast: bool @@ -43,7 +59,7 @@ class TextTestRunner: durations: unittest.result._DurationsType | None def __init__( self, - stream: TextIO | None = None, + stream: _SupportsWriteAndFlush | None = None, descriptions: bool = True, verbosity: int = 1, failfast: bool = False, @@ -57,7 +73,7 @@ class TextTestRunner: else: def __init__( self, - stream: TextIO | None = None, + stream: _SupportsWriteAndFlush | None = None, descriptions: bool = True, verbosity: int = 1, failfast: bool = False, @@ -68,5 +84,5 @@ class TextTestRunner: tb_locals: bool = False, ) -> None: ... - def _makeResult(self) -> unittest.result.TestResult: ... - def run(self, test: unittest.suite.TestSuite | unittest.case.TestCase) -> unittest.result.TestResult: ... + def _makeResult(self) -> TextTestResult: ... + def run(self, test: unittest.suite.TestSuite | unittest.case.TestCase) -> TextTestResult: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/METADATA.toml index 268976f68c44..0d7c47f44a07 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/METADATA.toml @@ -1,4 +1,4 @@ -version = "4.0.*" +version = "5.0.*" upstream_repository = "https://github.com/corydolphin/flask-cors" # Requires a version of flask with a `py.typed` file requires = ["Flask>=2.0.0"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/flask_cors/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/flask_cors/core.pyi index c34cc49d6849..8dbdc6828e7f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/flask_cors/core.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Flask-Cors/flask_cors/core.pyi @@ -2,7 +2,7 @@ from collections.abc import Iterable from datetime import timedelta from logging import Logger from re import Pattern -from typing import Any, Literal, TypedDict, TypeVar, overload +from typing import Any, Final, Literal, TypedDict, TypeVar, overload from typing_extensions import TypeAlias import flask @@ -26,19 +26,22 @@ class _Options(TypedDict, total=False): always_send: bool | None LOG: Logger -ACL_ORIGIN: str -ACL_METHODS: str -ACL_ALLOW_HEADERS: str -ACL_EXPOSE_HEADERS: str -ACL_CREDENTIALS: str -ACL_MAX_AGE: str -ACL_REQUEST_METHOD: str -ACL_REQUEST_HEADERS: str -ALL_METHODS: list[str] -CONFIG_OPTIONS: list[str] -FLASK_CORS_EVALUATED: str -RegexObject: type[Pattern[str]] -DEFAULT_OPTIONS: _Options + +ACL_ORIGIN: Final = "Access-Control-Allow-Origin" +ACL_METHODS: Final = "Access-Control-Allow-Methods" +ACL_ALLOW_HEADERS: Final = "Access-Control-Allow-Headers" +ACL_EXPOSE_HEADERS: Final = "Access-Control-Expose-Headers" +ACL_CREDENTIALS: Final = "Access-Control-Allow-Credentials" +ACL_MAX_AGE: Final = "Access-Control-Max-Age" +ACL_RESPONSE_PRIVATE_NETWORK: Final = "Access-Control-Allow-Private-Network" +ACL_REQUEST_METHOD: Final = "Access-Control-Request-Method" +ACL_REQUEST_HEADERS: Final = "Access-Control-Request-Headers" +ACL_REQUEST_HEADER_PRIVATE_NETWORK: Final = "Access-Control-Request-Private-Network" +ALL_METHODS: Final[list[str]] +CONFIG_OPTIONS: Final[list[str]] +FLASK_CORS_EVALUATED: Final = "_FLASK_CORS_EVALUATED" +RegexObject: Final[type[Pattern[str]]] +DEFAULT_OPTIONS: Final[_Options] def parse_resources(resources: dict[str, _Options] | Iterable[str] | str | Pattern[str]) -> list[tuple[str, _Options]]: ... def get_regexp_pattern(regexp: str | Pattern[str]) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/jack/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/jack/__init__.pyi index 6a4740ca5a2f..4f8d61bd4de0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/jack/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/JACK-Client/jack/__init__.pyi @@ -12,7 +12,7 @@ from numpy.typing import NDArray # Actual type: _cffi_backend.__CDataOwn # This is not a real subclassing. Just ensuring type-checkers sees this type as compatible with _CDataBase # pyright has no error code for subclassing final -class _JackPositionT(_CDataBase): # type: ignore[misc] # pyright: ignore +class _JackPositionT(_CDataBase): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] audio_frames_per_video_frame: float bar: int bar_start_tick: float diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/__init__.pyi new file mode 100644 index 000000000000..9c7fe6b35466 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/__init__.pyi @@ -0,0 +1,3 @@ +from .gpio import * + +VERSION: str = ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio.pyi new file mode 100644 index 000000000000..6a00a2b5a011 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio.pyi @@ -0,0 +1,63 @@ +from collections.abc import Callable, Sequence +from typing import Final, Literal + +BOARD: Final = 10 +BCM: Final = 11 +TEGRA_SOC: Final = 1000 +CVM: Final = 1001 + +PUD_OFF: Final = 20 +PUD_DOWN: Final = 21 +PUD_UP: Final = 22 + +HIGH: Final = 1 +LOW: Final = 0 + +RISING: Final = 31 +FALLING: Final = 32 +BOTH: Final = 33 + +UNKNOWN: Final = -1 +OUT: Final = 0 +IN: Final = 1 +HARD_PWM: Final = 43 + +model = ... +JETSON_INFO = ... +RPI_INFO = ... + +def setwarnings(state: bool) -> None: ... +def setmode(mode: Literal[10, 11, 1000, 1001]) -> None: ... +def getmode() -> Literal[10, 11, 1000, 1001]: ... +def setup( + channels: int | Sequence[int], + direction: Literal[0, 1], + pull_up_down: Literal[20, 21, 22] = ..., + initial: Literal[0, 1] = ..., + consumer: str = ..., +) -> None: ... +def cleanup(channel: int | Sequence[int] | None = ...) -> None: ... +def input(channel: int) -> Literal[0, 1]: ... +def output(channels: int | Sequence[int], values: Literal[0, 1]) -> None: ... +def add_event_detect( + channel: int, + edge: Literal[31, 32, 33], + callback: Callable[[int], None] | None = ..., + bouncetime: int | None = ..., + polltime: float = ..., +) -> None: ... +def remove_event_detect(channel: int, timeout: float = ...) -> None: ... +def event_detected(channel: int) -> bool: ... +def add_event_callback(channel: int, callback: Callable[[int], None]) -> None: ... +def wait_for_edge( + channel: int, edge: Literal[31, 32, 33], bouncetime: int | None = ..., timeout: float | None = ... +) -> int | None: ... +def gpio_function(channel: int) -> Literal[-1, 0, 1]: ... + +class PWM: + def __init__(self, channel: int, frequency_hz: float) -> None: ... + def __del__(self) -> None: ... + def start(self, duty_cycle_percent: float) -> None: ... + def ChangeFrequency(self, frequency_hz: float) -> None: ... + def ChangeDutyCycle(self, duty_cycle_percent: float) -> None: ... + def stop(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_cdev.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_cdev.pyi new file mode 100644 index 000000000000..463fc462e6a7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_cdev.pyi @@ -0,0 +1,72 @@ +import ctypes +from typing import Final, Literal + +from .gpio_pin_data import ChannelInfo + +GPIO_HIGH: Final = 1 + +GPIOHANDLE_REQUEST_INPUT: Final = 0x1 +GPIOHANDLE_REQUEST_OUTPUT: Final = 0x2 + +GPIOEVENT_REQUEST_RISING_EDGE: Final = 0x1 +GPIOEVENT_REQUEST_FALLING_EDGE: Final = 0x2 +GPIOEVENT_REQUEST_BOTH_EDGES: Final = 0x3 + +GPIO_GET_CHIPINFO_IOCTL: Final = 0x8044B401 +GPIO_GET_LINEINFO_IOCTL: Final = 0xC048B402 +GPIO_GET_LINEHANDLE_IOCTL: Final = 0xC16CB403 +GPIOHANDLE_GET_LINE_VALUES_IOCTL: Final = 0xC040B408 +GPIOHANDLE_SET_LINE_VALUES_IOCTL: Final = 0xC040B409 +GPIO_GET_LINEEVENT_IOCTL: Final = 0xC030B404 + +class gpiochip_info(ctypes.Structure): + name: str + label: str + lines: int + +class gpiohandle_request(ctypes.Structure): + lineoffsets: list[int] + flags: int + default_values: list[int] + consumer_label: str + lines: int + fd: int + +class gpiohandle_data(ctypes.Structure): + values: list[int] + +class gpioline_info(ctypes.Structure): + line_offset: int + flags: int + name: str + consumer: str + +class gpioline_info_changed(ctypes.Structure): + line_info: gpioline_info + timestamp: int + event_type: int + padding: list[int] + +class gpioevent_request(ctypes.Structure): + lineoffset: int + handleflags: int + eventflags: int + consumer_label: str + fd: int + +class gpioevent_data(ctypes.Structure): + timestamp: int + id: int + +class GPIOError(IOError): ... + +def chip_open(gpio_chip: str) -> int: ... +def chip_check_info(label: str, gpio_device: str) -> int | None: ... +def chip_open_by_label(label: str) -> int: ... +def close_chip(chip_fd: int) -> None: ... +def open_line(ch_info: ChannelInfo, request: int) -> None: ... +def close_line(line_handle: int) -> None: ... +def request_handle(line_offset: int, direction: Literal[0, 1], initial: Literal[0, 1], consumer: str) -> gpiohandle_request: ... +def request_event(line_offset: int, edge: int, consumer: str) -> gpioevent_request: ... +def get_value(line_handle: int) -> int: ... +def set_value(line_handle: int, value: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi new file mode 100644 index 000000000000..1f456f9c2c46 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi @@ -0,0 +1,17 @@ +from collections.abc import Callable +from typing import Any, Final, Literal + +NO_EDGE: Final = 0 +RISING_EDGE: Final = 1 +FALLING_EDGE: Final = 2 +BOTH_EDGE: Final = 3 + +def add_edge_detect( + chip_fd: int, chip_name: str, channel: int, request: int, bouncetime: int, poll_time: float +) -> Literal[1, 2, 0]: ... +def remove_edge_detect(chip_name: str, channel: int, timeout: float = ...) -> None: ... +def add_edge_callback(chip_name: str, channel: int, callback: Callable[[int], None]) -> None: ... +def edge_event_detected(chip_name: str, channel: int) -> bool: ... +def gpio_event_added(chip_name: str, channel: int) -> Any: ... +def blocking_wait_for_edge(chip_fd: int, chip_name: str, channel: int, request: int, bouncetime: int, timeout: float) -> int: ... +def event_cleanup(chip_name: str, channel: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_pin_data.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_pin_data.pyi new file mode 100644 index 000000000000..e46b4cf906a5 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/GPIO/gpio_pin_data.pyi @@ -0,0 +1,58 @@ +from collections.abc import Sequence +from typing import Any, Final + +CLARA_AGX_XAVIER: Final = "CLARA_AGX_XAVIER" +JETSON_NX: Final = "JETSON_NX" +JETSON_XAVIER: Final = "JETSON_XAVIER" +JETSON_TX2: Final = "JETSON_TX2" +JETSON_TX1: Final = "JETSON_TX1" +JETSON_NANO: Final = "JETSON_NANO" +JETSON_TX2_NX: Final = "JETSON_TX2_NX" +JETSON_ORIN: Final = "JETSON_ORIN" +JETSON_ORIN_NX: Final = "JETSON_ORIN_NX" +JETSON_ORIN_NANO: Final = "JETSON_ORIN_NANO" + +JETSON_MODELS: list[str] = ... + +JETSON_ORIN_NX_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None]] = ... +compats_jetson_orins_nx: Sequence[str] = ... +compats_jetson_orins_nano: Sequence[str] = ... + +JETSON_ORIN_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None]] = ... +compats_jetson_orins: Sequence[str] = ... + +CLARA_AGX_XAVIER_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None]] = ... +compats_clara_agx_xavier: Sequence[str] = ... + +JETSON_NX_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None]] = ... +compats_nx: Sequence[str] = ... + +JETSON_XAVIER_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None]] = ... +compats_xavier: Sequence[str] = ... + +JETSON_TX2_NX_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None]] = ... +compats_tx2_nx: Sequence[str] = ... + +JETSON_TX2_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None]] = ... +compats_tx2: Sequence[str] = ... + +JETSON_TX1_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None]] = ... +compats_tx1: Sequence[str] = ... + +JETSON_NANO_PIN_DEFS: list[tuple[int, str, str, int, int, str, str, str | None, int | None]] = ... +compats_nano: Sequence[str] = ... + +jetson_gpio_data: dict[str, tuple[list[tuple[int, str, str, int, int, str, str, str | None, int | None]], dict[str, Any]]] = ... + +class ChannelInfo: + def __init__( + self, channel: int, line_offset: int, gpio_name: str, gpio_chip: str, pwm_chip_dir: str, pwm_id: int + ) -> None: ... + +ids_warned: bool = ... + +def find_pmgr_board(prefix: str) -> str | None: ... +def warn_if_not_carrier_board(*carrier_boards: str) -> None: ... +def get_compatibles(compatible_path: str) -> list[str]: ... +def get_model() -> str: ... +def get_data() -> tuple[str, Any, dict[str, dict[Any, ChannelInfo]]]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/Jetson/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/METADATA.toml new file mode 100644 index 000000000000..10e85f15896c --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/Jetson.GPIO/METADATA.toml @@ -0,0 +1,2 @@ +version = "2.1.*" +upstream_repository = "https://github.com/NVIDIA/jetson-gpio" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/METADATA.toml index 7a3571b51a5c..7720828f4533 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/METADATA.toml @@ -1,4 +1,4 @@ -version = "3.6.*" +version = "3.7.*" upstream_repository = "https://github.com/Python-Markdown/markdown" partial_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/abbr.pyi b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/abbr.pyi index 682f805406f9..ace06e144ae1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/abbr.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/Markdown/markdown/extensions/abbr.pyi @@ -1,15 +1,36 @@ from re import Pattern from typing import ClassVar +from typing_extensions import deprecated +from xml.etree.ElementTree import Element +from markdown.blockparser import BlockParser from markdown.blockprocessors import BlockProcessor +from markdown.core import Markdown from markdown.extensions import Extension from markdown.inlinepatterns import InlineProcessor +from markdown.treeprocessors import Treeprocessor -class AbbrExtension(Extension): ... +class AbbrExtension(Extension): + def reset(self) -> None: ... + def reset_glossary(self) -> None: ... + def load_glossary(self, dictionary: dict[str, str]) -> None: ... -class AbbrPreprocessor(BlockProcessor): +class AbbrTreeprocessor(Treeprocessor): + RE: Pattern[str] | None + abbrs: dict[str, str] + def __init__(self, md: Markdown | None = None, abbrs: dict[str, str] | None = None) -> None: ... + def iter_element(self, el: Element, parent: Element | None = None) -> None: ... + +# Techinically it is the same type as `AbbrPreprocessor` just not deprecated. +class AbbrBlockprocessor(BlockProcessor): RE: ClassVar[Pattern[str]] + abbrs: dict[str, str] + def __init__(self, parser: BlockParser, abbrs: dict[str, str]) -> None: ... + +@deprecated("This class will be removed in the future; use `AbbrTreeprocessor` instead.") +class AbbrPreprocessor(AbbrBlockprocessor): ... +@deprecated("This class will be removed in the future; use `AbbrTreeprocessor` instead.") class AbbrInlineProcessor(InlineProcessor): title: str def __init__(self, pattern: str, title: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/METADATA.toml index 95aea7b6191e..efd1ec87729c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/PyScreeze/METADATA.toml @@ -1,4 +1,4 @@ -version = "0.1.30" +version = "1.0.1" upstream_repository = "https://github.com/asweigart/pyscreeze" requires = ["Pillow>=10.3.0"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/atheris/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/atheris/METADATA.toml new file mode 100644 index 000000000000..5a014d0c8f63 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/atheris/METADATA.toml @@ -0,0 +1,6 @@ +version = "2.3.*" +upstream_repository = "https://github.com/google/atheris" +partial_stub = true + +[tool.stubtest] +ignore_missing_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/__init__.pyi new file mode 100644 index 000000000000..2a3312448ab0 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/__init__.pyi @@ -0,0 +1,9 @@ +from collections.abc import Callable + +def Setup( + args: list[str], + test_one_input: Callable[[bytes], None], + **kwargs: bool | Callable[[bytes, int, int], str | bytes] | Callable[[bytes, bytes, int, int], str | bytes] | None, +) -> list[str]: ... +def Fuzz() -> None: ... +def Mutate(data: bytes, max_size: int) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/function_hooks.pyi b/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/function_hooks.pyi new file mode 100644 index 000000000000..92ec044b7f0f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/function_hooks.pyi @@ -0,0 +1,14 @@ +from typing import Any + +def hook_re_module() -> None: ... + +class EnabledHooks: + def __init__(self) -> None: ... + def add(self, hook: str) -> None: ... + def __contains__(self, hook: str) -> bool: ... + +enabled_hooks: EnabledHooks + +# args[1] is an arbitrary string method that is called +# with the subsequent arguments, so they will vary +def _hook_str(*args: Any, **kwargs: Any) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/import_hook.pyi b/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/import_hook.pyi new file mode 100644 index 000000000000..450923a31de9 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/import_hook.pyi @@ -0,0 +1,36 @@ +import types +from collections.abc import Sequence +from importlib import abc, machinery +from typing_extensions import Self + +def _should_skip(loader: abc.Loader) -> bool: ... + +class AtherisMetaPathFinder(abc.MetaPathFinder): + def __init__( + self, include_packages: set[str], exclude_modules: set[str], enable_loader_override: bool, trace_dataflow: bool + ) -> None: ... + def find_spec( + self, fullname: str, path: Sequence[str] | None, target: types.ModuleType | None = None + ) -> machinery.ModuleSpec | None: ... + def invalidate_caches(self) -> None: ... + +class AtherisSourceFileLoader: + def __init__(self, name: str, path: str, trace_dataflow: bool) -> None: ... + def get_code(self, fullname: str) -> types.CodeType | None: ... + +class AtherisSourcelessFileLoader: + def __init__(self, name: str, path: str, trace_dataflow: bool) -> None: ... + def get_code(self, fullname: str) -> types.CodeType | None: ... + +def make_dynamic_atheris_loader(loader: abc.Loader | type[abc.Loader], trace_dataflow: bool) -> abc.Loader: ... + +class HookManager: + def __init__( + self, include_packages: set[str], exclude_modules: set[str], enable_loader_override: bool, trace_dataflow: bool + ) -> None: ... + def __enter__(self) -> Self: ... + def __exit__(self, *args: object) -> None: ... + +def instrument_imports( + include: Sequence[str] | None = None, exclude: Sequence[str] | None = None, enable_loader_override: bool = True +) -> HookManager: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/instrument_bytecode.pyi b/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/instrument_bytecode.pyi new file mode 100644 index 000000000000..b6b935fd1c3b --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/instrument_bytecode.pyi @@ -0,0 +1,7 @@ +from collections.abc import Callable +from typing import TypeVar + +_T = TypeVar("_T") + +def instrument_func(func: Callable[..., _T]) -> Callable[..., _T]: ... +def instrument_all() -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/utils.pyi new file mode 100644 index 000000000000..090c833ddb1a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/utils.pyi @@ -0,0 +1,18 @@ +from typing import Protocol, type_check_only + +def path() -> str: ... +@type_check_only +class _Writer(Protocol): + def isatty(self) -> bool: ... + def write(self, content: str, /) -> object: ... + def flush(self) -> object: ... + +class ProgressRenderer: + def __init__(self, stream: _Writer, total_count: int) -> None: ... + def render(self) -> None: ... + def erase(self) -> None: ... + def drop(self) -> None: ... + @property + def count(self) -> int: ... + @count.setter + def count(self, new_count: int) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/version_dependent.pyi b/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/version_dependent.pyi new file mode 100644 index 000000000000..51c1d2060567 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/atheris/atheris/version_dependent.pyi @@ -0,0 +1,27 @@ +import types +from typing import Final + +PYTHON_VERSION: Final[tuple[int, int]] +CONDITIONAL_JUMPS: Final[list[str]] +UNCONDITIONAL_JUMPS: Final[list[str]] +ENDS_FUNCTION: Final[list[str]] +HAVE_REL_REFERENCE: Final[list[str]] +HAVE_ABS_REFERENCE: Final[list[str]] +REL_REFERENCE_IS_INVERTED: Final[list[str]] + +def rel_reference_scale(opname: str) -> int: ... + +REVERSE_CMP_OP: Final[list[int]] + +def jump_arg_bytes(arg: int) -> int: ... +def add_bytes_to_jump_arg(arg: int, size: int) -> int: ... + +class ExceptionTableEntry: + def __init__(self, start_offset: int, end_offset: int, target: int, depth: int, lasti: bool) -> None: ... + def __eq__(self, other: object) -> bool: ... + +class ExceptionTable: + def __init__(self, entries: list[ExceptionTableEntry]) -> None: ... + def __eq__(self, other: object) -> bool: ... + +def generate_exceptiontable(original_code: types.CodeType, exception_table_entries: list[ExceptionTableEntry]) -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/formatter.pyi b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/formatter.pyi index f76d568fa270..b6e4facd406a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/formatter.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/beautifulsoup4/bs4/formatter.pyi @@ -11,14 +11,14 @@ class Formatter(EntitySubstitution): HTML_DEFAULTS: dict[str, set[str]] language: str | None entity_substitution: _EntitySubstitution - void_element_close_prefix: str + void_element_close_prefix: str | None cdata_containing_tags: list[str] empty_attributes_are_booleans: bool def __init__( self, language: str | None = None, entity_substitution: _EntitySubstitution | None = None, - void_element_close_prefix: str = "/", + void_element_close_prefix: str | None = "/", cdata_containing_tags: list[str] | None = None, empty_attributes_are_booleans: bool = False, indent: int = 1, @@ -32,7 +32,7 @@ class HTMLFormatter(Formatter): def __init__( self, entity_substitution: _EntitySubstitution | None = ..., - void_element_close_prefix: str = ..., + void_element_close_prefix: str | None = ..., cdata_containing_tags: list[str] | None = ..., empty_attributes_are_booleans: bool = False, indent: int = 1, @@ -43,7 +43,7 @@ class XMLFormatter(Formatter): def __init__( self, entity_substitution: _EntitySubstitution | None = ..., - void_element_close_prefix: str = ..., + void_element_close_prefix: str | None = ..., cdata_containing_tags: list[str] | None = ..., empty_attributes_are_booleans: bool = False, indent: int = 1, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/davclient.pyi b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/davclient.pyi index 9f0bb919f9d7..ee23bc0b186a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/davclient.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/caldav/caldav/davclient.pyi @@ -58,9 +58,10 @@ class DAVClient: def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> None: ... - def principal(self, *, url: str | ParseResult | SplitResult | URL | None = ...) -> Principal: ... + def principal(self, *, url: str | ParseResult | SplitResult | URL | None = None) -> Principal: ... def calendar( self, + *, url: str | ParseResult | SplitResult | URL | None = ..., parent: DAVObject | None = ..., name: str | None = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/api/image.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/api/image.pyi index 034bd633bd27..f03dc7cab47a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/api/image.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/api/image.pyi @@ -4,7 +4,7 @@ from typing import Any log: Incomplete class ImageApiMixin: - def get_image(self, image: str, chunk_size: int = 2097152): ... + def get_image(self, image: str, chunk_size: int | None = 2097152): ... def history(self, image): ... def images(self, name: str | None = None, quiet: bool = False, all: bool = False, filters: Incomplete | None = None): ... def import_image( diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/containers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/containers.pyi index c62ade9a69f8..94a1d4129900 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/containers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docker/docker/models/containers.pyi @@ -203,7 +203,7 @@ class ContainerCollection(Collection[Container]): uts_mode: str | None = None, version: str | None = None, volume_driver: str | None = None, - volumes: dict[str, str] | list[str] | None = None, + volumes: dict[str, dict[str, str]] | list[str] | None = None, volumes_from: list[str] | None = None, working_dir: str | None = None, ) -> bytes: ... # TODO: This should return a stream, if `stream` is True @@ -298,7 +298,7 @@ class ContainerCollection(Collection[Container]): uts_mode: str | None = None, version: str | None = None, volume_driver: str | None = None, - volumes: dict[str, str] | list[str] | None = None, + volumes: dict[str, dict[str, str]] | list[str] | None = None, volumes_from: list[str] | None = None, working_dir: str | None = None, ) -> Container: ... @@ -389,7 +389,7 @@ class ContainerCollection(Collection[Container]): uts_mode: str | None = None, version: str | None = None, volume_driver: str | None = None, - volumes: dict[str, str] | list[str] | None = None, + volumes: dict[str, dict[str, str]] | list[str] | None = None, volumes_from: list[str] | None = None, working_dir: str | None = None, ) -> Container: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/nodes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/nodes.pyi index 0e5b726ad2ab..f9a15b5a936a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/nodes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/nodes.pyi @@ -416,10 +416,15 @@ class system_message(Special, BackLinkable, PreBibliographic, Element): def __init__(self, message: str | None = None, *children: Node, **attributes) -> None: ... class pending(Special, Invisible, Element): - transform: Transform + transform: type[Transform] details: Mapping[str, Any] def __init__( - self, transform: Transform, details: Mapping[str, Any] | None = None, rawsource: str = "", *children: Node, **attributes + self, + transform: type[Transform], + details: Mapping[str, Any] | None = None, + rawsource: str = "", + *children: Node, + **attributes, ) -> None: ... class raw(Special, Inline, PreBibliographic, FixedTextElement): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/references.pyi b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/references.pyi index 0f6820f054ea..65677b399d50 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/references.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/docutils/docutils/parsers/rst/directives/references.pyi @@ -1,3 +1,3 @@ -from _typeshed import Incomplete +from docutils.parsers.rst import Directive -def __getattr__(name: str) -> Incomplete: ... +class TargetNotes(Directive): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml index e65955d81386..f1b199d84a5a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/flake8-bugbear/METADATA.toml @@ -1,4 +1,4 @@ -version = "24.4.26" +version = "24.8.19" upstream_repository = "https://github.com/PyCQA/flake8-bugbear" partial_stub = true diff --git a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/point.pyi b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/point.pyi index 53a9e14756da..38d7eef5866e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/point.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/influxdb-client/influxdb_client/client/write/point.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete, SupportsGetItem, SupportsItems +from _typeshed import Incomplete, SupportsContainsAndGetItem, SupportsItems from collections.abc import Iterable from datetime import datetime, timedelta from numbers import Integral @@ -18,7 +18,7 @@ class Point: def measurement(measurement: str) -> Point: ... @staticmethod def from_dict( - dictionary: SupportsGetItem[str, Any], # TODO: Use SupportsContainsAndGetItem + dictionary: SupportsContainsAndGetItem[str, Any], write_precision: _WritePrecision = "ns", *, record_measurement_name: str | None = ..., diff --git a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/__init__.pyi index 887b28de1747..ab3a60939dad 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/mysqlclient/MySQLdb/__init__.pyi @@ -46,6 +46,6 @@ DATETIME: Incomplete ROWID: Incomplete def Binary(x): ... -def Connect(*args, **kwargs): ... +def Connect(*args, **kwargs) -> Connection: ... connect = Connect diff --git a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/classes/reportviews.pyi b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/classes/reportviews.pyi index caeeedceb27f..f6abe1194f3c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/classes/reportviews.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/networkx/networkx/classes/reportviews.pyi @@ -33,7 +33,7 @@ class NodeDataView(AbstractSet[_Node]): class DiDegreeView(Generic[_Node]): def __init__(self, G: Graph[_Node], nbunch: _NBunch[_Node] = None, weight: None | bool | str = None) -> None: ... - def __call__(self, nbunch: _NBunch[_Node] = None, weight: None | bool | str = None) -> DiDegreeView[_Node]: ... + def __call__(self, nbunch: _NBunch[_Node] = None, weight: None | bool | str = None) -> int | DiDegreeView[_Node]: ... def __getitem__(self, n: _Node) -> float: ... def __iter__(self) -> Iterator[tuple[_Node, float]]: ... def __len__(self) -> int: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/objgraph/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/objgraph/METADATA.toml new file mode 100644 index 000000000000..2ea5dba9e6f4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/objgraph/METADATA.toml @@ -0,0 +1,2 @@ +version = "3.6.*" +upstream_repository = "https://github.com/mgedmin/objgraph" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/objgraph/objgraph.pyi b/packages/pyright-internal/typeshed-fallback/stubs/objgraph/objgraph.pyi new file mode 100644 index 000000000000..427c6e405126 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/objgraph/objgraph.pyi @@ -0,0 +1,91 @@ +from _typeshed import Incomplete, SupportsWrite +from collections import defaultdict +from collections.abc import Callable, Container, Iterable +from types import ModuleType +from typing import Final, Literal +from typing_extensions import TypeAlias, TypeGuard + +IS_INTERACTIVE: bool + +__author__: Final[str] +__copyright__: Final[str] +__license__: Final[str] +__version__: Final[str] +__date__: Final[str] + +# GraphViz has types, but does not include the py.typed file. +# See https://github.com/xflr6/graphviz/pull/180 +_GraphvizSource: TypeAlias = Incomplete +_Filter: TypeAlias = Callable[[object], bool] + +def count(typename: str, objects: Iterable[object] | None = None) -> int: ... +def typestats( + objects: Iterable[object] | None = None, shortnames: bool = True, filter: _Filter | None = None +) -> dict[str, int]: ... +def most_common_types( + limit: int = 10, objects: Iterable[object] | None = None, shortnames: bool = True, filter: _Filter | None = None +) -> list[tuple[str, int]]: ... +def show_most_common_types( + limit: int = 10, + objects: Iterable[object] | None = None, + shortnames: bool = True, + file: SupportsWrite[str] | None = None, + filter: _Filter | None = None, +) -> None: ... +def growth( + limit: int = 10, peak_stats: dict[str, int] = {}, shortnames: bool = True, filter: _Filter | None = None +) -> list[tuple[str, int, int]]: ... +def show_growth( + limit: int = 10, + peak_stats: dict[str, int] | None = None, + shortnames: bool = True, + file: SupportsWrite[str] | None = None, + filter: _Filter | None = None, +) -> None: ... +def get_new_ids( + skip_update: bool = False, + limit: int = 10, + sortby: Literal["old", "current", "new", "deltas"] = "deltas", + shortnames: bool | None = None, + file: SupportsWrite[str] | None = None, +) -> defaultdict[str, set[int]]: ... +def get_leaking_objects(objects: Iterable[object] | None = None) -> list[object]: ... +def by_type(typename: str, objects: Iterable[object] | None = None) -> list[object]: ... +def at(addr: int) -> object: ... +def at_addrs(address_set: Container[int]) -> list[object]: ... +def find_ref_chain(obj: object, predicate: _Filter, max_depth: int = 20, extra_ignore: Iterable[int] = ()) -> list[object]: ... +def find_backref_chain( + obj: object, predicate: _Filter, max_depth: int = 20, extra_ignore: Iterable[int] = () +) -> list[object]: ... +def show_backrefs( + objs: object, + max_depth: int = 3, + extra_ignore: Iterable[int] = (), + filter: _Filter | None = None, + too_many: int = 10, + highlight: object = None, + filename: str | None = None, + extra_info: Callable[[object], str] | None = None, + refcounts: bool = False, + shortnames: bool = True, + output: SupportsWrite[str] | None = None, + extra_node_attrs: Callable[[object], dict[str, str]] | None = None, +) -> None | _GraphvizSource: ... +def show_refs( + objs: object, + max_depth: int = 3, + extra_ignore: Iterable[int] = (), + filter: _Filter | None = None, + too_many: int = 10, + highlight: object = None, + filename: str | None = None, + extra_info: Callable[[object], str] | None = None, + refcounts: bool = False, + shortnames: bool = True, + output: SupportsWrite[str] | None = None, + extra_node_attrs: Callable[[object], dict[str, str]] | None = None, +) -> None | _GraphvizSource: ... +def show_chain( + *chains: list[object], obj: object, predicate: _Filter, max_depth: int = 20, extra_ignore: Iterable[int] = () +) -> None: ... +def is_proper_module(obj: object) -> TypeGuard[ModuleType]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/containers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/containers.pyi index 30a37353c125..aaa970439216 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/containers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/protobuf/google/protobuf/internal/containers.pyi @@ -33,7 +33,7 @@ class RepeatedScalarFieldContainer(BaseContainer[_ScalarV]): def append(self, value: _ScalarV) -> None: ... def insert(self, key: int, value: _ScalarV) -> None: ... def extend(self, elem_seq: Iterable[_ScalarV] | None) -> None: ... - def MergeFrom(self: _M, other: _M) -> None: ... + def MergeFrom(self: _M, other: _M | Iterable[_ScalarV]) -> None: ... def remove(self, elem: _ScalarV) -> None: ... def pop(self, key: int = -1) -> _ScalarV: ... @overload @@ -49,7 +49,7 @@ class RepeatedCompositeFieldContainer(BaseContainer[_MessageV]): def append(self, value: _MessageV) -> None: ... def insert(self, key: int, value: _MessageV) -> None: ... def extend(self, elem_seq: Iterable[_MessageV]) -> None: ... - def MergeFrom(self: _M, other: _M) -> None: ... + def MergeFrom(self: _M, other: _M | Iterable[_MessageV]) -> None: ... def remove(self, elem: _MessageV) -> None: ... def pop(self, key: int = -1) -> _MessageV: ... def __delitem__(self, key: int | slice) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/__init__.pyi index b01ee35497e0..58d48e3aac92 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/__init__.pyi @@ -121,12 +121,14 @@ if sys.platform == "win32": ) if sys.platform == "linux": - from ._pslinux import pfullmem, pmem, sensors_battery as sensors_battery, svmem + from ._pslinux import pfullmem, pmem, scputimes, sensors_battery as sensors_battery, svmem elif sys.platform == "darwin": - from ._psosx import pfullmem, pmem, sensors_battery as sensors_battery, svmem + from ._psosx import pfullmem, pmem, scputimes, sensors_battery as sensors_battery, svmem elif sys.platform == "win32": - from ._pswindows import pfullmem, pmem, sensors_battery as sensors_battery, svmem + from ._pswindows import pfullmem, pmem, scputimes, sensors_battery as sensors_battery, svmem else: + scputimes = Incomplete + class pmem(Any): ... class pfullmem(Any): ... class svmem(Any): ... @@ -241,16 +243,27 @@ def wait_procs( procs: Iterable[Process], timeout: float | None = None, callback: Callable[[Process], object] | None = None ) -> tuple[list[Process], list[Process]]: ... def cpu_count(logical: bool = True) -> int: ... -def cpu_times(percpu: bool = False): ... +@overload +def cpu_freq(percpu: Literal[False] = ...) -> scpufreq: ... +@overload +def cpu_freq(percpu: Literal[True]) -> list[scpufreq]: ... +@overload +def cpu_times(percpu: Literal[False] = ...) -> scputimes: ... +@overload +def cpu_times(percpu: Literal[True]) -> list[scputimes]: ... @overload def cpu_percent(interval: float | None = None, percpu: Literal[False] = False) -> float: ... @overload def cpu_percent(interval: float | None, percpu: Literal[True]) -> list[float]: ... @overload def cpu_percent(*, percpu: Literal[True]) -> list[float]: ... -def cpu_times_percent(interval: float | None = None, percpu: bool = False): ... +@overload +def cpu_times_percent(interval: float | None = None, percpu: Literal[False] = False) -> scputimes: ... +@overload +def cpu_times_percent(interval: float | None, percpu: Literal[True]) -> list[scputimes]: ... +@overload +def cpu_times_percent(*, percpu: Literal[True]) -> list[scputimes]: ... def cpu_stats() -> scpustats: ... -def cpu_freq(percpu: bool = False) -> scpufreq: ... def getloadavg() -> tuple[float, float, float]: ... def virtual_memory() -> svmem: ... def swap_memory() -> sswap: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psaix.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psaix.pyi index c74f0302194f..2bc31a2e27af 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psaix.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psaix.pyi @@ -37,10 +37,10 @@ class pmem(NamedTuple): pfullmem = pmem class scputimes(NamedTuple): - user: Incomplete - system: Incomplete - idle: Incomplete - iowait: Incomplete + user: float + system: float + idle: float + iowait: float class svmem(NamedTuple): total: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi index 9e85dd9de716..4d17285a079b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi @@ -41,11 +41,11 @@ class svmem(NamedTuple): wired: int class scputimes(NamedTuple): - user: Any - nice: Any - system: Any - idle: Any - irq: Any + user: float + nice: float + system: float + idle: float + irq: float class pmem(NamedTuple): rss: Any diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi index 70b78688a5d5..f2c16b6170fd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi @@ -120,18 +120,31 @@ class pio(NamedTuple): write_chars: Any class pcputimes(NamedTuple): - user: Any - system: Any - children_user: Any - children_system: Any - iowait: Any + user: float + system: float + children_user: float + children_system: float + iowait: float def readlink(path): ... def file_flags_to_mode(flags): ... def is_storage_device(name): ... def set_scputimes_ntuple(procfs_path) -> None: ... -scputimes: Any +class scputimes(NamedTuple): + # Note: scputimes has different fields depending on exactly how Linux + # is setup, but we'll include the "complete" set of fields + user: float + nice: float + system: float + idle: float + iowait: float + irq: float + softirq: float + steal: float + guest: float + guest_nice: float + prlimit: Any def calculate_avail_vmem(mems): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psosx.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psosx.pyi index 85bb909e5f76..075aba89aef9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psosx.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psosx.pyi @@ -21,10 +21,10 @@ kinfo_proc_map: Any pidtaskinfo_map: Any class scputimes(NamedTuple): - user: Any - nice: Any - system: Any - idle: Any + user: float + nice: float + system: float + idle: float class svmem(NamedTuple): total: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi index 606383aef15f..e4729492edae 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi @@ -59,11 +59,11 @@ class IOPriority(enum.IntEnum): pinfo_map: Any class scputimes(NamedTuple): - user: Any - system: Any - idle: Any - interrupt: Any - dpc: Any + user: float + system: float + idle: float + interrupt: float + dpc: float class svmem(NamedTuple): total: int diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/decoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/decoder.pyi index 32149c41b330..ded04121b894 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/decoder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/ber/decoder.pyi @@ -346,11 +346,11 @@ decode: Decoder class StreamingDecoder: SINGLE_ITEM_DECODER: type[SingleItemDecoder] - def __init__(self, substrate, asn1Spec=None, tagMap=..., typeMap=..., **ignored: Unused) -> None: ... + def __init__(self, substrate, asn1Spec=None, *, tagMap=..., typeMap=..., **ignored: Unused) -> None: ... def __iter__(self): ... class Decoder: STREAMING_DECODER: type[StreamingDecoder] @classmethod - def __call__(cls, substrate, asn1Spec=None, tagMap=..., typeMap=..., **ignored: Unused): ... + def __call__(cls, substrate, asn1Spec=None, *, tagMap=..., typeMap=..., **ignored: Unused): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/decoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/decoder.pyi index a1bbb983bd79..ecc906bf43b8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/decoder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/decoder.pyi @@ -36,7 +36,7 @@ class SingleItemDecoder: class Decoder: SINGLE_ITEM_DECODER: type[SingleItemDecoder] - def __init__(self, tagMap=..., typeMap=..., **options: Unused) -> None: ... + def __init__(self, *, tagMap=..., typeMap=..., **options: Unused) -> None: ... def __call__(self, pyObject, asn1Spec=None, **kwargs): ... decode: Decoder diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/encoder.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/encoder.pyi index a69a11346ceb..83abcc3b4a78 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/encoder.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyasn1/pyasn1/codec/native/encoder.pyi @@ -65,7 +65,7 @@ class SingleItemEncoder: class Encoder: SINGLE_ITEM_ENCODER: type[SingleItemEncoder] - def __init__(self, tagMap=..., typeMap=..., **options: Unused): ... + def __init__(self, *, tagMap=..., typeMap=..., **options: Unused): ... def __call__(self, pyObject, asn1Spec=None, **options): ... encode: SingleItemEncoder diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyfarmhash/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/pyfarmhash/METADATA.toml index c488b9db5887..8762bdc0e304 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyfarmhash/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyfarmhash/METADATA.toml @@ -1,2 +1,2 @@ -version = "0.3.*" +version = "0.4.*" upstream_repository = "https://github.com/veelion/python-farmhash" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pygit2/pygit2/_pygit2.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pygit2/pygit2/_pygit2.pyi index 487f9159cba5..4dfdab53447d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pygit2/pygit2/_pygit2.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pygit2/pygit2/_pygit2.pyi @@ -351,7 +351,7 @@ class Blob(Object): # This is not a real subclassing. Just ensuring type-checkers sees this type as compatible with _CDataBase # pyright has no error code for subclassing final @final -class Branch(Reference): # type: ignore[misc] # pyright: ignore +class Branch(Reference): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] branch_name: str raw_branch_name: bytes remote_name: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pygit2/pygit2/utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pygit2/pygit2/utils.pyi index 5bffb9cd2ff0..22f4fe9aa897 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pygit2/pygit2/utils.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pygit2/pygit2/utils.pyi @@ -18,7 +18,7 @@ def strarray_to_strings(arr: _GitStrArray) -> list[str]: ... # Actual type: _cffi_backend.__CDataOwn # This is not a real subclassing. Just ensuring type-checkers sees this type as compatible with _CDataBase # pyright has no error code for subclassing final -class _GitStrArray(_CDataBase): # type: ignore[misc] # pyright: ignore +class _GitStrArray(_CDataBase): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] count: int strings: _CDataBase # diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/miniterm.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/miniterm.pyi index bb6f7dde282c..b53d8d074a61 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/miniterm.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pyserial/serial/tools/miniterm.pyi @@ -1,18 +1,27 @@ import codecs import sys import threading -from _typeshed import Unused +from _typeshed import SupportsFlush, SupportsWrite, Unused from collections.abc import Iterable -from typing import Any, BinaryIO, TextIO +from typing import Any, Protocol, TypeVar, type_check_only from typing_extensions import Self from serial import Serial +_AnyStr_T = TypeVar("_AnyStr_T", contravariant=True) + +@type_check_only +class _SupportsWriteAndFlush(SupportsWrite[_AnyStr_T], SupportsFlush, Protocol): ... + +@type_check_only +class _SupportsRead(Protocol): + def read(self, n: int, /) -> str: ... + def key_description(character: str) -> str: ... class ConsoleBase: - byte_output: BinaryIO - output: codecs.StreamWriter | TextIO + byte_output: _SupportsWriteAndFlush[bytes] + output: _SupportsWriteAndFlush[str] def __init__(self) -> None: ... def setup(self) -> None: ... def cleanup(self) -> None: ... @@ -39,7 +48,7 @@ else: class Console(ConsoleBase): fd: int old: list[Any] # return type of termios.tcgetattr() - enc_stdin: TextIO + enc_stdin: _SupportsRead class Transform: def rx(self, text: str) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/METADATA.toml index e31cadf8bdcc..519714f98de7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-datemath/METADATA.toml @@ -1,4 +1,4 @@ -version = "1.5.*" +version = "3.0.*" upstream_repository = "https://github.com/nickmaccarthy/python-datemath" # Requires a version of arrow with a `py.typed` file requires = ["arrow>=1.0.1"] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/__init__.pyi index c375ff1580ac..68f96ff238b8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/parser/__init__.pyi @@ -65,3 +65,4 @@ class _tzparser: ... DEFAULTTZPARSER: _tzparser class ParserError(ValueError): ... +class UnknownTimezoneWarning(RuntimeWarning): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/relativedelta.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/relativedelta.pyi index 394713db0e4e..7f228880c3cf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/relativedelta.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-dateutil/dateutil/relativedelta.pyi @@ -38,15 +38,15 @@ class relativedelta: self, dt1: date | None = None, dt2: date | None = None, - years: int | None = 0, - months: int | None = 0, - days: int | None = 0, - leapdays: int | None = 0, - weeks: int | None = 0, - hours: int | None = 0, - minutes: int | None = 0, - seconds: int | None = 0, - microseconds: int | None = 0, + years: int = 0, + months: int = 0, + days: int = 0, + leapdays: int = 0, + weeks: int = 0, + hours: int = 0, + minutes: int = 0, + seconds: int = 0, + microseconds: int = 0, year: int | None = None, month: int | None = None, day: int | None = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/METADATA.toml new file mode 100644 index 000000000000..73ce01ef67e7 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/METADATA.toml @@ -0,0 +1,2 @@ +version = "3.3.7" +upstream_repository = "https://github.com/sendgrid/python-http-client" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/python_http_client/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/python_http_client/__init__.pyi new file mode 100644 index 000000000000..1c17420c7594 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/python_http_client/__init__.pyi @@ -0,0 +1,20 @@ +from typing import Final + +from .client import Client as Client +from .exceptions import ( + BadRequestsError as BadRequestsError, + ForbiddenError as ForbiddenError, + GatewayTimeoutError as GatewayTimeoutError, + HTTPError as HTTPError, + InternalServerError as InternalServerError, + MethodNotAllowedError as MethodNotAllowedError, + NotFoundError as NotFoundError, + PayloadTooLargeError as PayloadTooLargeError, + ServiceUnavailableError as ServiceUnavailableError, + TooManyRequestsError as TooManyRequestsError, + UnauthorizedError as UnauthorizedError, + UnsupportedMediaTypeError as UnsupportedMediaTypeError, +) + +dir_path: Final[str] +__version__: Final[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/python_http_client/client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/python_http_client/client.pyi new file mode 100644 index 000000000000..f47cebc70bc8 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/python_http_client/client.pyi @@ -0,0 +1,31 @@ +from email.message import Message +from typing import Final + +class Response: + def __init__(self, response) -> None: ... + @property + def status_code(self) -> int: ... + @property + def body(self): ... + @property + def headers(self) -> Message: ... + @property + def to_dict(self): ... + +class Client: + methods: Final[set[str]] + host: str + request_headers: dict[str, str] + append_slash: bool + timeout: int + def __init__( + self, + host: str, + request_headers: dict[str, str] | None = None, + version: int | None = None, + url_path: list[str] | None = None, + append_slash: bool = False, + timeout: int | None = None, + ) -> None: ... + def _(self, name: str) -> Client: ... + def __getattr__(self, name: str) -> Client | Response: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/python_http_client/exceptions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/python_http_client/exceptions.pyi new file mode 100644 index 000000000000..4852c02d679d --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/python-http-client/python_http_client/exceptions.pyi @@ -0,0 +1,28 @@ +from email.message import Message +from typing import Final + +class HTTPError(Exception): + status_code: int + reason: str + body: str + headers: Message + def __init__(self, *args) -> None: ... + def __reduce__(self): ... + @property + def to_dict(self): ... + +class BadRequestsError(HTTPError): ... +class UnauthorizedError(HTTPError): ... +class ForbiddenError(HTTPError): ... +class NotFoundError(HTTPError): ... +class MethodNotAllowedError(HTTPError): ... +class PayloadTooLargeError(HTTPError): ... +class UnsupportedMediaTypeError(HTTPError): ... +class TooManyRequestsError(HTTPError): ... +class InternalServerError(HTTPError): ... +class ServiceUnavailableError(HTTPError): ... +class GatewayTimeoutError(HTTPError): ... + +err_dict: Final[dict[int, type[HTTPError]]] + +def handle_error(error) -> HTTPError: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/documents.pyi b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/documents.pyi index 7c1516b6a34f..5be676213228 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/documents.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/pywin32/win32comext/axdebug/documents.pyi @@ -15,7 +15,7 @@ class DebugDocumentProvider(gateways.DebugDocumentProvider): # error: Cannot determine consistent method resolution order (MRO) for "DebugDocumentText" # pyright doesn't have a specific error code for MRO error! -class DebugDocumentText(gateways.DebugDocumentInfo, gateways.DebugDocumentText, gateways.DebugDocument): # type: ignore[misc] # pyright: ignore +class DebugDocumentText(gateways.DebugDocumentInfo, gateways.DebugDocumentText, gateways.DebugDocument): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] codeContainer: Incomplete def __init__(self, codeContainer) -> None: ... def GetName(self, dnt): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/typing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/typing.pyi index f5eb13f831a2..304a35c4548b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/typing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/redis/redis/typing.pyi @@ -11,7 +11,7 @@ EncodedT: TypeAlias = bytes | memoryview DecodedT: TypeAlias = str | int | float EncodableT: TypeAlias = EncodedT | DecodedT AbsExpiryT: TypeAlias = int | datetime -ExpiryT: TypeAlias = float | timedelta +ExpiryT: TypeAlias = int | timedelta ZScoreBoundT: TypeAlias = float | str BitfieldOffsetT: TypeAlias = int | str _StringLikeT: TypeAlias = bytes | str | memoryview # noqa: Y043 diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/models.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/models.pyi index af06bc29aaa0..d95a7382e530 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/models.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/models.pyi @@ -6,6 +6,7 @@ from typing import Any from typing_extensions import Self from urllib3 import exceptions as urllib3_exceptions, fields, filepost, util +from urllib3.response import HTTPResponse from . import auth, cookies, exceptions, hooks, status_codes, utils from .adapters import HTTPAdapter @@ -116,7 +117,7 @@ class Response: _content: bytes | None # undocumented status_code: int headers: CaseInsensitiveDict[str] - raw: Incomplete + raw: HTTPResponse | MaybeNone url: str encoding: str | None history: list[Response] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/sessions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/sessions.pyi index 4a32b9825252..5427c5201755 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/sessions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/requests/requests/sessions.pyi @@ -131,7 +131,7 @@ class Session(SessionRedirectMixin): max_redirects: int trust_env: bool cookies: RequestsCookieJar - adapters: MutableMapping[Any, Any] + adapters: MutableMapping[str, adapters.BaseAdapter] redirect_cache: RecentlyUsedContainer[Any, Any] def __init__(self) -> None: ... def __enter__(self) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/METADATA.toml index 6d0e2c46412e..47969f29c563 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/METADATA.toml @@ -1,4 +1,4 @@ -version = "71.1.*" +version = "74.1.*" upstream_repository = "https://github.com/pypa/setuptools" extra_description = """\ If using `setuptools >= 71.1` *only* for `pkg_resources`, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi index fe0ca42441a3..a4cd7df6396c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi @@ -20,7 +20,7 @@ from ._vendored_packaging import requirements as _packaging_requirements, versio _T = TypeVar("_T") _DistributionT = TypeVar("_DistributionT", bound=Distribution) _NestedStr: TypeAlias = str | Iterable[_NestedStr] -_InstallerTypeT: TypeAlias = Callable[[Requirement], _DistributionT] # noqa: Y043 +_StrictInstallerType: TypeAlias = Callable[[Requirement], _DistributionT] _InstallerType: TypeAlias = Callable[[Requirement], Distribution | None] _PkgReqType: TypeAlias = str | Requirement _EPDistType: TypeAlias = Distribution | _PkgReqType @@ -115,6 +115,10 @@ def fixup_namespace_packages(path_item: str, parent: str | None = None) -> None: class WorkingSet: entries: list[str] + entry_keys: dict[str | None, list[str]] + by_key: dict[str, Distribution] + normalized_to_canonical_keys: dict[str, str] + callbacks: list[Callable[[Distribution], object]] def __init__(self, entries: Iterable[str] | None = None) -> None: ... def add_entry(self, entry: str) -> None: ... def __contains__(self, dist: Distribution) -> bool: ... @@ -128,7 +132,7 @@ class WorkingSet: self, requirements: Iterable[Requirement], env: Environment | None, - installer: _InstallerTypeT[_DistributionT], + installer: _StrictInstallerType[_DistributionT], replace_conflicting: bool = False, extras: tuple[str, ...] | None = None, ) -> list[_DistributionT]: ... @@ -138,7 +142,7 @@ class WorkingSet: requirements: Iterable[Requirement], env: Environment | None = None, *, - installer: _InstallerTypeT[_DistributionT], + installer: _StrictInstallerType[_DistributionT], replace_conflicting: bool = False, extras: tuple[str, ...] | None = None, ) -> list[_DistributionT]: ... @@ -156,7 +160,7 @@ class WorkingSet: self, plugin_env: Environment, full_env: Environment | None, - installer: _InstallerTypeT[_DistributionT], + installer: _StrictInstallerType[_DistributionT], fallback: bool = True, ) -> tuple[list[_DistributionT], dict[Distribution, Exception]]: ... @overload @@ -165,7 +169,7 @@ class WorkingSet: plugin_env: Environment, full_env: Environment | None = None, *, - installer: _InstallerTypeT[_DistributionT], + installer: _StrictInstallerType[_DistributionT], fallback: bool = True, ) -> tuple[list[_DistributionT], dict[Distribution, Exception]]: ... @overload @@ -193,7 +197,7 @@ class Environment: self, req: Requirement, working_set: WorkingSet, - installer: _InstallerTypeT[_DistributionT], + installer: _StrictInstallerType[_DistributionT], replace_conflicting: bool = False, ) -> _DistributionT: ... @overload @@ -205,7 +209,7 @@ class Environment: replace_conflicting: bool = False, ) -> Distribution | None: ... @overload - def obtain(self, requirement: Requirement, installer: _InstallerTypeT[_DistributionT]) -> _DistributionT: ... + def obtain(self, requirement: Requirement, installer: _StrictInstallerType[_DistributionT]) -> _DistributionT: ... @overload def obtain(self, requirement: Requirement, installer: Callable[[Requirement], None] | None = None) -> None: ... @overload @@ -428,6 +432,7 @@ class Distribution(NullProvider): def requires(self, extras: Iterable[str] = ()) -> list[Requirement]: ... def activate(self, path: list[str] | None = None, replace: bool = False) -> None: ... def egg_name(self) -> str: ... # type: ignore[override] # supertype's egg_name is a variable, not a method + def __getattr__(self, attr: str) -> Any: ... # Delegate all unrecognized public attributes to .metadata provider @classmethod def from_filename(cls, filename: StrPath, metadata: _MetadataType = None, *, precedence: int = 3) -> Distribution: ... def as_requirement(self) -> Requirement: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi index 97133a6dc239..37b3ea9330cc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/cmd.pyi @@ -12,6 +12,7 @@ _CommandT = TypeVar("_CommandT", bound=Command) _Ts = TypeVarTuple("_Ts") class Command: + dry_run: bool # Exposed from __getattr_. Same as Distribution.dry_run distribution: Distribution # Any to work around variance issues sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dist.pyi index e814c15cb433..f3c2755983b3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dist.pyi @@ -69,9 +69,9 @@ class Distribution: display_options: ClassVar[_OptionsList] display_option_names: ClassVar[list[str]] negative_opt: ClassVar[dict[str, str]] - verbose: int - dry_run: int - help: int + verbose: bool + dry_run: bool + help: bool command_packages: list[str] | None script_name: str | None script_args: list[str] | None @@ -128,7 +128,7 @@ class Distribution: def has_data_files(self) -> bool: ... def is_pure(self) -> bool: ... - # Getter methods generated in __init__ + # Default getter methods generated in __init__ from self.metadata._METHOD_BASENAMES def get_name(self) -> str: ... def get_version(self) -> str: ... def get_fullname(self) -> str: ... @@ -150,3 +150,26 @@ class Distribution: def get_requires(self) -> list[str]: ... def get_provides(self) -> list[str]: ... def get_obsoletes(self) -> list[str]: ... + + # Default attributes generated in __init__ from self.display_option_names + help_commands: bool | Literal[0] + name: str | Literal[0] + version: str | Literal[0] + fullname: str | Literal[0] + author: str | Literal[0] + author_email: str | Literal[0] + maintainer: str | Literal[0] + maintainer_email: str | Literal[0] + contact: str | Literal[0] + contact_email: str | Literal[0] + url: str | Literal[0] + license: str | Literal[0] + licence: str | Literal[0] + description: str | Literal[0] + long_description: str | Literal[0] + platforms: str | list[str] | Literal[0] + classifiers: str | list[str] | Literal[0] + keywords: str | list[str] | Literal[0] + provides: list[str] | Literal[0] + requires: list[str] | Literal[0] + obsoletes: list[str] | Literal[0] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_rpm.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_rpm.pyi index 31de5b470555..cb79f3dbf156 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_rpm.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_rpm.pyi @@ -1,4 +1,7 @@ +from setuptools.dist import Distribution + from .._distutils.command import bdist_rpm as orig class bdist_rpm(orig.bdist_rpm): + distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_wheel.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_wheel.pyi index 4c10f3f9960c..4bba3e97406c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_wheel.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_wheel.pyi @@ -1,6 +1,5 @@ -from _typeshed import Incomplete, Unused +from _typeshed import ExcInfo, Incomplete, Unused from collections.abc import Callable, Iterable -from types import TracebackType from typing import ClassVar, Final, Literal from setuptools import Command @@ -18,10 +17,8 @@ def get_flag(var: str, fallback: bool, expected: bool = True, warn: bool = True) def get_abi_tag() -> str | None: ... def safer_name(name: str) -> str: ... def safer_version(version: str) -> str: ... -def remove_readonly( - func: Callable[[str], Unused], path: str, excinfo: tuple[type[Exception], Exception, TracebackType] -) -> None: ... -def remove_readonly_exc(func: Callable[[str], Unused], path: str, exc: Exception) -> None: ... +def remove_readonly(func: Callable[[str], Unused], path: str, excinfo: ExcInfo) -> None: ... +def remove_readonly_exc(func: Callable[[str], Unused], path: str, exc: BaseException) -> None: ... class bdist_wheel(Command): description: ClassVar[str] @@ -30,20 +27,20 @@ class bdist_wheel(Command): boolean_options: ClassVar[list[str]] bdist_dir: str | None - data_dir: Incomplete | None + data_dir: str | None plat_name: str | None - plat_tag: Incomplete | None + plat_tag: str | None format: str keep_temp: bool dist_dir: str | None - egginfo_dir: Incomplete | None + egginfo_dir: str | None root_is_pure: bool | None - skip_build: Incomplete | None + skip_build: bool relative: bool owner: Incomplete | None group: Incomplete | None universal: bool - compression: str | int + compression: int | str python_tag: str build_number: str | None py_limited_api: str | Literal[False] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build.pyi index a7e6dd8045b8..5263a05bda51 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build.pyi @@ -1,8 +1,11 @@ from typing import Protocol +from setuptools.dist import Distribution + from .._distutils.command.build import build as _build -class build(_build): ... +class build(_build): + distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution class SubCommand(Protocol): editable_mode: bool diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_clib.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_clib.pyi index a8fe07c51b73..6f657c2c7c2f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_clib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_clib.pyi @@ -1,4 +1,8 @@ +from setuptools.dist import Distribution + from .._distutils.command import build_clib as orig class build_clib(orig.build_clib): + distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution + def build_libraries(self, libraries) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi index f67095c7e246..ad53ac20163a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_ext.pyi @@ -1,6 +1,8 @@ from _typeshed import Incomplete from typing import ClassVar +from setuptools.dist import Distribution + from .._distutils.command.build_ext import build_ext as _build_ext have_rtld: bool @@ -11,6 +13,7 @@ def if_dl(s): ... def get_abi3_suffix(): ... class build_ext(_build_ext): + distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution editable_mode: ClassVar[bool] inplace: bool def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi index cefb13f55ca0..77a2821d5c9f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/build_py.pyi @@ -1,12 +1,15 @@ from _typeshed import Incomplete, StrPath from typing import ClassVar +from setuptools.dist import Distribution + from .._distutils.cmd import _StrPathT from .._distutils.command import build_py as orig def make_writable(target) -> None: ... class build_py(orig.build_py): + distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution editable_mode: ClassVar[bool] package_data: dict[str, list[str]] exclude_package_data: dict[Incomplete, Incomplete] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi index 6db9d45d6848..08129d8a55de 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/easy_install.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete -from collections.abc import Iterable, Iterator -from typing import Any, ClassVar, Literal, TypedDict, type_check_only +from collections.abc import Callable, Iterable, Iterator +from typing import Any, ClassVar, Literal, TypedDict, TypeVar, type_check_only from typing_extensions import Self from pkg_resources import Environment @@ -8,6 +8,8 @@ from setuptools.package_index import PackageIndex from .. import Command, SetuptoolsDeprecationWarning +_T = TypeVar("_T") + __all__ = ["easy_install", "PthDistributions", "extract_wininst_cfg", "get_exe_prefixes"] class easy_install(Command): @@ -112,6 +114,8 @@ class RewritePthDistributions(PthDistributions): prelude: str postlude: str +# Must match shutil._OnExcCallback +def auto_chmod(func: Callable[..., _T], arg: str, exc: BaseException) -> _T: ... @type_check_only class _SplitArgs(TypedDict, total=False): comments: bool @@ -123,7 +127,7 @@ class CommandSpec(list[str]): @classmethod def best(cls) -> type[CommandSpec]: ... @classmethod - def from_param(cls, param: str | Self | Iterable[str] | None) -> Self: ... + def from_param(cls, param: Self | str | Iterable[str] | None) -> Self: ... @classmethod def from_environment(cls) -> CommandSpec: ... @classmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/editable_wheel.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/editable_wheel.pyi index 3d8f73bcc0b6..482e679d30c3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/editable_wheel.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/editable_wheel.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete, StrPath +from _typeshed import Incomplete, StrPath, Unused from collections.abc import Iterator, Mapping from enum import Enum from pathlib import Path @@ -34,7 +34,7 @@ class editable_wheel(Command): class EditableStrategy(Protocol): def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]) -> None: ... - def __enter__(self): ... + def __enter__(self) -> Self: ... def __exit__( self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None ) -> None: ... @@ -46,9 +46,7 @@ class _StaticPth: def __init__(self, dist: Distribution, name: str, path_entries: list[Path]) -> None: ... def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]): ... def __enter__(self) -> Self: ... - def __exit__( - self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None - ) -> None: ... + def __exit__(self, _exc_type: Unused, _exc_value: Unused, _traceback: Unused) -> None: ... class _LinkTree(_StaticPth): auxiliary_dir: Path @@ -56,9 +54,7 @@ class _LinkTree(_StaticPth): def __init__(self, dist: Distribution, name: str, auxiliary_dir: StrPath, build_lib: StrPath) -> None: ... def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]): ... def __enter__(self) -> Self: ... - def __exit__( - self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None - ) -> None: ... + def __exit__(self, _exc_type: Unused, _exc_value: Unused, _traceback: Unused) -> None: ... class _TopLevelFinder: dist: Distribution @@ -68,9 +64,7 @@ class _TopLevelFinder: def get_implementation(self) -> Iterator[tuple[str, bytes]]: ... def __call__(self, wheel: _WheelFile, files: list[str], mapping: Mapping[str, str]): ... def __enter__(self) -> Self: ... - def __exit__( - self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None - ) -> None: ... + def __exit__(self, _exc_type: Unused, _exc_value: Unused, _traceback: Unused) -> None: ... class _NamespaceInstaller(namespaces.Installer): distribution: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi index c318c8134638..1e17156f5f85 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/egg_info.pyi @@ -70,7 +70,6 @@ class manifest_maker(sdist): def warn(self, msg) -> None: ... def add_defaults(self) -> None: ... def add_license_files(self) -> None: ... - def prune_file_list(self) -> None: ... def write_file(filename, contents) -> None: ... def write_pkg_info(cmd, basename, filename) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install.pyi index d5f499e7403d..99472f199758 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install.pyi @@ -2,9 +2,12 @@ from _typeshed import Incomplete from collections.abc import Callable from typing import Any, ClassVar +from setuptools.dist import Distribution + from .._distutils.command import install as orig class install(orig.install): + distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution user_options: ClassVar[list[tuple[str, str | None, str]]] boolean_options: ClassVar[list[str]] # Any to work around variance issues diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_lib.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_lib.pyi index 2da4a2e50bc8..a7576d20a35a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_lib.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_lib.pyi @@ -1,8 +1,11 @@ from _typeshed import StrPath, Unused +from setuptools.dist import Distribution + from .._distutils.command import install_lib as orig class install_lib(orig.install_lib): + distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution def run(self) -> None: ... def get_exclusions(self): ... def copy_tree( diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_scripts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_scripts.pyi index 8e5714628957..f131b0f7c4fa 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_scripts.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/install_scripts.pyi @@ -1,6 +1,9 @@ +from setuptools.dist import Distribution + from .._distutils.command import install_scripts as orig class install_scripts(orig.install_scripts): + distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution no_ep: bool def initialize_options(self) -> None: ... outfiles: list[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/register.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/register.pyi index 60a5f709483e..aa1067e75e87 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/register.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/register.pyi @@ -1,4 +1,7 @@ +from setuptools.dist import Distribution + from .._distutils.command import register as orig class register(orig.register): + distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/sdist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/sdist.pyi index 1dba62b5ba1e..84589f740711 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/sdist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/sdist.pyi @@ -1,11 +1,14 @@ from _typeshed import Incomplete from typing import ClassVar +from setuptools.dist import Distribution + from .._distutils.command import sdist as orig def walk_revctrl(dirname: str = "") -> None: ... class sdist(orig.sdist): + distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution user_options: ClassVar[list[tuple[str, str | None, str]]] negative_opt: ClassVar[dict[str, str]] README_EXTENSIONS: ClassVar[list[str]] @@ -14,6 +17,7 @@ class sdist(orig.sdist): def run(self) -> None: ... def initialize_options(self) -> None: ... def make_distribution(self) -> None: ... + def prune_file_list(self) -> None: ... def check_readme(self) -> None: ... def make_release_tree(self, base_dir, files) -> None: ... def read_manifest(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi index 3c2c22673f13..d9d2eb900c4d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/test.pyi @@ -1,43 +1,17 @@ -from _typeshed import Incomplete, Unused -from collections.abc import Callable -from types import ModuleType -from typing import ClassVar, Generic, TypeVar, overload -from typing_extensions import Self -from unittest import TestLoader, TestSuite +from typing import ClassVar +from typing_extensions import deprecated from .. import Command -_T = TypeVar("_T") -_R = TypeVar("_R") - -class ScanningLoader(TestLoader): - def __init__(self) -> None: ... - def loadTestsFromModule(self, module: ModuleType, pattern: Incomplete | None = None) -> list[TestSuite]: ... # type: ignore[override] - -class NonDataProperty(Generic[_T, _R]): - fget: Callable[[_T], _R] - def __init__(self, fget: Callable[[_T], _R]) -> None: ... - @overload - def __get__(self, obj: None, objtype: Unused = None) -> Self: ... - @overload - def __get__(self, obj: _T, objtype: Unused = None) -> _R: ... - +@deprecated( + """\ +The test command is disabled and references to it are deprecated. \ +Please remove any references to `setuptools.command.test` in all supported versions of the affected package.\ +""" +) class test(Command): - description: str + description: ClassVar[str] user_options: ClassVar[list[tuple[str, str, str]]] - test_suite: Incomplete - test_module: Incomplete - test_loader: Incomplete - test_runner: Incomplete def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... - @NonDataProperty - def test_args(self) -> list[str]: ... - def with_project_on_sys_path(self, func) -> None: ... - def project_on_sys_path(self, include_dists=()): ... - @staticmethod - def paths_on_pythonpath(paths) -> None: ... - @staticmethod - def install_dists(dist): ... def run(self) -> None: ... - def run_tests(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/upload.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/upload.pyi index efffae3b72c0..ed84ddab0ccf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/upload.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/command/upload.pyi @@ -1,4 +1,7 @@ +from setuptools.dist import Distribution + from .._distutils.command import upload as orig class upload(orig.upload): + distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution def run(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/compat/py312.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/compat/py312.pyi new file mode 100644 index 000000000000..0b3a667177e4 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/compat/py312.pyi @@ -0,0 +1,3 @@ +from typing import Final + +PTH_ENCODING: Final[str | None] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/config/expand.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/config/expand.pyi index cdd99861e836..78c53c5e641f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/config/expand.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/config/expand.pyi @@ -38,7 +38,7 @@ class EnsurePackagesDiscovered: def __call__(self) -> None: ... def __enter__(self) -> Self: ... def __exit__( - self, _exc_type: type[BaseException] | None, _exc_value: BaseException | None, _traceback: TracebackType | None + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> None: ... @property def package_dir(self) -> Mapping[str, str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/config/pyprojecttoml.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/config/pyprojecttoml.pyi index e61686654dfe..f44ffcdb95d4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/config/pyprojecttoml.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/config/pyprojecttoml.pyi @@ -44,7 +44,7 @@ class _EnsurePackagesDiscovered(expand.EnsurePackagesDiscovered): def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None - ): ... + ) -> None: ... class _BetaConfiguration(SetuptoolsWarning): ... class _InvalidFile(SetuptoolsWarning): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi index 5948c073d82e..ed8ef092b93b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/dist.pyi @@ -34,6 +34,8 @@ _CommandT = TypeVar("_CommandT", bound=Command) __all__ = ["Distribution"] class Distribution(_Distribution): + include_package_data: bool | None + exclude_package_data: dict[str, list[str]] | None src_root: str | None dependency_links: list[str] setup_requires: list[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/monkey.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/monkey.pyi index f31d2563ba50..ba3f50fe98da 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/monkey.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/monkey.pyi @@ -1,12 +1,15 @@ -from typing import TypeVar +from types import FunctionType +from typing import TypeVar, overload _T = TypeVar("_T") - +_UnpatchT = TypeVar("_UnpatchT", type, FunctionType) __all__: list[str] = [] -def get_unpatched(item: _T) -> _T: ... -def get_unpatched_class(cls): ... +@overload +def get_unpatched(item: _UnpatchT) -> _UnpatchT: ... # type: ignore[overload-overlap] +@overload +def get_unpatched(item: object) -> None: ... +def get_unpatched_class(cls: type[_T]) -> type[_T]: ... def patch_all() -> None: ... def patch_func(replacement, target_mod, func_name) -> None: ... def get_unpatched_function(candidate): ... -def patch_for_msvc_specialized_compiler(): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/msvc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/msvc.pyi index 6376fa5d36f0..f07c4833d85f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/msvc.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/msvc.pyi @@ -1,22 +1,32 @@ import sys -from _typeshed import Incomplete -from typing import Final +from typing import Final, TypedDict, overload, type_check_only +from typing_extensions import LiteralString, NotRequired -PLAT_SPEC_TO_RUNTIME: Final[dict[str, str]] +if sys.platform == "win32": + import winreg as winreg + from os import environ as environ +else: + class winreg: + HKEY_USERS: Final[None] + HKEY_CURRENT_USER: Final[None] + HKEY_LOCAL_MACHINE: Final[None] + HKEY_CLASSES_ROOT: Final[None] -def msvc14_get_vc_env(plat_spec: str) -> dict[str, Incomplete]: ... + environ: dict[str, str] class PlatformInfo: - current_cpu: Incomplete - arch: Incomplete - def __init__(self, arch) -> None: ... - @property - def target_cpu(self): ... - def target_is_x86(self): ... - def current_is_x86(self): ... - def current_dir(self, hidex86: bool = False, x64: bool = False): ... - def target_dir(self, hidex86: bool = False, x64: bool = False): ... - def cross_dir(self, forcex86: bool = False): ... + current_cpu: Final[str] + + arch: str + + def __init__(self, arch: str) -> None: ... + @property + def target_cpu(self) -> str: ... + def target_is_x86(self) -> bool: ... + def current_is_x86(self) -> bool: ... + def current_dir(self, hidex86: bool = False, x64: bool = False) -> str: ... + def target_dir(self, hidex86: bool = False, x64: bool = False) -> str: ... + def cross_dir(self, forcex86: bool = False) -> str: ... class RegistryInfo: if sys.platform == "win32": @@ -24,118 +34,134 @@ class RegistryInfo: else: HKEYS: Final[tuple[None, None, None, None]] - pi: Incomplete - def __init__(self, platform_info) -> None: ... + pi: PlatformInfo + + def __init__(self, platform_info: PlatformInfo) -> None: ... @property - def visualstudio(self): ... + def visualstudio(self) -> LiteralString: ... @property - def sxs(self): ... + def sxs(self) -> LiteralString: ... @property - def vc(self): ... + def vc(self) -> LiteralString: ... @property - def vs(self): ... + def vs(self) -> LiteralString: ... @property - def vc_for_python(self): ... + def vc_for_python(self) -> LiteralString: ... @property - def microsoft_sdk(self): ... + def microsoft_sdk(self) -> LiteralString: ... @property - def windows_sdk(self): ... + def windows_sdk(self) -> LiteralString: ... @property - def netfx_sdk(self): ... + def netfx_sdk(self) -> LiteralString: ... @property - def windows_kits_roots(self): ... - def microsoft(self, key, x86: bool = False): ... - def lookup(self, key, name): ... + def windows_kits_roots(self) -> LiteralString: ... + @overload + def microsoft(self, key: LiteralString, x86: bool = False) -> LiteralString: ... + @overload + def microsoft(self, key: str, x86: bool = False) -> str: ... # type: ignore[misc] + def lookup(self, key: str, name: str) -> str: ... class SystemInfo: - WinDir: Incomplete - ProgramFiles: Incomplete - ProgramFilesx86: Incomplete - ri: Incomplete - pi: Incomplete - known_vs_paths: Incomplete - vs_ver: Incomplete - def __init__(self, registry_info, vc_ver: Incomplete | None = None) -> None: ... - def find_reg_vs_vers(self): ... - def find_programdata_vs_vers(self): ... + WinDir: Final[str] + ProgramFiles: Final[str] + ProgramFilesx86: Final[str] + + ri: RegistryInfo + pi: PlatformInfo + known_vs_paths: dict[float, str] + vs_ver: float + vc_ver: float + + def __init__(self, registry_info: RegistryInfo, vc_ver: float | None = None) -> None: ... + def find_reg_vs_vers(self) -> list[float]: ... + def find_programdata_vs_vers(self) -> dict[float, str]: ... @property - def VSInstallDir(self): ... + def VSInstallDir(self) -> str: ... @property - def VCInstallDir(self): ... + def VCInstallDir(self) -> str: ... @property - def WindowsSdkVersion(self): ... + def WindowsSdkVersion(self) -> tuple[str, ...] | None: ... @property - def WindowsSdkLastVersion(self): ... + def WindowsSdkLastVersion(self) -> str: ... @property - def WindowsSdkDir(self): ... + def WindowsSdkDir(self) -> str: ... @property - def WindowsSDKExecutablePath(self): ... + def WindowsSDKExecutablePath(self) -> str | None: ... @property - def FSharpInstallDir(self): ... + def FSharpInstallDir(self) -> str: ... @property - def UniversalCRTSdkDir(self): ... + def UniversalCRTSdkDir(self) -> str | None: ... @property - def UniversalCRTSdkLastVersion(self): ... + def UniversalCRTSdkLastVersion(self) -> str: ... @property - def NetFxSdkVersion(self): ... + def NetFxSdkVersion(self) -> tuple[str, ...]: ... @property - def NetFxSdkDir(self): ... + def NetFxSdkDir(self) -> str: ... @property - def FrameworkDir32(self): ... + def FrameworkDir32(self) -> str: ... @property - def FrameworkDir64(self): ... + def FrameworkDir64(self) -> str: ... @property - def FrameworkVersion32(self): ... + def FrameworkVersion32(self) -> tuple[str, ...] | None: ... @property - def FrameworkVersion64(self): ... + def FrameworkVersion64(self) -> tuple[str, ...] | None: ... + +@type_check_only +class _EnvironmentDict(TypedDict): + include: str + lib: str + libpath: str + path: str + py_vcruntime_redist: NotRequired[str | None] class EnvironmentInfo: - pi: Incomplete - ri: Incomplete - si: Incomplete - def __init__(self, arch, vc_ver: Incomplete | None = None, vc_min_ver: float = 0) -> None: ... + pi: PlatformInfo + ri: RegistryInfo + si: SystemInfo + + def __init__(self, arch: str, vc_ver: float | None = None, vc_min_ver: float = 0) -> None: ... @property - def vs_ver(self): ... + def vs_ver(self) -> float: ... @property - def vc_ver(self): ... + def vc_ver(self) -> float: ... @property - def VSTools(self): ... + def VSTools(self) -> list[str]: ... @property - def VCIncludes(self): ... + def VCIncludes(self) -> list[str]: ... @property - def VCLibraries(self): ... + def VCLibraries(self) -> list[str]: ... @property - def VCStoreRefs(self): ... + def VCStoreRefs(self) -> list[str]: ... @property - def VCTools(self): ... + def VCTools(self) -> list[str]: ... @property - def OSLibraries(self): ... + def OSLibraries(self) -> list[str]: ... @property - def OSIncludes(self): ... + def OSIncludes(self) -> list[str]: ... @property - def OSLibpath(self): ... + def OSLibpath(self) -> list[str]: ... @property - def SdkTools(self): ... + def SdkTools(self) -> list[str]: ... @property - def SdkSetup(self): ... + def SdkSetup(self) -> list[str]: ... @property - def FxTools(self): ... + def FxTools(self) -> list[str]: ... @property - def NetFxSDKLibraries(self): ... + def NetFxSDKLibraries(self) -> list[str]: ... @property - def NetFxSDKIncludes(self): ... + def NetFxSDKIncludes(self) -> list[str]: ... @property - def VsTDb(self): ... + def VsTDb(self) -> list[str]: ... @property - def MSBuild(self): ... + def MSBuild(self) -> list[str]: ... @property - def HTMLHelpWorkshop(self): ... + def HTMLHelpWorkshop(self) -> list[str]: ... @property - def UCRTLibraries(self): ... + def UCRTLibraries(self) -> list[str]: ... @property - def UCRTIncludes(self): ... + def UCRTIncludes(self) -> list[str]: ... @property - def FSharp(self): ... + def FSharp(self) -> list[str]: ... @property - def VCRuntimeRedist(self): ... - def return_env(self, exists: bool = True): ... + def VCRuntimeRedist(self) -> str | None: ... + def return_env(self, exists: bool = True) -> _EnvironmentDict: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/package_index.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/package_index.pyi index 833741ac7602..802486e2ae20 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/package_index.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/package_index.pyi @@ -4,6 +4,7 @@ from _typeshed import Incomplete from hashlib import _Hash from re import Pattern from typing import ClassVar +from typing_extensions import NamedTuple from pkg_resources import Environment @@ -83,11 +84,9 @@ class PackageIndex(Environment): def info(self, msg, *args) -> None: ... def warn(self, msg, *args) -> None: ... -class Credential: - username: Incomplete - password: Incomplete - def __init__(self, username, password) -> None: ... - def __iter__(self): ... +class Credential(NamedTuple): + username: str + password: str class PyPIConfig(configparser.RawConfigParser): def __init__(self) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/sandbox.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/sandbox.pyi index a1c47b0eb7c0..54b155308fbc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/sandbox.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/sandbox.pyi @@ -1,4 +1,5 @@ import sys +from _typeshed import Unused from types import TracebackType from typing import ClassVar, Literal from typing_extensions import Self @@ -22,9 +23,7 @@ def run_setup(setup_script, args): ... class AbstractSandbox: def __enter__(self) -> None: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None - ) -> None: ... + def __exit__(self, exc_type: Unused, exc_value: Unused, traceback: Unused) -> None: ... def run(self, func): ... # Dynamically created if sys.platform == "win32": diff --git a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/windows_support.pyi b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/windows_support.pyi index ec0c7586238b..7daf9e3a66cc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/windows_support.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/setuptools/setuptools/windows_support.pyi @@ -1,2 +1,2 @@ def windows_only(func): ... -def hide_file(path) -> None: ... +def hide_file(path: str) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/METADATA.toml new file mode 100644 index 000000000000..d48c138f48ab --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/METADATA.toml @@ -0,0 +1,2 @@ +version = "2.4.*" +upstream_repository = "https://gitlab.com/deliberist-group/xdgenvpy" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/xdgenvpy/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/xdgenvpy/__init__.pyi new file mode 100644 index 000000000000..6eeda1233209 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/xdgenvpy/__init__.pyi @@ -0,0 +1,3 @@ +from xdgenvpy.xdgenv import XDG as XDG, XDGPackage as XDGPackage, XDGPedanticPackage as XDGPedanticPackage + +__all__ = ("XDG", "XDGPackage", "XDGPedanticPackage") diff --git a/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/xdgenvpy/_defaults.pyi b/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/xdgenvpy/_defaults.pyi new file mode 100644 index 000000000000..169964d3e341 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/xdgenvpy/_defaults.pyi @@ -0,0 +1,7 @@ +def system_path_separator() -> str: ... +def XDG_DATA_HOME() -> str: ... +def XDG_CONFIG_HOME() -> str: ... +def XDG_CACHE_HOME() -> str: ... +def XDG_RUNTIME_DIR() -> str: ... +def XDG_DATA_DIRS() -> str: ... +def XDG_CONFIG_DIRS() -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/xdgenvpy/xdgenv.pyi b/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/xdgenvpy/xdgenv.pyi new file mode 100644 index 000000000000..46ec0311d8ce --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/xdgenvpy/xdgenvpy/xdgenv.pyi @@ -0,0 +1,35 @@ +class XDG: + def __init__(self) -> None: ... + @property + def XDG_DATA_HOME(self) -> str: ... + @property + def XDG_CONFIG_HOME(self) -> str: ... + @property + def XDG_CACHE_HOME(self) -> str: ... + @property + def XDG_RUNTIME_DIR(self) -> str: ... + @property + def XDG_DATA_DIRS(self) -> tuple[str, ...]: ... + @property + def XDG_CONFIG_DIRS(self) -> tuple[str, ...]: ... + +class XDGPackage(XDG): + def __init__(self, package_name: str) -> None: ... + @property + def XDG_DATA_HOME(self) -> str: ... + @property + def XDG_CONFIG_HOME(self) -> str: ... + @property + def XDG_CACHE_HOME(self) -> str: ... + @property + def XDG_RUNTIME_DIR(self) -> str: ... + +class XDGPedanticPackage(XDGPackage): + @property + def XDG_DATA_HOME(self) -> str: ... + @property + def XDG_CONFIG_HOME(self) -> str: ... + @property + def XDG_CACHE_HOME(self) -> str: ... + @property + def XDG_RUNTIME_DIR(self) -> str: ...