diff --git a/packages/pyright-internal/typeshed-fallback/commit.txt b/packages/pyright-internal/typeshed-fallback/commit.txt index 36914fa18b84..cab255c4f32d 100644 --- a/packages/pyright-internal/typeshed-fallback/commit.txt +++ b/packages/pyright-internal/typeshed-fallback/commit.txt @@ -1 +1 @@ -6a94c9d677db9e9f85d764cc46294fd5c5e2a4b8 +4290a25727800902d1733bf41fbc4300d2567c70 diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/argparse.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/argparse.pyi index 8e6f9da8ef26..e41048516dd9 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/argparse.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/argparse.pyi @@ -169,9 +169,9 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): add_help: bool = True, allow_abbrev: bool = True, ) -> None: ... - # Ignore errors about overlapping overloads + @overload - def parse_args(self, args: Sequence[str] | None = None, namespace: None = None) -> Namespace: ... # type: ignore[misc] + def parse_args(self, args: Sequence[str] | None = None, namespace: Namespace | None = None) -> Namespace: ... # type: ignore[misc] @overload def parse_args(self, args: Sequence[str] | None, namespace: _N) -> _N: ... @overload @@ -209,16 +209,27 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def print_help(self, file: IO[str] | None = None) -> None: ... def format_usage(self) -> str: ... def format_help(self) -> str: ... - def parse_known_args( - self, args: Sequence[str] | None = None, namespace: Namespace | None = None - ) -> tuple[Namespace, list[str]]: ... + @overload + def parse_known_args(self, args: Sequence[str] | None = None, namespace: Namespace | None = None) -> tuple[Namespace, list[str]]: ... # type: ignore[misc] + @overload + def parse_known_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]: ... + @overload + def parse_known_args(self, *, namespace: _N) -> tuple[_N, list[str]]: ... def convert_arg_line_to_args(self, arg_line: str) -> list[str]: ... def exit(self, status: int = 0, message: str | None = None) -> NoReturn: ... def error(self, message: str) -> NoReturn: ... - def parse_intermixed_args(self, args: Sequence[str] | None = None, namespace: Namespace | None = None) -> Namespace: ... - def parse_known_intermixed_args( - self, args: Sequence[str] | None = None, namespace: Namespace | None = None - ) -> tuple[Namespace, list[str]]: ... + @overload + def parse_intermixed_args(self, args: Sequence[str] | None = None, namespace: Namespace | None = None) -> Namespace: ... # type: ignore[misc] + @overload + def parse_intermixed_args(self, args: Sequence[str] | None, namespace: _N) -> _N: ... + @overload + def parse_intermixed_args(self, *, namespace: _N) -> _N: ... + @overload + def parse_known_intermixed_args(self, args: Sequence[str] | None = None, namespace: Namespace | None = None) -> tuple[Namespace, list[str]]: ... # type: ignore[misc] + @overload + def parse_known_intermixed_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]: ... + @overload + def parse_known_intermixed_args(self, *, namespace: _N) -> tuple[_N, list[str]]: ... # undocumented def _get_optional_actions(self) -> list[Action]: ... def _get_positional_actions(self) -> list[Action]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/inspect.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/inspect.pyi index 2d004a8e6b57..2b07200f18ae 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/inspect.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/inspect.pyi @@ -2,6 +2,7 @@ import dis import enum import sys import types +from _typeshed import StrPath from collections import OrderedDict from collections.abc import AsyncGenerator, Awaitable, Callable, Coroutine, Generator, Mapping, Sequence, Set as AbstractSet from types import ( @@ -177,7 +178,7 @@ if sys.version_info >= (3, 11): @overload def getmembers_static(object: object, predicate: _GetMembersPredicate | None = None) -> _GetMembersReturn: ... -def getmodulename(path: str) -> str | None: ... +def getmodulename(path: StrPath) -> str | None: ... def ismodule(object: object) -> TypeGuard[ModuleType]: ... def isclass(object: object) -> TypeGuard[type[Any]]: ... def ismethod(object: object) -> TypeGuard[MethodType]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/shutil.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/shutil.pyi index ef716d4049dd..38c50d51b129 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/shutil.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/shutil.pyi @@ -2,6 +2,7 @@ import os import sys from _typeshed import BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath, SupportsRead, SupportsWrite from collections.abc import Callable, Iterable, Sequence +from tarfile import _TarfileFilter from typing import Any, AnyStr, NamedTuple, Protocol, TypeVar, overload from typing_extensions import TypeAlias @@ -192,9 +193,9 @@ def register_archive_format( ) -> None: ... def unregister_archive_format(name: str) -> None: ... -if sys.version_info >= (3, 12): +if sys.version_info >= (3, 8): def unpack_archive( - filename: StrPath, extract_dir: StrPath | None = None, format: str | None = None, *, filter: str | None = None + filename: StrPath, extract_dir: StrPath | None = None, format: str | None = None, *, filter: _TarfileFilter | None = None ) -> None: ... else: diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tarfile.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tarfile.pyi index 5cf1d55cac63..d9d9641ac698 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tarfile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tarfile.pyi @@ -7,7 +7,7 @@ from collections.abc import Callable, Iterable, Iterator, Mapping from gzip import _ReadableFileobj as _GzipReadableFileobj, _WritableFileobj as _GzipWritableFileobj from types import TracebackType from typing import IO, ClassVar, Protocol, overload -from typing_extensions import Literal, Self +from typing_extensions import Literal, Self, TypeAlias __all__ = [ "TarFile", @@ -26,6 +26,21 @@ __all__ = [ "DEFAULT_FORMAT", "open", ] +if sys.version_info >= (3, 12): + __all__ += [ + "fully_trusted_filter", + "data_filter", + "tar_filter", + "FilterError", + "AbsoluteLinkError", + "OutsideDestinationError", + "SpecialFileError", + "AbsolutePathError", + "LinkOutsideDestinationError", + ] + +_FilterFunction: TypeAlias = Callable[[TarInfo, str], TarInfo | None] +_TarfileFilter: TypeAlias = Literal["fully_trusted", "tar", "data"] | _FilterFunction class _Fileobj(Protocol): def read(self, __size: int) -> bytes: ... @@ -125,6 +140,7 @@ class TarFile: debug: int | None errorlevel: int | None offset: int # undocumented + extraction_filter: _FilterFunction | None def __init__( self, name: StrOrBytesPath | None = None, @@ -275,12 +291,32 @@ class TarFile: def getnames(self) -> _list[str]: ... def list(self, verbose: bool = True, *, members: _list[TarInfo] | None = None) -> None: ... def next(self) -> TarInfo | None: ... - def extractall( - self, path: StrOrBytesPath = ".", members: Iterable[TarInfo] | None = None, *, numeric_owner: bool = False - ) -> None: ... - def extract( - self, member: str | TarInfo, path: StrOrBytesPath = "", set_attrs: bool = True, *, numeric_owner: bool = False - ) -> None: ... + if sys.version_info >= (3, 8): + def extractall( + self, + path: StrOrBytesPath = ".", + members: Iterable[TarInfo] | None = None, + *, + numeric_owner: bool = False, + filter: _TarfileFilter | None = ..., + ) -> None: ... + def extract( + self, + member: str | TarInfo, + path: StrOrBytesPath = "", + set_attrs: bool = True, + *, + numeric_owner: bool = False, + filter: _TarfileFilter | None = ..., + ) -> None: ... + else: + def extractall( + self, path: StrOrBytesPath = ".", members: Iterable[TarInfo] | None = None, *, numeric_owner: bool = False + ) -> None: ... + def extract( + self, member: str | TarInfo, path: StrOrBytesPath = "", set_attrs: bool = True, *, numeric_owner: bool = False + ) -> None: ... + def _extract_member( self, tarinfo: TarInfo, targetpath: str, set_attrs: bool = True, numeric_owner: bool = False ) -> None: ... # undocumented @@ -324,6 +360,31 @@ class StreamError(TarError): ... class ExtractError(TarError): ... class HeaderError(TarError): ... +if sys.version_info >= (3, 8): + class FilterError(TarError): + # This attribute is only set directly on the subclasses, but the documentation guarantees + # that it is always present on FilterError. + tarinfo: TarInfo + + class AbsolutePathError(FilterError): + def __init__(self, tarinfo: TarInfo) -> None: ... + + class OutsideDestinationError(FilterError): + def __init__(self, tarinfo: TarInfo, path: str) -> None: ... + + class SpecialFileError(FilterError): + def __init__(self, tarinfo: TarInfo) -> None: ... + + class AbsoluteLinkError(FilterError): + def __init__(self, tarinfo: TarInfo) -> None: ... + + class LinkOutsideDestinationError(FilterError): + def __init__(self, tarinfo: TarInfo, path: str) -> None: ... + + def fully_trusted_filter(member: TarInfo, dest_path: str) -> TarInfo: ... + def tar_filter(member: TarInfo, dest_path: str) -> TarInfo: ... + def data_filter(member: TarInfo, dest_path: str) -> TarInfo: ... + class TarInfo: name: str path: str @@ -353,6 +414,21 @@ class TarInfo: def linkpath(self) -> str: ... @linkpath.setter def linkpath(self, linkname: str) -> None: ... + if sys.version_info >= (3, 8): + def replace( + self, + *, + name: str = ..., + mtime: int = ..., + mode: int = ..., + linkname: str = ..., + uid: int = ..., + gid: int = ..., + uname: str = ..., + gname: str = ..., + deep: bool = True, + ) -> Self: ... + def get_info(self) -> Mapping[str, str | int | bytes | Mapping[str, str]]: ... if sys.version_info >= (3, 8): def tobuf(self, format: int | None = 2, encoding: str | None = "utf-8", errors: str = "surrogateescape") -> bytes: ... diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/tempfile.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/tempfile.pyi index eca58a3720db..b251f8b9d029 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/tempfile.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/tempfile.pyi @@ -191,6 +191,17 @@ else: errors: str | None = None, ) -> io.FileIO: ... @overload + def TemporaryFile( + *, + buffering: Literal[0], + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + errors: str | None = None, + ) -> io.FileIO: ... + @overload def TemporaryFile( mode: OpenBinaryModeWriting, buffering: Literal[-1, 1] = -1, @@ -260,6 +271,16 @@ else: dir: GenericPath[AnyStr] | None = None, ) -> io.FileIO: ... @overload + def TemporaryFile( + *, + buffering: Literal[0], + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + ) -> io.FileIO: ... + @overload def TemporaryFile( mode: OpenBinaryModeUpdating = "w+b", buffering: Literal[-1, 1] = -1, diff --git a/packages/pyright-internal/typeshed-fallback/stdlib/zoneinfo/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stdlib/zoneinfo/__init__.pyi index fe994be3e8ff..a95530ed461a 100644 --- a/packages/pyright-internal/typeshed-fallback/stdlib/zoneinfo/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stdlib/zoneinfo/__init__.pyi @@ -17,9 +17,9 @@ class ZoneInfo(tzinfo): @classmethod def no_cache(cls, key: str) -> Self: ... @classmethod - def from_file(cls, __fobj: _IOBytes, key: str | None = ...) -> Self: ... + def from_file(cls, __fobj: _IOBytes, key: str | None = None) -> Self: ... @classmethod - def clear_cache(cls, *, only_keys: Iterable[str] | None = ...) -> None: ... + def clear_cache(cls, *, only_keys: Iterable[str] | None = None) -> None: ... def tzname(self, __dt: datetime | None) -> str | None: ... def utcoffset(self, __dt: datetime | None) -> timedelta | None: ... def dst(self, __dt: datetime | None) -> timedelta | None: ... @@ -30,7 +30,7 @@ class ZoneInfo(tzinfo): def reset_tzpath(to: Sequence[StrPath] | None = None) -> None: ... def available_timezones() -> set[str]: ... -TZPATH: Sequence[str] +TZPATH: tuple[str, ...] class ZoneInfoNotFoundError(KeyError): ... class InvalidTZPathWarning(RuntimeWarning): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/METADATA.toml new file mode 100644 index 000000000000..690242a33e3e --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/METADATA.toml @@ -0,0 +1 @@ +version = "1.8.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/__init__.pyi new file mode 100644 index 000000000000..308be3055c80 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/__init__.pyi @@ -0,0 +1,13 @@ +from webob.datetime_utils import ( + UTC as UTC, + day as day, + hour as hour, + minute as minute, + month as month, + second as second, + week as week, + year as year, +) +from webob.request import LegacyRequest as LegacyRequest, Request as Request +from webob.response import Response as Response +from webob.util import html_escape as html_escape diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/acceptparse.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/acceptparse.pyi new file mode 100644 index 000000000000..4dba5387c28a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/acceptparse.pyi @@ -0,0 +1,503 @@ +from _typeshed import SupportsItems +from collections.abc import Callable, Iterable, Iterator +from typing import Any, NamedTuple, TypeVar, overload +from typing_extensions import Literal, Self, TypeAlias + +_T = TypeVar("_T") +_ListOrTuple: TypeAlias = list[_T] | tuple[_T, ...] +_ParsedAccept: TypeAlias = tuple[str, float, list[tuple[str, str]], list[str | tuple[str, str]]] + +class AcceptOffer(NamedTuple): + type: str + subtype: str + params: tuple[tuple[str, str], ...] + +class Accept: + @classmethod + def parse(cls, value: str) -> Iterator[_ParsedAccept]: ... + @classmethod + def parse_offer(cls, offer: str | AcceptOffer) -> AcceptOffer: ... + +class AcceptValidHeader(Accept): + @property + def header_value(self) -> str: ... + @property + def parsed(self) -> list[_ParsedAccept] | None: ... + def __init__(self, header_value: str) -> None: ... + def copy(self) -> Self: ... + @overload + def __add__(self, other: str | None) -> Self: ... + @overload + def __add__(self, other: AcceptNoHeader | AcceptValidHeader | AcceptInvalidHeader) -> Self: ... + @overload + def __add__(self, other: SupportsItems[str, float | tuple[float, str]]) -> Self: ... + @overload + def __add__(self, other: _ListOrTuple[str | tuple[str, float, str] | list[Any]]) -> Self: ... + def __bool__(self) -> Literal[True]: ... + def __contains__(self, offer: str) -> bool: ... + def __iter__(self) -> Iterator[str]: ... + @overload + def __radd__(self, other: str | None) -> Self: ... + @overload + def __radd__(self, other: SupportsItems[str, float | tuple[float, str]]) -> Self: ... + @overload + def __radd__(self, other: _ListOrTuple[str | tuple[str, float, str] | list[Any]]) -> Self: ... + def accept_html(self) -> bool: ... + @property + def accepts_html(self) -> bool: ... + def acceptable_offers(self, offers: Iterable[str | AcceptOffer]) -> list[tuple[str, float]]: ... + @overload + def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: None = None) -> str | None: ... + @overload + def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: str) -> str: ... + def quality(self, offer: str) -> float | None: ... + +class _AcceptInvalidOrNoHeader(Accept): + @property + def parsed(self) -> None: ... + def copy(self) -> Self: ... + @overload + def __add__(self, other: None) -> AcceptNoHeader: ... + @overload + def __add__(self, other: str) -> AcceptValidHeader | AcceptNoHeader: ... + @overload + def __add__(self, other: AcceptValidHeader) -> AcceptValidHeader: ... + @overload + def __add__(self, other: AcceptNoHeader | AcceptInvalidHeader) -> AcceptNoHeader: ... + @overload + def __add__(self, other: SupportsItems[str, float | tuple[float, str]]) -> AcceptValidHeader | AcceptNoHeader: ... + @overload + def __add__(self, other: _ListOrTuple[str | tuple[str, float, str] | list[Any]]) -> AcceptValidHeader | AcceptNoHeader: ... + @overload + def __radd__(self, other: None) -> AcceptNoHeader: ... + @overload + def __radd__(self, other: str) -> AcceptValidHeader | AcceptNoHeader: ... + @overload + def __radd__(self, other: AcceptValidHeader) -> AcceptValidHeader: ... + @overload + def __radd__(self, other: AcceptNoHeader | AcceptInvalidHeader) -> AcceptNoHeader: ... + @overload + def __radd__(self, other: SupportsItems[str, float | tuple[float, str]]) -> AcceptValidHeader | AcceptNoHeader: ... + @overload + def __radd__(self, other: _ListOrTuple[str | tuple[str, float, str] | list[Any]]) -> AcceptValidHeader | AcceptNoHeader: ... + def __bool__(self) -> Literal[False]: ... + def __contains__(self, offer: str) -> Literal[True]: ... + def __iter__(self) -> Iterator[str]: ... + def accept_html(self) -> bool: ... + @property + def accepts_html(self) -> bool: ... + def acceptable_offers(self, offers: Iterable[str | AcceptOffer]) -> list[tuple[str, float]]: ... + @overload + def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: None = None) -> str | None: ... + @overload + def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: str) -> str: ... + def quality(self, offer: str) -> float: ... + +class AcceptNoHeader(_AcceptInvalidOrNoHeader): + @property + def header_value(self) -> None: ... + def __init__(self) -> None: ... + +class AcceptInvalidHeader(_AcceptInvalidOrNoHeader): + @property + def header_value(self) -> str: ... + def __init__(self, header_value: str) -> None: ... + +@overload +def create_accept_header(header_value: None) -> AcceptNoHeader: ... +@overload +def create_accept_header(header_value: str) -> AcceptValidHeader | AcceptInvalidHeader: ... + +class _AcceptProperty: + @overload + def __get__(self, __obj: None, __type: type | None = ...) -> property: ... + @overload + def __get__(self, __obj: Any, __type: type | None = ...) -> AcceptNoHeader | AcceptValidHeader | AcceptInvalidHeader: ... + @overload + def __set__(self, __obj: Any, __value: str | None) -> None: ... + @overload + def __set__(self, __obj: Any, __value: AcceptNoHeader | AcceptValidHeader | AcceptInvalidHeader) -> None: ... + @overload + def __set__(self, __obj: Any, __value: SupportsItems[str, float | tuple[float, str]]) -> None: ... + @overload + def __set__(self, __obj: Any, __value: _ListOrTuple[str | tuple[str, float, str] | list[Any]]) -> None: ... + def __delete__(self, __obj: Any) -> None: ... + +def accept_property() -> _AcceptProperty: ... + +class AcceptCharset: + @classmethod + def parse(cls, value: str) -> Iterator[tuple[str, float]]: ... + +class AcceptCharsetValidHeader(AcceptCharset): + @property + def header_value(self) -> str: ... + @property + def parsed(self) -> list[tuple[str, float]]: ... + def __init__(self, header_value: str) -> None: ... + def copy(self) -> Self: ... + @overload + def __add__(self, other: str | None) -> Self: ... + @overload + def __add__(self, other: AcceptCharsetValidHeader | AcceptCharsetNoHeader | AcceptCharsetInvalidHeader) -> Self: ... + @overload + def __add__(self, other: SupportsItems[str, float]) -> Self: ... + @overload + def __add__(self, other: _ListOrTuple[str | tuple[str, float] | list[Any]]) -> Self: ... + def __bool__(self) -> Literal[True]: ... + def __contains__(self, offer: str) -> bool: ... + def __iter__(self) -> Iterator[str]: ... + @overload + def __radd__(self, other: str | None) -> Self: ... + @overload + def __radd__(self, other: AcceptCharsetValidHeader | AcceptCharsetNoHeader | AcceptCharsetInvalidHeader) -> Self: ... + @overload + def __radd__(self, other: SupportsItems[str, float]) -> Self: ... + @overload + def __radd__(self, other: _ListOrTuple[str | tuple[str, float] | list[Any]]) -> Self: ... + def acceptable_offers(self, offers: Iterable[str]) -> list[tuple[str, float]]: ... + @overload + def best_match(self, offers: Iterable[str], default_match: None = None) -> str | None: ... + @overload + def best_match(self, offers: Iterable[str], default_match: str) -> str: ... + def quality(self, offer: str) -> float | None: ... + +class _AcceptCharsetInvalidOrNoHeader(AcceptCharset): + @property + def parsed(self) -> None: ... + def __bool__(self) -> Literal[False]: ... + def __contains__(self, offer: str) -> Literal[True]: ... + def __iter__(self) -> Iterator[str]: ... + @overload + def __add__(self, other: None) -> AcceptCharsetNoHeader: ... + @overload + def __add__(self, other: str) -> AcceptCharsetValidHeader | AcceptCharsetNoHeader: ... + @overload + def __add__(self, other: AcceptCharsetValidHeader) -> AcceptCharsetValidHeader: ... + @overload + def __add__(self, other: AcceptCharsetNoHeader | AcceptCharsetInvalidHeader) -> AcceptCharsetNoHeader: ... + @overload + def __add__(self, other: SupportsItems[str, float]) -> AcceptCharsetValidHeader | AcceptCharsetNoHeader: ... + @overload + def __add__( + self, other: _ListOrTuple[str | tuple[str, float] | list[Any]] + ) -> AcceptCharsetValidHeader | AcceptCharsetNoHeader: ... + @overload + def __radd__(self, other: None) -> AcceptCharsetNoHeader: ... + @overload + def __radd__(self, other: str) -> AcceptCharsetValidHeader | AcceptCharsetNoHeader: ... + @overload + def __radd__(self, other: AcceptCharsetValidHeader) -> AcceptCharsetValidHeader: ... + @overload + def __radd__(self, other: AcceptCharsetNoHeader | AcceptCharsetInvalidHeader) -> AcceptCharsetNoHeader: ... + @overload + def __radd__(self, other: SupportsItems[str, float]) -> AcceptCharsetValidHeader | AcceptCharsetNoHeader: ... + @overload + def __radd__( + self, other: _ListOrTuple[str | tuple[str, float] | list[Any]] + ) -> AcceptCharsetValidHeader | AcceptCharsetNoHeader: ... + def copy(self) -> Self: ... + def acceptable_offers(self, offers: Iterable[str]) -> list[tuple[str, float]]: ... + @overload + def best_match(self, offers: Iterable[str], default_match: None = None) -> str | None: ... + @overload + def best_match(self, offers: Iterable[str], default_match: str) -> str: ... + def quality(self, offer: str) -> float | None: ... + +class AcceptCharsetNoHeader(_AcceptCharsetInvalidOrNoHeader): + @property + def header_value(self) -> None: ... + def __init__(self) -> None: ... + +class AcceptCharsetInvalidHeader(_AcceptCharsetInvalidOrNoHeader): + @property + def header_value(self) -> str: ... + def __init__(self, header_value: str) -> None: ... + +@overload +def create_accept_charset_header(header_value: None) -> AcceptCharsetNoHeader: ... +@overload +def create_accept_charset_header(header_value: str) -> AcceptCharsetValidHeader | AcceptCharsetInvalidHeader: ... + +class _AcceptCharsetProperty: + @overload + def __get__(self, __obj: None, __type: type | None = ...) -> property: ... + @overload + def __get__( + self, __obj: Any, __type: type | None = ... + ) -> AcceptCharsetNoHeader | AcceptCharsetValidHeader | AcceptCharsetInvalidHeader: ... + @overload + def __set__(self, __obj: Any, __value: str | None) -> None: ... + @overload + def __set__( + self, __obj: Any, __value: AcceptCharsetNoHeader | AcceptCharsetValidHeader | AcceptCharsetInvalidHeader + ) -> None: ... + @overload + def __set__(self, __obj: Any, __value: SupportsItems[str, float]) -> None: ... + @overload + def __set__(self, __obj: Any, __value: _ListOrTuple[str | tuple[str, float] | list[Any]]) -> None: ... + def __delete__(self, __obj: Any) -> None: ... + +def accept_charset_property() -> _AcceptCharsetProperty: ... + +class AcceptEncoding: + @classmethod + def parse(cls, value: str) -> Iterator[tuple[str, float]]: ... + +class AcceptEncodingValidHeader(AcceptEncoding): + @property + def header_value(self) -> str: ... + @property + def parsed(self) -> list[tuple[str, float]]: ... + def __init__(self, header_value: str) -> None: ... + def copy(self) -> Self: ... + @overload + def __add__(self, other: str | None) -> Self: ... + @overload + def __add__(self, other: AcceptEncodingValidHeader | AcceptEncodingNoHeader | AcceptEncodingInvalidHeader) -> Self: ... + @overload + def __add__(self, other: SupportsItems[str, float]) -> Self: ... + @overload + def __add__(self, other: _ListOrTuple[str | tuple[str, float] | list[Any]]) -> Self: ... + def __bool__(self) -> Literal[True]: ... + def __contains__(self, offer: str) -> bool: ... + def __iter__(self) -> Iterator[str]: ... + @overload + def __radd__(self, other: str | None) -> Self: ... + @overload + def __radd__(self, other: AcceptEncodingValidHeader | AcceptEncodingNoHeader | AcceptEncodingInvalidHeader) -> Self: ... + @overload + def __radd__(self, other: SupportsItems[str, float]) -> Self: ... + @overload + def __radd__(self, other: _ListOrTuple[str | tuple[str, float] | list[Any]]) -> Self: ... + def acceptable_offers(self, offers: Iterable[str]) -> list[tuple[str, float]]: ... + @overload + def best_match(self, offers: Iterable[str], default_match: None = None) -> str | None: ... + @overload + def best_match(self, offers: Iterable[str], default_match: str) -> str: ... + def quality(self, offer: str) -> float | None: ... + +class _AcceptEncodingInvalidOrNoHeader(AcceptEncoding): + @property + def parsed(self) -> None: ... + def __bool__(self) -> Literal[False]: ... + def __contains__(self, offer: str) -> Literal[True]: ... + def __iter__(self) -> Iterator[str]: ... + @overload + def __add__(self, other: None) -> AcceptEncodingNoHeader: ... + @overload + def __add__(self, other: str) -> AcceptEncodingValidHeader | AcceptEncodingNoHeader: ... + @overload + def __add__(self, other: AcceptEncodingValidHeader) -> AcceptEncodingValidHeader: ... + @overload + def __add__(self, other: AcceptEncodingNoHeader | AcceptEncodingInvalidHeader) -> AcceptEncodingNoHeader: ... + @overload + def __add__(self, other: SupportsItems[str, float]) -> AcceptEncodingValidHeader | AcceptEncodingNoHeader: ... + @overload + def __add__( + self, other: _ListOrTuple[str | tuple[str, float] | list[Any]] + ) -> AcceptEncodingValidHeader | AcceptEncodingNoHeader: ... + @overload + def __radd__(self, other: None) -> AcceptEncodingNoHeader: ... + @overload + def __radd__(self, other: str) -> AcceptEncodingValidHeader | AcceptEncodingNoHeader: ... + @overload + def __radd__(self, other: AcceptEncodingValidHeader) -> AcceptEncodingValidHeader: ... + @overload + def __radd__(self, other: AcceptEncodingNoHeader | AcceptEncodingInvalidHeader) -> AcceptEncodingNoHeader: ... + @overload + def __radd__(self, other: SupportsItems[str, float]) -> AcceptEncodingValidHeader | AcceptEncodingNoHeader: ... + @overload + def __radd__( + self, other: _ListOrTuple[str | tuple[str, float] | list[Any]] + ) -> AcceptEncodingValidHeader | AcceptEncodingNoHeader: ... + def copy(self) -> Self: ... + def acceptable_offers(self, offers: Iterable[str]) -> list[tuple[str, float]]: ... + @overload + def best_match(self, offers: Iterable[str], default_match: None = None) -> str | None: ... + @overload + def best_match(self, offers: Iterable[str], default_match: str) -> str: ... + def quality(self, offer: str) -> float | None: ... + +class AcceptEncodingNoHeader(_AcceptEncodingInvalidOrNoHeader): + @property + def header_value(self) -> None: ... + def __init__(self) -> None: ... + +class AcceptEncodingInvalidHeader(_AcceptEncodingInvalidOrNoHeader): + @property + def header_value(self) -> str: ... + def __init__(self, header_value: str) -> None: ... + +@overload +def create_accept_encoding_header(header_value: None) -> AcceptEncodingNoHeader: ... +@overload +def create_accept_encoding_header(header_value: str) -> AcceptEncodingValidHeader | AcceptEncodingInvalidHeader: ... + +class _AcceptEncodingProperty: + @overload + def __get__(self, __obj: None, __type: type | None = ...) -> property: ... + @overload + def __get__( + self, __obj: Any, __type: type | None = ... + ) -> AcceptEncodingNoHeader | AcceptEncodingValidHeader | AcceptEncodingInvalidHeader: ... + @overload + def __set__(self, __obj: Any, __value: str | None) -> None: ... + @overload + def __set__( + self, __obj: Any, __value: AcceptEncodingNoHeader | AcceptEncodingValidHeader | AcceptEncodingInvalidHeader + ) -> None: ... + @overload + def __set__(self, __obj: Any, __value: SupportsItems[str, float]) -> None: ... + @overload + def __set__(self, __obj: Any, __value: _ListOrTuple[str | tuple[str, float] | list[Any]]) -> None: ... + def __delete__(self, __obj: Any) -> None: ... + +def accept_encoding_property() -> _AcceptEncodingProperty: ... + +class AcceptLanguage: + @classmethod + def parse(cls, value: str) -> Iterator[tuple[str, float]]: ... + +class AcceptLanguageValidHeader(AcceptLanguage): + @property + def header_value(self) -> str: ... + @property + def parsed(self) -> list[tuple[str, float]]: ... + def __init__(self, header_value: str) -> None: ... + def copy(self) -> Self: ... + @overload + def __add__(self, other: str | None) -> Self: ... + @overload + def __add__(self, other: AcceptLanguageValidHeader | AcceptLanguageNoHeader | AcceptLanguageInvalidHeader) -> Self: ... + @overload + def __add__(self, other: SupportsItems[str, float]) -> Self: ... + @overload + def __add__(self, other: _ListOrTuple[str | tuple[str, float] | list[Any]]) -> Self: ... + def __bool__(self) -> Literal[True]: ... + def __contains__(self, offer: str) -> bool: ... + def __iter__(self) -> Iterator[str]: ... + @overload + def __radd__(self, other: str | None) -> Self: ... + @overload + def __radd__(self, other: AcceptLanguageValidHeader | AcceptLanguageNoHeader | AcceptLanguageInvalidHeader) -> Self: ... + @overload + def __radd__(self, other: SupportsItems[str, float]) -> Self: ... + @overload + def __radd__(self, other: _ListOrTuple[str | tuple[str, float] | list[Any]]) -> Self: ... + def basic_filtering(self, language_tags: Iterable[str]) -> list[tuple[str, float]]: ... + @overload + def best_match(self, offers: Iterable[str], default_match: None = None) -> str | None: ... + @overload + def best_match(self, offers: Iterable[str], default_match: str) -> str: ... + @overload + def lookup( + self, + language_tags: Iterable[str], + default_range: str | None = None, + default_tag: str = ..., + default: str | Callable[[], str | None] | None = None, + ) -> str | None: ... + @overload + def lookup( + self, + language_tags: Iterable[str], + default_range: str | None = None, + default_tag: str | None = None, + default: str | Callable[[], str | None] = ..., + ) -> str | None: ... + def quality(self, offer: str) -> float | None: ... + +class _AcceptLanguageInvalidOrNoHeader(AcceptLanguage): + @property + def parsed(self) -> None: ... + def __bool__(self) -> Literal[False]: ... + def __contains__(self, offer: str) -> Literal[True]: ... + def __iter__(self) -> Iterator[str]: ... + @overload + def __add__(self, other: None) -> AcceptLanguageNoHeader: ... + @overload + def __add__(self, other: str) -> AcceptLanguageValidHeader | AcceptLanguageNoHeader: ... + @overload + def __add__(self, other: AcceptLanguageValidHeader) -> AcceptLanguageValidHeader: ... + @overload + def __add__(self, other: AcceptLanguageNoHeader | AcceptLanguageInvalidHeader) -> AcceptLanguageNoHeader: ... + @overload + def __add__(self, other: SupportsItems[str, float]) -> AcceptLanguageValidHeader | AcceptLanguageNoHeader: ... + @overload + def __add__( + self, other: _ListOrTuple[str | tuple[str, float] | list[Any]] + ) -> AcceptLanguageValidHeader | AcceptLanguageNoHeader: ... + @overload + def __radd__(self, other: None) -> AcceptLanguageNoHeader: ... + @overload + def __radd__(self, other: str) -> AcceptLanguageValidHeader | AcceptLanguageNoHeader: ... + @overload + def __radd__(self, other: AcceptLanguageValidHeader) -> AcceptLanguageValidHeader: ... + @overload + def __radd__(self, other: AcceptLanguageNoHeader | AcceptLanguageInvalidHeader) -> AcceptLanguageNoHeader: ... + @overload + def __radd__(self, other: SupportsItems[str, float]) -> AcceptLanguageValidHeader | AcceptLanguageNoHeader: ... + @overload + def __radd__( + self, other: _ListOrTuple[str | tuple[str, float] | list[Any]] + ) -> AcceptLanguageValidHeader | AcceptLanguageNoHeader: ... + def copy(self) -> Self: ... + def basic_filtering(self, language_tags: Iterable[str]) -> list[tuple[str, float]]: ... + @overload + def best_match(self, offers: Iterable[str], default_match: None = None) -> str | None: ... + @overload + def best_match(self, offers: Iterable[str], default_match: str) -> str: ... + @overload + def lookup( + self, + language_tags: Iterable[str], + default_range: str | None = None, + default_tag: str = ..., + default: str | Callable[[], str | None] | None = None, + ) -> str | None: ... + @overload + def lookup( + self, + language_tags: Iterable[str], + default_range: str | None = None, + default_tag: str | None = None, + default: str | Callable[[], str | None] = ..., + ) -> str | None: ... + def quality(self, offer: str) -> float | None: ... + +class AcceptLanguageNoHeader(_AcceptLanguageInvalidOrNoHeader): + def __init__(self) -> None: ... + @property + def header_value(self) -> None: ... + +class AcceptLanguageInvalidHeader(_AcceptLanguageInvalidOrNoHeader): + def __init__(self, header_value: str) -> None: ... + @property + def header_value(self) -> str: ... + +@overload +def create_accept_language_header(header_value: None) -> AcceptLanguageNoHeader: ... +@overload +def create_accept_language_header(header_value: str) -> AcceptLanguageValidHeader | AcceptLanguageInvalidHeader: ... + +class _AcceptLanguageProperty: + @overload + def __get__(self, __obj: None, __type: type | None = ...) -> property: ... + @overload + def __get__( + self, __obj: Any, __type: type | None = ... + ) -> AcceptLanguageNoHeader | AcceptLanguageValidHeader | AcceptLanguageInvalidHeader: ... + @overload + def __set__(self, __obj: Any, __value: str | None) -> None: ... + @overload + def __set__( + self, __obj: Any, __value: AcceptLanguageNoHeader | AcceptLanguageValidHeader | AcceptLanguageInvalidHeader + ) -> None: ... + @overload + def __set__(self, __obj: Any, __value: SupportsItems[str, float]) -> None: ... + @overload + def __set__(self, __obj: Any, __value: _ListOrTuple[str | tuple[str, float] | list[Any]]) -> None: ... + def __delete__(self, __obj: Any) -> None: ... + +def accept_language_property() -> _AcceptLanguageProperty: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/byterange.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/byterange.pyi new file mode 100644 index 000000000000..c63cf6257f20 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/byterange.pyi @@ -0,0 +1,28 @@ +from collections.abc import Iterator +from typing import overload +from typing_extensions import Self + +class Range: + start: int | None + end: int | None + @overload + def __init__(self, start: None, end: None): ... + @overload + def __init__(self, start: int, end: int | None): ... + def range_for_length(self, length: int | None) -> tuple[int, int] | None: ... + def content_range(self, length: int | None) -> ContentRange | None: ... + def __iter__(self) -> Iterator[int | None]: ... + @classmethod + def parse(cls, header: str | None) -> Self: ... + +class ContentRange: + start: int | None + stop: int | None + length: int | None + @overload + def __init__(self, start: None, stop: None, length: int | None): ... + @overload + def __init__(self, start: int, stop: int, length: int | None): ... + def __iter__(self) -> Iterator[int | None]: ... + @classmethod + def parse(cls, value: str | None) -> Self: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/cachecontrol.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/cachecontrol.pyi new file mode 100644 index 000000000000..9e42ae6058e6 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/cachecontrol.pyi @@ -0,0 +1,96 @@ +from collections.abc import Callable, MutableMapping +from typing import Any, Generic, TypeVar, overload +from typing_extensions import Literal, Self, TypeAlias + +from webob.request import Request +from webob.response import Response + +_T = TypeVar("_T") +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") +_NoneLiteral = TypeVar("_NoneLiteral") +_Type: TypeAlias = type + +class UpdateDict(dict[_KT, _VT]): + updated: Callable[..., Any] | None + updated_args: tuple[Any, ...] | None + +class exists_property: + prop: str + type: str | None + def __init__(self, prop: str, type: str | None = None): ... + @overload + def __get__(self, obj: None, type: _Type | None = None) -> Self: ... + @overload + def __get__(self, obj: Any, type: _Type | None = None) -> bool: ... + def __set__(self, obj: Any, value: bool) -> None: ... + def __delete__(self, obj: Any) -> None: ... + +class value_property(Generic[_T, _NoneLiteral]): + prop: str + default: _T | None + none: _NoneLiteral + type: str | None + @overload + def __init__(self, prop: str, default: None = None, none: None = None, type: str | None = None): ... + @overload + def __init__(self, prop: str, default: _T, none: _NoneLiteral, type: str | None = None): ... + @overload + def __get__(self, obj: None, type: _Type | None = None) -> Self: ... + @overload + def __get__(self, obj: Any, type: _Type | None = None) -> _T | _NoneLiteral | None: ... + def __set__(self, obj: Any, value: _T | Literal[True]) -> None: ... + def __delete__(self, obj: Any) -> None: ... + +class _IntValueProperty(value_property[int, _NoneLiteral]): + def __set__(self, obj: Any, value: int) -> None: ... + +class _BaseCacheControl: + update_dict = UpdateDict + properties: MutableMapping[str, Any] + type: Literal["request", "response"] | None + @classmethod + @overload + def parse(cls, header: str, updates_to: None = None, type: None = None) -> _AnyCacheControl: ... + @classmethod + @overload + def parse(cls, header: str, updates_to: Request, type: Literal["request"]) -> _RequestCacheControl: ... + @classmethod + @overload + def parse(cls, header: str, updates_to: Response, type: Literal["response"]) -> _ResponseCacheControl: ... + + no_cache: value_property[str, Literal["*"]] + no_store: exists_property + no_transform: exists_property + max_age: _IntValueProperty[Literal[-1]] + def copy(self) -> Self: ... + +class _RequestCacheControl(_BaseCacheControl): + type: Literal["request"] + max_stale: _IntValueProperty[Literal["*"]] + min_fresh: _IntValueProperty[None] + only_if_cached: exists_property + +class _ResponseCacheControl(_BaseCacheControl): + type: Literal["response"] + public: exists_property + private: value_property[str, Literal["*"]] + must_revalidate: exists_property + proxy_revalidate: exists_property + s_maxage: _IntValueProperty[None] + s_max_age: _IntValueProperty[None] + stale_while_revalidate: _IntValueProperty[None] + stale_if_error: _IntValueProperty[None] + +class _AnyCacheControl(_RequestCacheControl, _ResponseCacheControl): + type: None # type:ignore[assignment] + +class CacheControl(_AnyCacheControl): + @overload + def __init__(self: _AnyCacheControl, properties: MutableMapping[str, Any], type: None) -> None: ... + @overload + def __init__(self: _RequestCacheControl, properties: MutableMapping[str, Any], type: Literal["request"]) -> None: ... + @overload + def __init__(self: _ResponseCacheControl, properties: MutableMapping[str, Any], type: Literal["response"]) -> None: ... + +def serialize_cache_control(properties: MutableMapping[str, Any] | _BaseCacheControl) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/client.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/client.pyi new file mode 100644 index 000000000000..81f54880bb82 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/client.pyi @@ -0,0 +1,12 @@ +from _typeshed.wsgi import StartResponse, WSGIEnvironment +from collections.abc import Iterable +from http.client import HTTPMessage +from typing import ClassVar + +class SendRequest: + def __init__(self, HTTPConnection=..., HTTPSConnection=...) -> None: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + filtered_headers: ClassVar[tuple[str, ...]] + def parse_headers(self, message: HTTPMessage) -> list[tuple[str, str]]: ... + +send_request_app: SendRequest diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/cookies.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/cookies.pyi new file mode 100644 index 000000000000..f0bfb5830c33 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/cookies.pyi @@ -0,0 +1,148 @@ +from _typeshed import Incomplete +from _typeshed.wsgi import WSGIEnvironment +from collections.abc import ItemsView, Iterator, KeysView, MutableMapping, ValuesView +from datetime import date, datetime, timedelta +from typing import TypeVar, overload +from typing_extensions import Literal + +from webob.descriptors import _AsymmetricProperty + +_T = TypeVar("_T") + +class RequestCookies(MutableMapping[str, str]): + def __init__(self, environ: WSGIEnvironment) -> None: ... + def __setitem__(self, name: str, value: str) -> None: ... + def __getitem__(self, name: str) -> str: ... + @overload + def get(self, name: str, default: None = None) -> str | None: ... + @overload + def get(self, name: str, default: str | _T) -> str | _T: ... + def __delitem__(self, name: str) -> None: ... + def keys(self) -> KeysView[str]: ... + def values(self) -> ValuesView[str]: ... + def items(self) -> ItemsView[str, str]: ... + def __contains__(self, name: object) -> bool: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + def clear(self) -> None: ... + +class Cookie(dict[str, Morsel]): + def __init__(self, input: str | None = None) -> None: ... + def load(self, data: str) -> None: ... + def add(self, key: str | bytes, val: str | bytes) -> Morsel: ... + def __setitem__(self, key: str | bytes, val: str | bytes) -> Morsel: ... # type:ignore[override] + def serialize(self, full: bool = True) -> str: ... + def values(self) -> list[Morsel]: ... # type:ignore[override] + def __str__(self, full: bool = True) -> str: ... + +class Morsel(dict[bytes, bytes | bool | None]): + name: bytes + value: bytes + def __init__(self, name: str | bytes, value: str | bytes) -> None: ... + @property + def path(self) -> bytes | None: ... + @path.setter + def path(self, v: bytes | None) -> None: ... + @property + def domain(self) -> bytes | None: ... + @domain.setter + def domain(self, v: bytes | None) -> None: ... + @property + def comment(self) -> bytes | None: ... + @comment.setter + def comment(self, v: bytes | None) -> None: ... + expires: _AsymmetricProperty[bytes | None, datetime | date | timedelta | int | str | bytes | None] + max_age: _AsymmetricProperty[bytes | None, timedelta | int | str | bytes] + @property + def httponly(self) -> bool | None: ... + @httponly.setter + def httponly(self, v: bool) -> None: ... + @property + def secure(self) -> bool | None: ... + @secure.setter + def secure(self, v: bool) -> None: ... + samesite: _AsymmetricProperty[bytes | None, Literal["strict", "lax", "none"] | None] + def serialize(self, full: bool = True) -> str: ... + def __str__(self, full: bool = True) -> str: ... + +def make_cookie( + name: str | bytes, + value: str | bytes | None, + max_age: int | timedelta | None = None, + path: str = "/", + domain: str | None = None, + secure: bool = False, + httponly: bool = False, + comment: str | None = None, + samesite: Literal["strict", "lax", "none"] | None = None, +) -> str: ... + +class JSONSerializer: + def dumps(self, appstruct): ... + def loads(self, bstruct): ... + +class Base64Serializer: + serializer: Incomplete + def __init__(self, serializer: Incomplete | None = None) -> None: ... + def dumps(self, appstruct): ... + def loads(self, bstruct): ... + +class SignedSerializer: + salt: Incomplete + secret: Incomplete + hashalg: Incomplete + salted_secret: Incomplete + digestmod: Incomplete + digest_size: Incomplete + serializer: Incomplete + def __init__(self, secret, salt, hashalg: str = "sha512", serializer: Incomplete | None = None) -> None: ... + def dumps(self, appstruct): ... + def loads(self, bstruct): ... + +class CookieProfile: + cookie_name: Incomplete + secure: Incomplete + max_age: Incomplete + httponly: Incomplete + samesite: Incomplete + path: Incomplete + domains: Incomplete + serializer: Incomplete + request: Incomplete + def __init__( + self, + cookie_name, + secure: bool = False, + max_age: Incomplete | None = None, + httponly: Incomplete | None = None, + samesite: Incomplete | None = None, + path: str = "/", + domains: Incomplete | None = None, + serializer: Incomplete | None = None, + ) -> None: ... + def __call__(self, request): ... + def bind(self, request): ... + def get_value(self): ... + def set_cookies(self, response, value, domains=..., max_age=..., path=..., secure=..., httponly=..., samesite=...): ... + def get_headers(self, value, domains=..., max_age=..., path=..., secure=..., httponly=..., samesite=...): ... + +class SignedCookieProfile(CookieProfile): + secret: Incomplete + salt: Incomplete + hashalg: Incomplete + original_serializer: Incomplete + def __init__( + self, + secret, + salt, + cookie_name, + secure: bool = False, + max_age: Incomplete | None = None, + httponly: bool = False, + samesite: Incomplete | None = None, + path: str = "/", + domains: Incomplete | None = None, + hashalg: str = "sha512", + serializer: Incomplete | None = None, + ) -> None: ... + def bind(self, request): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/datetime_utils.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/datetime_utils.pyi new file mode 100644 index 000000000000..6a57d83d9099 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/datetime_utils.pyi @@ -0,0 +1,23 @@ +from datetime import datetime, timedelta, tzinfo + +class _UTC(tzinfo): + def dst(self, dt: datetime | None) -> timedelta: ... + def utcoffset(self, dt: datetime | None) -> timedelta: ... + def tzname(self, dt: datetime | None) -> str: ... + +UTC: _UTC + +def timedelta_to_seconds(td: timedelta) -> int: ... + +day: timedelta +week: timedelta +hour: timedelta +minute: timedelta +second: timedelta +month: timedelta +year: timedelta + +def parse_date(value: str | bytes) -> datetime | None: ... +def serialize_date(dt) -> str: ... +def parse_date_delta(value: str | bytes) -> datetime | None: ... +def serialize_date_delta(value) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/dec.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/dec.pyi new file mode 100644 index 000000000000..a08ed4926a32 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/dec.pyi @@ -0,0 +1,49 @@ +from _typeshed import Incomplete +from _typeshed.wsgi import WSGIApplication +from typing import ClassVar, overload +from typing_extensions import Self + +from webob.request import Request + +class wsgify: + RequestClass: ClassVar[type[Request]] + func: Incomplete + args: Incomplete + kwargs: Incomplete + middleware_wraps: Incomplete + def __init__( + self, + func: Incomplete | None = None, + RequestClass: Incomplete | None = None, + args=..., + kwargs: Incomplete | None = None, + middleware_wraps: Incomplete | None = None, + ) -> None: ... + @overload + def __get__(self, obj: None, type: type | None = None) -> Self: ... + @overload + def __get__(self, obj: object, type: type | None = None) -> WSGIApplication: ... + def __call__(self, req, *args, **kw): ... + def get(self, url, **kw): ... + def post(self, url, POST: Incomplete | None = None, **kw): ... + def request(self, url, **kw): ... + def call_func(self, req, *args, **kwargs): ... + def clone(self, func: Incomplete | None = None, **kw): ... + @property + def undecorated(self): ... + @classmethod + def middleware(cls, middle_func: Incomplete | None = None, app: Incomplete | None = None, **kw): ... + +class _UnboundMiddleware: + wrapper_class: Incomplete + app: Incomplete + kw: Incomplete + def __init__(self, wrapper_class, app, kw) -> None: ... + def __call__(self, func, app: Incomplete | None = None): ... + +class _MiddlewareFactory: + wrapper_class: Incomplete + middleware: Incomplete + kw: Incomplete + def __init__(self, wrapper_class, middleware, kw) -> None: ... + def __call__(self, app: Incomplete | None = None, **config): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/descriptors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/descriptors.pyi new file mode 100644 index 000000000000..6119896b680f --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/descriptors.pyi @@ -0,0 +1,58 @@ +from _typeshed import Incomplete +from collections.abc import Iterable +from datetime import date, datetime, timedelta +from time import _TimeTuple, struct_time +from typing import Any, Generic, NamedTuple, TypeVar, overload + +_GetterReturnType = TypeVar("_GetterReturnType") +_SetterValueType = TypeVar("_SetterValueType") + +class _AsymmetricProperty(Generic[_GetterReturnType, _SetterValueType]): + @overload + def __get__(self, __obj: None, __type: type | None = ...) -> property: ... + @overload + def __get__(self, __obj: Any, __type: type | None = ...) -> _GetterReturnType: ... + def __set__(self, __obj: Any, __value: _SetterValueType) -> None: ... + +class _AsymmetricPropertyWithDelete(_AsymmetricProperty[_GetterReturnType, _SetterValueType]): + def __delete__(self, __obj: Any) -> None: ... + +class _StringProperty(_AsymmetricPropertyWithDelete[str | None, str | None]): ... +class _ListProperty(_AsymmetricPropertyWithDelete[tuple[str, ...] | None, Iterable[str] | str | None]): ... +class _DateProperty( + _AsymmetricPropertyWithDelete[datetime | None, date | datetime | timedelta | _TimeTuple | struct_time | float | str | None] +): ... + +def environ_getter(key, default=..., rfc_section: Incomplete | None = None): ... +def environ_decoder(key, default=..., rfc_section: Incomplete | None = None, encattr: Incomplete | None = None): ... +def upath_property(key): ... +def deprecated_property(attr, name, text, version): ... +def header_getter(header: str, rfc_section: str) -> _StringProperty: ... +def converter(prop, parse, serialize, convert_name: Incomplete | None = None): ... +def list_header(header: str, rfc_section: str) -> _ListProperty: ... +def parse_list(value): ... +def serialize_list(value): ... +def converter_date(prop): ... +def date_header(header: str, rfc_section: str) -> _DateProperty: ... +def parse_etag_response(value, strong: bool = False): ... +def serialize_etag_response(value): ... +def serialize_if_range(value): ... +def parse_range(value): ... +def serialize_range(value): ... +def parse_int(value): ... +def parse_int_safe(value): ... + +serialize_int = str + +def parse_content_range(value): ... +def serialize_content_range(value): ... +def parse_auth_params(params): ... + +known_auth_schemes: dict[str, None] + +class _authorization(NamedTuple): + authtype: str + params: dict[str, str] | str + +def parse_auth(val): ... +def serialize_auth(val): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/etag.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/etag.pyi new file mode 100644 index 000000000000..800570393c92 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/etag.pyi @@ -0,0 +1,53 @@ +from collections.abc import Collection +from datetime import datetime +from typing import Any, overload +from typing_extensions import TypeAlias + +from webob.response import Response + +_ETag: TypeAlias = _AnyETag | _NoETag | ETagMatcher + +class _ETagProperty: + @overload + def __get__(self, __obj: None, __type: type | None = ...) -> property: ... + @overload + def __get__(self, __obj: Any, __type: type | None = ...) -> _ETag: ... + @overload + def __set__(self, __obj: Any, __value: str | None) -> None: ... + @overload + def __set__(self, __obj: Any, __value: _ETag) -> None: ... + def __delete__(self, __obj: Any) -> None: ... + +def etag_property(key: str, default: _ETag, rfc_section: str, strong: bool = True) -> _ETagProperty: ... + +class _AnyETag: + def __bool__(self) -> bool: ... + def __contains__(self, other: str) -> bool: ... + +AnyETag: _AnyETag + +class _NoETag: + def __bool__(self) -> bool: ... + def __contains__(self, other: str) -> bool: ... + +NoETag: _NoETag + +class ETagMatcher: + etags: Collection[str] + def __init__(self, etags: Collection[str]) -> None: ... + def __contains__(self, other: str) -> bool: ... + @classmethod + def parse(cls, value: str, strong: bool = True) -> ETagMatcher | _AnyETag: ... + +class IfRange: + etag: _ETag + def __init__(self, etag: _ETag) -> None: ... + @classmethod + def parse(cls, value: str) -> IfRange | IfRangeDate: ... + def __contains__(self, resp: Response) -> bool: ... + def __bool__(self) -> bool: ... + +class IfRangeDate: + date: datetime + def __init__(self, date: datetime) -> None: ... + def __contains__(self, resp: Response) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/exc.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/exc.pyi new file mode 100644 index 000000000000..b662ea0ff7da --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/exc.pyi @@ -0,0 +1,126 @@ +from _typeshed import SupportsItems, SupportsKeysAndGetItem +from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment +from collections.abc import Iterable +from string import Template +from typing import Any, Protocol +from typing_extensions import Literal, Self + +from webob.response import Response + +class _JSONFormatter(Protocol): + def __call__(self, body: str, status: str, title: str, environ: WSGIEnvironment) -> str: ... + +class HTTPException(Exception): + wsgi_response: Response + def __init__(self, message: str, wsgi_response: Response) -> None: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + +class WSGIHTTPException(Response, HTTPException): + code: int + title: str + explanation: str + body_template_obj: Template + plain_template_obj: Template + html_template_obj: Template + empty_body: bool + detail: str | None + comment: str | None + def __init__( + self, + detail: str | None = None, + headers: SupportsItems[str, str] | SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]] | None = None, + comment: str | None = None, + body_template: str | None = None, + json_formatter: _JSONFormatter | None = None, + **kw: Any, + ) -> None: ... + def plain_body(self, environ: WSGIEnvironment) -> str: ... + def html_body(self, environ: WSGIEnvironment) -> str: ... + def json_formatter(self, body: str, status: str, title: str, environ: WSGIEnvironment) -> str: ... + def json_body(self, environ: WSGIEnvironment) -> str: ... + def generate_response(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + @property + def wsgi_response(self) -> Self: ... # type:ignore[override] + def __str__(self) -> str: ... # type:ignore[override] # noqaY029 + +class HTTPError(WSGIHTTPException): ... +class HTTPRedirection(WSGIHTTPException): ... +class HTTPOk(WSGIHTTPException): ... +class HTTPCreated(HTTPOk): ... +class HTTPAccepted(HTTPOk): ... +class HTTPNonAuthoritativeInformation(HTTPOk): ... + +class HTTPNoContent(HTTPOk): + empty_body: Literal[True] + +class HTTPResetContent(HTTPOk): + empty_body: Literal[True] + +class HTTPPartialContent(HTTPOk): ... + +class _HTTPMove(HTTPRedirection): + explanation: str + add_slash: bool + def __init__( + self, + detail: str | None = None, + headers: str | None = None, + comment: str | None = None, + body_template: str | None = None, + location: str | None = None, + add_slash: bool = False, + ) -> None: ... + +class HTTPMultipleChoices(_HTTPMove): ... +class HTTPMovedPermanently(_HTTPMove): ... +class HTTPFound(_HTTPMove): ... +class HTTPSeeOther(_HTTPMove): ... + +class HTTPNotModified(HTTPRedirection): + empty_body: Literal[True] + +class HTTPUseProxy(_HTTPMove): ... +class HTTPTemporaryRedirect(_HTTPMove): ... +class HTTPPermanentRedirect(_HTTPMove): ... +class HTTPClientError(HTTPError): ... +class HTTPBadRequest(HTTPClientError): ... +class HTTPUnauthorized(HTTPClientError): ... +class HTTPPaymentRequired(HTTPClientError): ... +class HTTPForbidden(HTTPClientError): ... +class HTTPNotFound(HTTPClientError): ... +class HTTPMethodNotAllowed(HTTPClientError): ... +class HTTPNotAcceptable(HTTPClientError): ... +class HTTPProxyAuthenticationRequired(HTTPClientError): ... +class HTTPRequestTimeout(HTTPClientError): ... +class HTTPConflict(HTTPClientError): ... +class HTTPGone(HTTPClientError): ... +class HTTPLengthRequired(HTTPClientError): ... +class HTTPPreconditionFailed(HTTPClientError): ... +class HTTPRequestEntityTooLarge(HTTPClientError): ... +class HTTPRequestURITooLong(HTTPClientError): ... +class HTTPUnsupportedMediaType(HTTPClientError): ... +class HTTPRequestRangeNotSatisfiable(HTTPClientError): ... +class HTTPExpectationFailed(HTTPClientError): ... +class HTTPUnprocessableEntity(HTTPClientError): ... +class HTTPLocked(HTTPClientError): ... +class HTTPFailedDependency(HTTPClientError): ... +class HTTPPreconditionRequired(HTTPClientError): ... +class HTTPTooManyRequests(HTTPClientError): ... +class HTTPRequestHeaderFieldsTooLarge(HTTPClientError): ... +class HTTPUnavailableForLegalReasons(HTTPClientError): ... +class HTTPServerError(HTTPError): ... +class HTTPInternalServerError(HTTPServerError): ... +class HTTPNotImplemented(HTTPServerError): ... +class HTTPBadGateway(HTTPServerError): ... +class HTTPServiceUnavailable(HTTPServerError): ... +class HTTPGatewayTimeout(HTTPServerError): ... +class HTTPVersionNotSupported(HTTPServerError): ... +class HTTPInsufficientStorage(HTTPServerError): ... +class HTTPNetworkAuthenticationRequired(HTTPServerError): ... + +class HTTPExceptionMiddleware: + application: WSGIApplication + def __init__(self, application: WSGIApplication) -> None: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + +status_map: dict[int, WSGIHTTPException] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/headers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/headers.pyi new file mode 100644 index 000000000000..35859b327b70 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/headers.pyi @@ -0,0 +1,17 @@ +from _typeshed.wsgi import WSGIEnvironment +from collections.abc import Iterator, MutableMapping + +from webob.multidict import MultiDict + +class ResponseHeaders(MultiDict[str, str]): ... + +class EnvironHeaders(MutableMapping[str, str]): + environ: WSGIEnvironment + def __init__(self, environ: WSGIEnvironment) -> None: ... + def __getitem__(self, hname: str) -> str: ... + def __setitem__(self, hname: str, value: str) -> None: ... + def __delitem__(self, hname: str) -> None: ... + def keys(self) -> list[str]: ... # type:ignore[override] + def __contains__(self, hname: object) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[str]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/multidict.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/multidict.pyi new file mode 100644 index 000000000000..3486d6ae3575 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/multidict.pyi @@ -0,0 +1,105 @@ +from _typeshed import SupportsItems, SupportsKeysAndGetItem +from _typeshed.wsgi import WSGIEnvironment +from cgi import FieldStorage +from collections.abc import Collection, Iterable, Iterator, MutableMapping +from typing import Any, TypeVar, overload +from typing_extensions import Literal, Self + +_T = TypeVar("_T") +_KT = TypeVar("_KT") +_VT = TypeVar("_VT") + +class MultiDict(MutableMapping[_KT, _VT]): + @overload + def __init__(self, __m: SupportsItems[_KT, _VT], **kwargs: _VT): ... + @overload + def __init__(self, __m: Iterable[tuple[_KT, _VT]], **kwargs: _VT): ... + @overload + def __init__(self, **kwargs: _VT) -> None: ... + @classmethod + def view_list(cls, lst: list[tuple[_KT, _VT]]) -> MultiDict[_KT, _VT]: ... + @classmethod + def from_fieldstorage(cls, fs: FieldStorage) -> MultiDict[str, str | FieldStorage]: ... + def __getitem__(self, key: _KT) -> _VT: ... + def __setitem__(self, key: _KT, value: _VT) -> None: ... + def add(self, key: _KT, value: _VT) -> None: ... + @overload + def get(self, key: _KT) -> _VT: ... + @overload + def get(self, key: _KT, default: _T) -> _VT | _T: ... + def getall(self, key: _KT) -> list[_VT]: ... + def getone(self, key: _KT) -> _VT: ... + def mixed(self) -> dict[_KT, _VT | list[_VT]]: ... + def dict_of_lists(self) -> dict[_KT, list[_VT]]: ... + def __delitem__(self, key: _KT) -> None: ... + def __contains__(self, key: object) -> bool: ... + has_key = __contains__ + def clear(self) -> None: ... + def copy(self) -> Self: ... + @overload + def setdefault(self, key: _KT, default: None = None) -> _VT | None: ... # type:ignore[misc] + @overload + def setdefault(self, key: _KT, default: _VT) -> _VT: ... + @overload + def pop(self, key: _KT) -> _VT: ... + @overload + def pop(self, key: _KT, default: _T) -> _VT | _T: ... + def popitem(self) -> tuple[_KT, _VT]: ... + @overload # type:ignore[override] + def update(self, __m: Collection[tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def update(self, **kwargs: _VT) -> None: ... + @overload + def extend(self, other: SupportsItems[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def extend(self, other: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ... + @overload + def extend(self, other: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + @overload + def extend(self, other: None = None, **kwargs: _VT) -> None: ... + def __len__(self) -> int: ... + def keys(self) -> Iterator[_KT]: ... # type:ignore[override] + __iter__ = keys + def values(self) -> Iterator[_VT]: ... # type:ignore[override] + def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type:ignore[override] + +class GetDict(MultiDict[str, str]): + env: WSGIEnvironment + @overload + def __init__(self, data: SupportsItems[str, str], env: WSGIEnvironment) -> None: ... + @overload + def __init__(self, data: Iterable[tuple[str, str]], env: WSGIEnvironment) -> None: ... + def on_change(self) -> None: ... + +class NestedMultiDict(MultiDict[_KT, _VT]): + dicts: tuple[MultiDict[_KT, _VT] | NoVars, ...] + def __init__(self, *dicts: MultiDict[_KT, _VT] | NoVars) -> None: ... + def __setitem__(self, key: _KT, value: _VT) -> None: ... + def add(self, key: _KT, value: _VT) -> None: ... + def __delitem__(self, key: _KT) -> None: ... + def clear(self) -> None: ... + def setdefault(self, key: _KT, default: _VT | None = ...) -> Any: ... + def pop(self, key: _KT, default: Any = ...) -> Any: ... + def popitem(self) -> tuple[_KT, _VT]: ... + def update(self, *args: Any, **kwargs: _VT) -> None: ... + def copy(self) -> MultiDict[_KT, _VT]: ... # type:ignore[override] + +class NoVars: + reason: str + def __init__(self, reason: str | None = None) -> None: ... + @overload + def get(self, key: str, default: None = None) -> None: ... + @overload + def get(self, key: str, default: _T) -> _T: ... + def getall(self, key: str) -> list[str]: ... + def mixed(self) -> dict[str, str | list[str]]: ... + def dict_of_lists(self) -> dict[str, list[str]]: ... + def __contains__(self, key: object) -> Literal[False]: ... + has_key = __contains__ + def copy(self) -> Self: ... + def __len__(self) -> Literal[0]: ... + def __iter__(self) -> Iterator[str]: ... + def keys(self) -> Iterator[str]: ... + def values(self) -> Iterator[str]: ... + def items(self) -> Iterator[tuple[str, str]]: ... + def __bool__(self) -> Literal[False]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/request.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/request.pyi new file mode 100644 index 000000000000..d14ff8038cee --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/request.pyi @@ -0,0 +1,238 @@ +import datetime +import io +from _typeshed import ( + ExcInfo, + Incomplete, + ReadableBuffer, + SupportsItems, + SupportsKeysAndGetItem, + SupportsNoArgReadline, + SupportsRead, +) +from _typeshed.wsgi import WSGIApplication, WSGIEnvironment +from cgi import FieldStorage +from collections.abc import Iterable, Mapping +from re import Pattern +from tempfile import _TemporaryFileWrapper +from typing import IO, Any, ClassVar, Protocol, TypeVar, overload +from typing_extensions import Literal, Self, TypeAlias, TypedDict + +from webob.acceptparse import _AcceptCharsetProperty, _AcceptEncodingProperty, _AcceptLanguageProperty, _AcceptProperty +from webob.byterange import Range +from webob.cachecontrol import _RequestCacheControl +from webob.cookies import RequestCookies +from webob.descriptors import _AsymmetricProperty, _AsymmetricPropertyWithDelete, _authorization, _DateProperty +from webob.etag import IfRange, IfRangeDate, _ETagProperty +from webob.headers import EnvironHeaders +from webob.multidict import GetDict, MultiDict, NestedMultiDict, NoVars +from webob.response import Response, _HTTPHeader + +_T = TypeVar("_T") +_HTTPMethod: TypeAlias = Literal["GET", "HEAD", "POST", "PUT", "DELETE", "PATCH"] +_ListOrTuple: TypeAlias = list[_T] | tuple[_T, ...] + +class _SupportsReadAndNoArgReadline(SupportsRead[bytes], SupportsNoArgReadline[bytes], Protocol): ... + +class _RequestCacheControlDict(TypedDict, total=False): + max_stale: int + min_stale: int + only_if_cached: bool + no_cache: Literal[True] | str + no_store: bool + no_transform: bool + max_age: int + +class _FieldStorageWithFile(FieldStorage): + file: IO[bytes] + filename: str + +class _NoDefault: ... + +NoDefault: _NoDefault + +class BaseRequest: + request_body_tempfile_limit: ClassVar[int] + environ: WSGIEnvironment + method: _HTTPMethod + def __init__(self, environ: WSGIEnvironment, **kw: Any) -> None: ... + def encget(self, key: str, default: Any = ..., encattr: str | None = None) -> Any: ... + def encset(self, key: str, val: Any, encattr: str | None = None) -> None: ... + @property + def charset(self) -> str | None: ... + def decode(self, charset: str | None = None, errors: str = "strict") -> Self: ... + @property + def body_file(self) -> SupportsRead[bytes]: ... + @body_file.setter + def body_file(self, value: SupportsRead[bytes]) -> None: ... + content_length: int | None + body_file_raw: SupportsRead[bytes] + is_body_seekable: bool + @property + def body_file_seekable(self) -> IO[bytes]: ... + url_encoding: str + @property + def scheme(self) -> str | None: ... + @scheme.setter + def scheme(self, value: str | None) -> None: ... + @property + def http_version(self) -> str | None: ... + @http_version.setter + def http_version(self, value: str | None) -> None: ... + remote_user: str | None + remote_host: str | None + remote_addr: str | None + query_string: str + @property + def server_name(self) -> str | None: ... + @server_name.setter + def server_name(self, value: str | None) -> None: ... + @property + def server_port(self) -> int | None: ... + @server_port.setter + def server_port(self, value: int | None) -> None: ... + script_name: str + @property + def path_info(self) -> str | None: ... + @path_info.setter + def path_info(self, value: str | None) -> None: ... + uscript_name: str # bw compat + upath_info = path_info # bw compat + content_type: str | None + headers: _AsymmetricProperty[EnvironHeaders, SupportsItems[str, str] | Iterable[tuple[str, str]]] + @property + def client_addr(self) -> str | None: ... + @property + def host_port(self) -> str: ... + @property + def host_url(self) -> str: ... + @property + def application_url(self) -> str: ... + @property + def path_url(self) -> str: ... + @property + def path(self) -> str: ... + @property + def path_qs(self) -> str: ... + @property + def url(self) -> str: ... + def relative_url(self, other_url: str, to_application: bool = False) -> str: ... + def path_info_pop(self, pattern: Pattern[str] | None = None) -> str | None: ... + def path_info_peek(self) -> str | None: ... + urlvars: dict[str, str] + urlargs: tuple[str] + @property + def is_xhr(self) -> bool: ... + host: str + @property + def domain(self) -> str: ... + body: bytes + json: Any + json_body: Any + text: str + @property + def POST(self) -> MultiDict[str, str | _FieldStorageWithFile] | NoVars: ... + @property + def GET(self) -> GetDict: ... + @property + def params(self) -> NestedMultiDict[str, str | _FieldStorageWithFile]: ... + cookies: _AsymmetricProperty[RequestCookies, SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]]] + def copy(self) -> Self: ... + def copy_get(self) -> Self: ... + @property + def is_body_readable(self) -> bool: ... + @is_body_readable.setter + def is_body_readable(self, flag: bool) -> None: ... + def make_body_seekable(self) -> None: ... + def copy_body(self) -> None: ... + def make_tempfile(self) -> _TemporaryFileWrapper[bytes]: ... + def remove_conditional_headers( + self, remove_encoding: bool = True, remove_range: bool = True, remove_match: bool = True, remove_modified: bool = True + ) -> None: ... + accept: _AcceptProperty + accept_charset: _AcceptCharsetProperty + accept_encoding: _AcceptEncodingProperty + accept_language: _AcceptLanguageProperty + authorization: _AsymmetricPropertyWithDelete[_authorization | None, tuple[str, str | dict[str, str]] | list[Any] | str | None] + cache_control: _AsymmetricPropertyWithDelete[ + _RequestCacheControl | None, _RequestCacheControl | _RequestCacheControlDict | str | None + ] + if_match: _ETagProperty + if_none_match: _ETagProperty + date: _DateProperty + if_modified_since: _DateProperty + if_unmodified_since: _DateProperty + if_range: _AsymmetricPropertyWithDelete[ + IfRange | IfRangeDate | None, IfRange | IfRangeDate | datetime.datetime | datetime.date | str | None + ] + max_forwards: int | None + pragma: str | None + range: _AsymmetricPropertyWithDelete[Range, tuple[int, int | None] | list[int | None] | str | None] + referer: str | None + referrer: str | None + user_agent: str | None + def as_bytes(self, skip_body: bool = False) -> bytes: ... + def as_text(self) -> str: ... + @classmethod + def from_bytes(cls, b: bytes) -> Self: ... + @classmethod + def from_text(cls, s: str) -> Self: ... + @classmethod + def from_file(cls, fp: _SupportsReadAndNoArgReadline) -> Self: ... + @overload + def call_application( + self, application: WSGIApplication, catch_exc_info: Literal[False] = False + ) -> tuple[str, list[_HTTPHeader], Iterable[bytes]]: ... + @overload + def call_application( + self, application: WSGIApplication, catch_exc_info: Literal[True] + ) -> tuple[str, list[_HTTPHeader], Iterable[bytes], ExcInfo | None]: ... + ResponseClass: type[Response] + def send(self, application: WSGIApplication | None = None, catch_exc_info: bool = False) -> Response: ... + get_response = send + def make_default_send_app(self) -> WSGIApplication: ... + @classmethod + def blank( + cls, + path: str, + environ: dict[str, None] | None = None, + base_url: str | None = None, + headers: Mapping[str, str] | None = None, + POST: str | bytes | Mapping[Any, Any] | Mapping[Any, _ListOrTuple[Any]] | None = None, + **kw, + ) -> Self: ... + +class LegacyRequest(BaseRequest): + uscript_name: Incomplete + upath_info: Incomplete + def encget(self, key, default=..., encattr: Incomplete | None = None): ... + +class AdhocAttrMixin: + def __setattr__(self, attr: str, value: Any) -> None: ... + def __getattr__(self, attr: str) -> Any: ... + def __delattr__(self, attr: str) -> None: ... + +class Request(AdhocAttrMixin, BaseRequest): ... +class DisconnectionError(IOError): ... + +def environ_from_url(path: str) -> WSGIEnvironment: ... +def environ_add_POST( + env: WSGIEnvironment, + data: str | bytes | Mapping[Any, Any] | Mapping[Any, _ListOrTuple[Any]] | None, + content_type: str | None = None, +) -> None: ... + +class LimitedLengthFile(io.RawIOBase): + file: SupportsRead[bytes] + maxlen: int + remaining: int + def __init__(self, file: SupportsRead[bytes], maxlen: int) -> None: ... + @staticmethod + def readable() -> Literal[True]: ... + def readinto(self, buff: ReadableBuffer) -> int: ... + +class Transcoder: + charset: str + errors: str + def __init__(self, charset: str, errors: str = "strict") -> None: ... + def transcode_query(self, q: str) -> str: ... + def transcode_fs(self, fs: FieldStorage, content_type: str) -> io.BytesIO: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/response.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/response.pyi new file mode 100644 index 000000000000..7b0ed4d98166 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/response.pyi @@ -0,0 +1,179 @@ +from _typeshed import SupportsItems, SupportsRead +from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment +from collections.abc import Iterable, Iterator, Sequence +from datetime import timedelta +from typing import IO, Any, Protocol +from typing_extensions import Literal, TypeAlias, TypedDict + +from webob.byterange import ContentRange +from webob.cachecontrol import _ResponseCacheControl +from webob.descriptors import _AsymmetricProperty, _AsymmetricPropertyWithDelete, _authorization, _DateProperty, _ListProperty +from webob.headers import ResponseHeaders +from webob.request import Request + +class _ResponseCacheExpires(Protocol): + def __call__( + self, + seconds: int | timedelta = 0, + *, + public: bool = ..., + private: Literal[True] | str = ..., + no_cache: Literal[True] | str = ..., + no_store: bool = ..., + no_transform: bool = ..., + must_revalidate: bool = ..., + proxy_revalidate: bool = ..., + max_age: int = ..., + s_maxage: int = ..., + s_max_age: int = ..., + stale_while_revalidate: int = ..., + stale_if_error: int = ..., + ) -> None: ... + +class _ResponseCacheControlDict(TypedDict, total=False): + public: bool + private: Literal[True] | str + no_cache: Literal[True] | str + no_store: bool + no_transform: bool + must_revalidate: bool + proxy_revalidate: bool + max_age: int + s_maxage: int + s_max_age: int + stale_while_revalidate: int + stale_if_error: int + +_HTTPHeader: TypeAlias = tuple[str, str] +_ContentRangeParams: TypeAlias = ( + ContentRange + | list[int | None] + | tuple[int, int] + | tuple[None, None] + | tuple[int, int, int | None] + | tuple[None, None, int | None] + | str + | None +) + +class Response: + default_content_type: str + default_charset: str + unicode_errors: str + default_conditional_response: bool + default_body_encoding: str + request: Request | None + environ: WSGIEnvironment | None + status: str + conditional_response: bool + + def __init__( + self, + body: bytes | str | None = None, + status: str | None = None, + headerlist: list[_HTTPHeader] | None = None, + app_iter: Iterator[bytes] | None = None, + content_type: str | None = None, + conditional_response: bool | None = None, + charset: str = ..., + **kw: Any, + ) -> None: ... + @classmethod + def from_file(cls, fp: IO[str]) -> Response: ... + def copy(self) -> Response: ... + status_code: int + status_int: int + headerlist: _AsymmetricPropertyWithDelete[list[_HTTPHeader], Iterable[_HTTPHeader] | SupportsItems[str, str]] + headers: _AsymmetricProperty[ResponseHeaders, SupportsItems[str, str] | Iterable[tuple[str, str]]] + body: bytes + json: Any + json_body: Any + @property + def has_body(self) -> bool: ... + text: str + unicode_body: str # deprecated + ubody: str # deprecated + body_file: _AsymmetricPropertyWithDelete[ResponseBodyFile, SupportsRead[bytes]] + content_length: int | None + def write(self, text: str | bytes) -> None: ... + app_iter: Iterator[bytes] + allow: _ListProperty + vary: _ListProperty + content_encoding: str | None + content_language: _ListProperty + content_location: str | None + content_md5: str | None + content_disposition: str | None + accept_ranges: str | None + content_range: _AsymmetricPropertyWithDelete[ContentRange | None, _ContentRangeParams] + date: _DateProperty + expires: _DateProperty + last_modified: _DateProperty + etag: _AsymmetricPropertyWithDelete[str | None, tuple[str, bool] | str | None] + @property + def etag_strong(self) -> str | None: ... + location: str | None + pragma: str | None + age: int | None + retry_after: _DateProperty + server: str | None + www_authenticate: _AsymmetricPropertyWithDelete[ + _authorization | None, tuple[str, str | dict[str, str]] | list[Any] | str | None + ] + charset: str | None + content_type: str | None + content_type_params: _AsymmetricPropertyWithDelete[dict[str, str], SupportsItems[str, str] | None] + def set_cookie( + self, + name: str, + value: str | None = "", + max_age: int | timedelta | None = None, + path: str = "/", + domain: str | None = None, + secure: bool = False, + httponly: bool = False, + comment: str | None = None, + overwrite: bool = False, + samesite: Literal["strict", "lax", "none"] | None = None, + ) -> None: ... + def delete_cookie(self, name: str, path: str = "/", domain: str | None = None) -> None: ... + def unset_cookie(self, name: str, strict: bool = True) -> None: ... + def merge_cookies(self, resp: Response | WSGIApplication) -> None: ... + cache_control: _AsymmetricProperty[_ResponseCacheControl, _ResponseCacheControl | _ResponseCacheControlDict | str | None] + cache_expires: _AsymmetricProperty[_ResponseCacheExpires, timedelta | int | bool | None] + def encode_content(self, encoding: Literal["gzip", "identity"] = "gzip", lazy: bool = False) -> None: ... + def decode_content(self) -> None: ... + def md5_etag(self, body: bytes | None = None, set_content_md5: bool = False) -> None: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + def conditional_response_app(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ... + def app_iter_range(self, start: int, stop: int | None) -> AppIterRange: ... + def __str__(self, skip_body: bool = False) -> str: ... + +class ResponseBodyFile: + mode: Literal["wb"] + closed: Literal[False] + response: Response + def __init__(self, response: Response): ... + @property + def encoding(self) -> str | None: ... + def write(self, text: str | bytes) -> int: ... + def writelines(self, seq: Sequence[str | bytes]) -> int: ... + def flush(self) -> None: ... + def tell(self) -> int: ... + +class AppIterRange: + app_iter: Iterator[bytes] + start: int + stop: int | None + def __init__(self, app_iter: Iterator[bytes], start: int, stop: int | None) -> None: ... + def __iter__(self) -> Iterator[bytes]: ... + def next(self) -> bytes: ... + __next__ = next + def close(self) -> None: ... + +class EmptyResponse: + def __init__(self, app_iter: Iterator[bytes] | None = None) -> None: ... + def __iter__(self) -> Iterator[bytes]: ... + def __len__(self) -> int: ... + def next(self) -> bytes: ... + __next__ = next diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/static.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/static.pyi new file mode 100644 index 000000000000..0f9e087dc822 --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/static.pyi @@ -0,0 +1,37 @@ +from _typeshed import StrOrBytesPath +from collections.abc import Iterator +from typing import IO, Any + +from webob.dec import wsgify +from webob.request import Request +from webob.response import Response + +BLOCK_SIZE: int + +class FileApp: + filename: StrOrBytesPath + kw: dict[str, Any] + def __init__(self, filename: StrOrBytesPath, **kw: Any) -> None: ... + @wsgify + def __call__(self, req: Request) -> Response: ... + +class FileIter: + file: IO[bytes] + def __init__(self, file: IO[bytes]) -> None: ... + def app_iter_range( + self, seek: int | None = None, limit: int | None = None, block_size: int | None = None + ) -> Iterator[bytes]: ... + __iter__ = app_iter_range + +class DirectoryApp: + path: str | bytes + index_page: str | None + hide_index_with_redirect: bool + fileapp_kw: dict[str, Any] + def __init__( + self, path: StrOrBytesPath, index_page: str = "index.html", hide_index_with_redirect: bool = False, **kw: Any + ) -> None: ... + def make_fileapp(self, path: StrOrBytesPath) -> FileApp: ... + @wsgify + def __call__(self, req: Request) -> Response | FileApp: ... + def index(self, req: Request, path: StrOrBytesPath) -> Response | FileApp: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/util.pyi b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/util.pyi new file mode 100644 index 000000000000..ea8ccec4206a --- /dev/null +++ b/packages/pyright-internal/typeshed-fallback/stubs/WebOb/webob/util.pyi @@ -0,0 +1,14 @@ +from collections.abc import Callable +from typing import AnyStr, Protocol + +class _HasHTML(Protocol): + def __html__(self) -> str: ... + +def html_escape(s: str | bytes | _HasHTML) -> str: ... +def header_docstring(header, rfc_section): ... +def warn_deprecation(text, version, stacklevel) -> None: ... + +status_reasons: dict[int, str] +status_generic_reasons: dict[int, str] + +def strings_differ(string1: AnyStr, string2: AnyStr, compare_digest: Callable[[AnyStr, AnyStr], bool] = ...) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml index 7d86e76a7f96..f37098fcfe65 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml +++ b/packages/pyright-internal/typeshed-fallback/stubs/hdbcli/METADATA.toml @@ -1 +1 @@ -version = "2.16.*" +version = "2.17.*" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/cell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/cell.pyi index f8a90b74b094..1f4ee9568367 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/cell.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/cell.pyi @@ -1,8 +1,8 @@ -from _typeshed import Incomplete from datetime import date, datetime, time, timedelta from decimal import Decimal +from re import Pattern from typing import overload -from typing_extensions import TypeAlias +from typing_extensions import Final, TypeAlias from openpyxl.cell.rich_text import CellRichText from openpyxl.comments.comments import Comment @@ -12,26 +12,30 @@ from openpyxl.worksheet.formula import ArrayFormula, DataTableFormula from openpyxl.worksheet.hyperlink import Hyperlink from openpyxl.worksheet.worksheet import Worksheet +_TimeTypes: TypeAlias = datetime | date | time | timedelta _CellValue: TypeAlias = ( # if numpy is installed also numpy bool and number types - bool | float | Decimal | str | CellRichText | date | time | timedelta | DataTableFormula | ArrayFormula + bool | float | Decimal | str | CellRichText | _TimeTypes | DataTableFormula | ArrayFormula ) -__docformat__: str -TIME_TYPES: Incomplete -TIME_FORMATS: Incomplete -STRING_TYPES: Incomplete -KNOWN_TYPES: Incomplete -ILLEGAL_CHARACTERS_RE: Incomplete -ERROR_CODES: Incomplete -TYPE_STRING: str -TYPE_FORMULA: str -TYPE_NUMERIC: str -TYPE_BOOL: str -TYPE_NULL: str -TYPE_INLINE: str -TYPE_ERROR: str -TYPE_FORMULA_CACHE_STRING: str -VALID_TYPES: Incomplete +__docformat__: Final = "restructuredtext en" +TIME_TYPES: Final[tuple[type, ...]] +TIME_FORMATS: Final[dict[type[_TimeTypes], str]] +STRING_TYPES: Final[tuple[type, ...]] +KNOWN_TYPES: Final[tuple[type, ...]] + +ILLEGAL_CHARACTERS_RE: Final[Pattern[str]] +ERROR_CODES: Final[tuple[str, ...]] + +TYPE_STRING: Final = "s" +TYPE_FORMULA: Final = "f" +TYPE_NUMERIC: Final = "n" +TYPE_BOOL: Final = "b" +TYPE_NULL: Final = "n" +TYPE_INLINE: Final = "inlineStr" +TYPE_ERROR: Final = "e" +TYPE_FORMULA_CACHE_STRING: Final = "str" + +VALID_TYPES: Final[tuple[str, ...]] def get_type(t: type, value: object) -> str | None: ... def get_time_format(t: datetime) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/read_only.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/read_only.pyi index 2d1085d3c40c..71e54e185bf9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/read_only.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/read_only.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from typing_extensions import Final class ReadOnlyCell: parent: Incomplete @@ -48,4 +49,4 @@ class EmptyCell: alignment: Incomplete data_type: str -EMPTY_CELL: Incomplete +EMPTY_CELL: Final[EmptyCell] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/text.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/text.pyi index 909358848ef7..5aed12bbd863 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/text.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/cell/text.pyi @@ -3,6 +3,7 @@ from typing import ClassVar from typing_extensions import Literal, TypeAlias from openpyxl.descriptors.base import Alias, Integer, NoneSet, Typed, _ConvertibleToInt +from openpyxl.descriptors.nested import NestedString, NestedText from openpyxl.descriptors.serialisable import Serialisable from openpyxl.styles.fonts import Font @@ -10,7 +11,7 @@ _PhoneticPropertiesType: TypeAlias = Literal["halfwidthKatakana", "fullwidthKata _PhoneticPropertiesAlignment: TypeAlias = Literal["noControl", "left", "center", "distributed"] class PhoneticProperties(Serialisable): - tagname: str + tagname: ClassVar[str] fontId: Integer[Literal[False]] type: NoneSet[_PhoneticPropertiesType] alignment: NoneSet[_PhoneticPropertiesAlignment] @@ -24,16 +25,16 @@ class PhoneticProperties(Serialisable): _PhoneticProperties: TypeAlias = PhoneticProperties class PhoneticText(Serialisable): - tagname: str + tagname: ClassVar[str] sb: Integer[Literal[False]] eb: Integer[Literal[False]] - t: Incomplete + t: NestedText[str, Literal[False]] text: Alias - def __init__(self, sb: _ConvertibleToInt, eb: _ConvertibleToInt, t: Incomplete | None = None) -> None: ... + def __init__(self, sb: _ConvertibleToInt, eb: _ConvertibleToInt, t: object = None) -> None: ... class InlineFont(Font): - tagname: str - rFont: Incomplete + tagname: ClassVar[str] + rFont: NestedString[Literal[True]] charset: Incomplete family: Incomplete b: Incomplete @@ -51,7 +52,7 @@ class InlineFont(Font): __elements__: ClassVar[tuple[str, ...]] def __init__( self, - rFont: Incomplete | None = None, + rFont: object = None, charset: Incomplete | None = None, family: Incomplete | None = None, b: Incomplete | None = None, @@ -69,17 +70,17 @@ class InlineFont(Font): ) -> None: ... class RichText(Serialisable): - tagname: str + tagname: ClassVar[str] rPr: Typed[InlineFont, Literal[True]] font: Alias - t: Incomplete + t: NestedText[str, Literal[True]] text: Alias __elements__: ClassVar[tuple[str, ...]] - def __init__(self, rPr: InlineFont | None = None, t: Incomplete | None = None) -> None: ... + def __init__(self, rPr: InlineFont | None = None, t: object = None) -> None: ... class Text(Serialisable): - tagname: str - t: Incomplete + tagname: ClassVar[str] + t: NestedText[str, Literal[True]] plain: Alias r: Incomplete formatted: Alias @@ -88,6 +89,6 @@ class Text(Serialisable): phoneticPr: Typed[_PhoneticProperties, Literal[True]] PhoneticProperties: Alias __elements__: ClassVar[tuple[str, ...]] - def __init__(self, t: Incomplete | None = None, r=(), rPh=(), phoneticPr: _PhoneticProperties | None = None) -> None: ... + def __init__(self, t: object = None, r=(), rPh=(), phoneticPr: _PhoneticProperties | None = None) -> None: ... @property def content(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_3d.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_3d.pyi index d11b2af0a3fc..86a4d9829ae5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_3d.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_3d.pyi @@ -1,41 +1,42 @@ -from _typeshed import Incomplete, Unused +from _typeshed import Unused from typing import ClassVar from typing_extensions import Literal from openpyxl.chart.picture import PictureOptions from openpyxl.chart.shapes import GraphicalProperties -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool, _ConvertibleToFloat, _ConvertibleToInt from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedInteger, NestedMinMax, _HasTagAndGet from openpyxl.descriptors.serialisable import Serialisable class View3D(Serialisable): - tagname: str - rotX: Incomplete + tagname: ClassVar[str] + rotX: NestedMinMax[float, Literal[True]] x_rotation: Alias - hPercent: Incomplete + hPercent: NestedMinMax[float, Literal[True]] height_percent: Alias - rotY: Incomplete + rotY: NestedInteger[Literal[True]] y_rotation: Alias - depthPercent: Incomplete - rAngAx: Incomplete + depthPercent: NestedInteger[Literal[True]] + rAngAx: NestedBool[Literal[True]] right_angle_axes: Alias - perspective: Incomplete + perspective: NestedInteger[Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - rotX: int = 15, - hPercent: Incomplete | None = None, - rotY: int = 20, - depthPercent: Incomplete | None = None, - rAngAx: bool = True, - perspective: Incomplete | None = None, + rotX: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = 15, + hPercent: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + rotY: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = 20, + depthPercent: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + rAngAx: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = True, + perspective: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, extLst: Unused = None, ) -> None: ... class Surface(Serialisable): - tagname: str - thickness: Incomplete + tagname: ClassVar[str] + thickness: NestedInteger[Literal[True]] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias pictureOptions: Typed[PictureOptions, Literal[True]] @@ -43,14 +44,14 @@ class Surface(Serialisable): __elements__: ClassVar[tuple[str, ...]] def __init__( self, - thickness: Incomplete | None = None, + thickness: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, spPr: GraphicalProperties | None = None, pictureOptions: PictureOptions | None = None, extLst: Unused = None, ) -> None: ... class _3DBase(Serialisable): - tagname: str + tagname: ClassVar[str] view3D: Typed[View3D, Literal[True]] floor: Typed[Surface, Literal[True]] sideWall: Typed[Surface, Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_chart.pyi index 405748b58e9d..51ac0ab5d7de 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/_chart.pyi @@ -1,5 +1,4 @@ from _typeshed import Incomplete, Unused -from abc import abstractmethod from typing import ClassVar from typing_extensions import Literal, TypeAlias @@ -41,12 +40,9 @@ class ChartBase(Serialisable): def __init__(self, axId=(), **kw: Unused) -> None: ... def __hash__(self) -> int: ... def __iadd__(self, other): ... - def to_tree(self, namespace: Incomplete | None = None, tagname: Incomplete | None = None, idx: Incomplete | None = None): ... # type: ignore[override] + def to_tree(self, namespace: str | None = None, tagname: str | None = None, idx: Incomplete | None = None): ... # type: ignore[override] def set_categories(self, labels) -> None: ... def add_data(self, data, from_rows: bool = False, titles_from_data: bool = False) -> None: ... def append(self, value) -> None: ... @property def path(self): ... - @property - @abstractmethod - def tagname(self) -> str: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/area_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/area_chart.pyi index c9b82946d7d1..a6b5e3ee1959 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/area_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/area_chart.pyi @@ -1,18 +1,20 @@ from _typeshed import Incomplete, Unused -from abc import abstractmethod from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.axis import ChartLines, NumericAxis, SeriesAxis, TextAxis from openpyxl.chart.label import DataLabelList -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedSet, _HasTagAndGet from ._chart import ChartBase +_AreaChartBaseGrouping: TypeAlias = Literal["percentStacked", "standard", "stacked"] + class _AreaChartBase(ChartBase): - grouping: Incomplete - varyColors: Incomplete + grouping: NestedSet[_AreaChartBaseGrouping] + varyColors: NestedBool[Literal[True]] ser: Incomplete dLbls: Typed[DataLabelList, Literal[True]] dataLabels: Alias @@ -20,18 +22,15 @@ class _AreaChartBase(ChartBase): __elements__: ClassVar[tuple[str, ...]] def __init__( self, - grouping: str = "standard", - varyColors: Incomplete | None = None, + grouping: _HasTagAndGet[_AreaChartBaseGrouping] | _AreaChartBaseGrouping = "standard", + varyColors: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, ser=(), dLbls: DataLabelList | None = None, dropLines: ChartLines | None = None, ) -> None: ... - @property - @abstractmethod - def tagname(self) -> str: ... class AreaChart(_AreaChartBase): - tagname: str + tagname: ClassVar[str] grouping: Incomplete varyColors: Incomplete ser: Incomplete @@ -44,7 +43,7 @@ class AreaChart(_AreaChartBase): def __init__(self, axId: Unused = None, extLst: Unused = None, **kw) -> None: ... class AreaChart3D(AreaChart): - tagname: str + tagname: ClassVar[str] grouping: Incomplete varyColors: Incomplete ser: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/axis.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/axis.pyi index 258437879f95..76d938aee75e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/axis.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/axis.pyi @@ -1,65 +1,115 @@ from _typeshed import Incomplete, Unused -from abc import abstractmethod -from typing import ClassVar -from typing_extensions import Literal +from typing import ClassVar, overload +from typing_extensions import Literal, TypeAlias from openpyxl.chart.layout import Layout from openpyxl.chart.shapes import GraphicalProperties from openpyxl.chart.text import RichText, Text -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool, _ConvertibleToFloat, _ConvertibleToInt from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedBool, + NestedFloat, + NestedInteger, + NestedMinMax, + NestedNoneSet, + NestedSet, + _HasTagAndGet, + _NestedNoneSetParam, +) from openpyxl.descriptors.serialisable import Serialisable +_ScalingOrientation: TypeAlias = Literal["maxMin", "minMax"] +_BaseAxisAxPos: TypeAlias = Literal["b", "l", "r", "t"] +_BaseAxisTickMark: TypeAlias = Literal["cross", "in", "out"] +_BaseAxisTickLblPos: TypeAlias = Literal["high", "low", "nextTo"] +_BaseAxisCrosses: TypeAlias = Literal["autoZero", "max", "min"] +_DisplayUnitsLabelListBuiltInUnit: TypeAlias = Literal[ + "hundreds", + "thousands", + "tenThousands", + "hundredThousands", + "millions", + "tenMillions", + "hundredMillions", + "billions", + "trillions", +] +_NumericAxisCrossBetween: TypeAlias = Literal["between", "midCat"] +_TextAxisLblAlgn: TypeAlias = Literal["ctr", "l", "r"] +_DateAxisTimeUnit: TypeAlias = Literal["days", "months", "years"] + class ChartLines(Serialisable): - tagname: str + tagname: ClassVar[str] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias def __init__(self, spPr: GraphicalProperties | None = None) -> None: ... class Scaling(Serialisable): - tagname: str - logBase: Incomplete - orientation: Incomplete - max: Incomplete - min: Incomplete + tagname: ClassVar[str] + logBase: NestedFloat[Literal[True]] + orientation: NestedSet[_ScalingOrientation] + max: NestedFloat[Literal[True]] + min: NestedFloat[Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - logBase: Incomplete | None = None, - orientation: str = "minMax", - max: Incomplete | None = None, - min: Incomplete | None = None, + logBase: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + orientation: _HasTagAndGet[_ScalingOrientation] | _ScalingOrientation = "minMax", + max: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + min: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, extLst: Unused = None, ) -> None: ... class _BaseAxis(Serialisable): - axId: Incomplete + axId: NestedInteger[Literal[False]] scaling: Typed[Scaling, Literal[False]] - delete: Incomplete - axPos: Incomplete + delete: NestedBool[Literal[True]] + axPos: NestedSet[_BaseAxisAxPos] majorGridlines: Typed[ChartLines, Literal[True]] minorGridlines: Typed[ChartLines, Literal[True]] title: Incomplete numFmt: Incomplete number_format: Alias - majorTickMark: Incomplete - minorTickMark: Incomplete - tickLblPos: Incomplete + majorTickMark: NestedNoneSet[_BaseAxisTickMark] + minorTickMark: NestedNoneSet[_BaseAxisTickMark] + tickLblPos: NestedNoneSet[_BaseAxisTickLblPos] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias txPr: Typed[RichText, Literal[True]] textProperties: Alias - crossAx: Incomplete - crosses: Incomplete - crossesAt: Incomplete + crossAx: NestedInteger[Literal[False]] + crosses: NestedNoneSet[_BaseAxisCrosses] + crossesAt: NestedFloat[Literal[True]] __elements__: ClassVar[tuple[str, ...]] + @overload + def __init__( + self, + axId: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt, + scaling: Scaling | None, + delete: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None, + axPos: _HasTagAndGet[_BaseAxisAxPos] | _BaseAxisAxPos, + majorGridlines: ChartLines | None, + minorGridlines: ChartLines | None, + title: Incomplete | None, + numFmt: Incomplete | None, + majorTickMark: _NestedNoneSetParam[_BaseAxisTickMark], + minorTickMark: _NestedNoneSetParam[_BaseAxisTickMark], + tickLblPos: _NestedNoneSetParam[_BaseAxisTickLblPos], + spPr: GraphicalProperties | None, + txPr: RichText | None, + crossAx: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt, + crosses: _NestedNoneSetParam[_BaseAxisCrosses] = None, + crossesAt: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + ) -> None: ... + @overload def __init__( self, - axId: Incomplete | None = None, + axId: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt, scaling: Scaling | None = None, - delete: Incomplete | None = None, - axPos: str = "l", + delete: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + axPos: _HasTagAndGet[_BaseAxisAxPos] | _BaseAxisAxPos = "l", majorGridlines: ChartLines | None = None, minorGridlines: ChartLines | None = None, title: Incomplete | None = None, @@ -69,16 +119,14 @@ class _BaseAxis(Serialisable): tickLblPos: Incomplete | None = None, spPr: GraphicalProperties | None = None, txPr: RichText | None = None, - crossAx: Incomplete | None = None, + *, + crossAx: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt, crosses: Incomplete | None = None, - crossesAt: Incomplete | None = None, + crossesAt: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, ) -> None: ... - @property - @abstractmethod - def tagname(self) -> str: ... class DisplayUnitsLabel(Serialisable): - tagname: str + tagname: ClassVar[str] layout: Typed[Layout, Literal[True]] tx: Typed[Text, Literal[True]] text: Alias @@ -96,22 +144,25 @@ class DisplayUnitsLabel(Serialisable): ) -> None: ... class DisplayUnitsLabelList(Serialisable): - tagname: str - custUnit: Incomplete - builtInUnit: Incomplete + tagname: ClassVar[str] + custUnit: NestedFloat[Literal[True]] + builtInUnit: NestedNoneSet[_DisplayUnitsLabelListBuiltInUnit] dispUnitsLbl: Typed[DisplayUnitsLabel, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - custUnit: Incomplete | None = None, - builtInUnit: Incomplete | None = None, + custUnit: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + builtInUnit: _HasTagAndGet[_DisplayUnitsLabelListBuiltInUnit] + | _DisplayUnitsLabelListBuiltInUnit + | Literal["none"] + | None = None, dispUnitsLbl: DisplayUnitsLabel | None = None, extLst: Unused = None, ) -> None: ... class NumericAxis(_BaseAxis): - tagname: str + tagname: ClassVar[str] axId: Incomplete scaling: Incomplete delete: Incomplete @@ -128,17 +179,17 @@ class NumericAxis(_BaseAxis): crossAx: Incomplete crosses: Incomplete crossesAt: Incomplete - crossBetween: Incomplete - majorUnit: Incomplete - minorUnit: Incomplete + crossBetween: NestedNoneSet[_NumericAxisCrossBetween] + majorUnit: NestedFloat[Literal[True]] + minorUnit: NestedFloat[Literal[True]] dispUnits: Typed[DisplayUnitsLabelList, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - crossBetween: Incomplete | None = None, - majorUnit: Incomplete | None = None, - minorUnit: Incomplete | None = None, + crossBetween: _NestedNoneSetParam[_NumericAxisCrossBetween] = None, + majorUnit: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + minorUnit: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, dispUnits: DisplayUnitsLabelList | None = None, extLst: Unused = None, **kw, @@ -147,7 +198,7 @@ class NumericAxis(_BaseAxis): def from_tree(cls, node): ... class TextAxis(_BaseAxis): - tagname: str + tagname: ClassVar[str] axId: Incomplete scaling: Incomplete delete: Incomplete @@ -164,28 +215,28 @@ class TextAxis(_BaseAxis): crossAx: Incomplete crosses: Incomplete crossesAt: Incomplete - auto: Incomplete - lblAlgn: Incomplete - lblOffset: Incomplete - tickLblSkip: Incomplete - tickMarkSkip: Incomplete - noMultiLvlLbl: Incomplete + auto: NestedBool[Literal[True]] + lblAlgn: NestedNoneSet[_TextAxisLblAlgn] + lblOffset: NestedMinMax[float, Literal[False]] + tickLblSkip: NestedInteger[Literal[True]] + tickMarkSkip: NestedInteger[Literal[True]] + noMultiLvlLbl: NestedBool[Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - auto: Incomplete | None = None, - lblAlgn: Incomplete | None = None, - lblOffset: int = 100, - tickLblSkip: Incomplete | None = None, - tickMarkSkip: Incomplete | None = None, - noMultiLvlLbl: Incomplete | None = None, + auto: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + lblAlgn: _NestedNoneSetParam[_TextAxisLblAlgn] = None, + lblOffset: _HasTagAndGet[_ConvertibleToFloat] | _ConvertibleToFloat = 100, + tickLblSkip: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + tickMarkSkip: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + noMultiLvlLbl: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, extLst: Unused = None, **kw, ) -> None: ... class DateAxis(TextAxis): - tagname: str + tagname: ClassVar[str] axId: Incomplete scaling: Incomplete delete: Incomplete @@ -202,30 +253,30 @@ class DateAxis(TextAxis): crossAx: Incomplete crosses: Incomplete crossesAt: Incomplete - auto: Incomplete - lblOffset: Incomplete - baseTimeUnit: Incomplete - majorUnit: Incomplete - majorTimeUnit: Incomplete - minorUnit: Incomplete - minorTimeUnit: Incomplete + auto: NestedBool[Literal[True]] + lblOffset: NestedInteger[Literal[True]] # type: ignore[assignment] + baseTimeUnit: NestedNoneSet[_DateAxisTimeUnit] + majorUnit: NestedFloat[Literal[True]] + majorTimeUnit: NestedNoneSet[_DateAxisTimeUnit] + minorUnit: NestedFloat[Literal[True]] + minorTimeUnit: NestedNoneSet[_DateAxisTimeUnit] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - auto: Incomplete | None = None, - lblOffset: Incomplete | None = None, - baseTimeUnit: Incomplete | None = None, - majorUnit: Incomplete | None = None, - majorTimeUnit: Incomplete | None = None, - minorUnit: Incomplete | None = None, - minorTimeUnit: Incomplete | None = None, + auto: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + lblOffset: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + baseTimeUnit: _NestedNoneSetParam[_DateAxisTimeUnit] = None, + majorUnit: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + majorTimeUnit: _NestedNoneSetParam[_DateAxisTimeUnit] = None, + minorUnit: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + minorTimeUnit: _NestedNoneSetParam[_DateAxisTimeUnit] = None, extLst: Unused = None, **kw, ) -> None: ... class SeriesAxis(_BaseAxis): - tagname: str + tagname: ClassVar[str] axId: Incomplete scaling: Incomplete delete: Incomplete @@ -242,10 +293,14 @@ class SeriesAxis(_BaseAxis): crossAx: Incomplete crosses: Incomplete crossesAt: Incomplete - tickLblSkip: Incomplete - tickMarkSkip: Incomplete + tickLblSkip: NestedInteger[Literal[True]] + tickMarkSkip: NestedInteger[Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( - self, tickLblSkip: Incomplete | None = None, tickMarkSkip: Incomplete | None = None, extLst: Unused = None, **kw + self, + tickLblSkip: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + tickMarkSkip: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + extLst: Unused = None, + **kw, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bar_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bar_chart.pyi index f06b54c64679..2233b5b81975 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bar_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bar_chart.pyi @@ -1,40 +1,41 @@ from _typeshed import Incomplete, Unused -from abc import abstractmethod from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.axis import ChartLines, NumericAxis, SeriesAxis, TextAxis from openpyxl.chart.label import DataLabelList -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedNoneSet, NestedSet, _HasTagAndGet, _NestedNoneSetParam from ._3d import _3DBase from ._chart import ChartBase +_BarChartBaseBarDir: TypeAlias = Literal["bar", "col"] +_BarChartBaseGrouping: TypeAlias = Literal["percentStacked", "clustered", "standard", "stacked"] +_BarChart3DShape: TypeAlias = Literal["cone", "coneToMax", "box", "cylinder", "pyramid", "pyramidToMax"] + class _BarChartBase(ChartBase): - barDir: Incomplete + barDir: NestedSet[_BarChartBaseBarDir] type: Alias - grouping: Incomplete - varyColors: Incomplete + grouping: NestedSet[_BarChartBaseGrouping] + varyColors: NestedBool[Literal[True]] ser: Incomplete dLbls: Typed[DataLabelList, Literal[True]] dataLabels: Alias __elements__: ClassVar[tuple[str, ...]] def __init__( self, - barDir: str = "col", - grouping: str = "clustered", - varyColors: Incomplete | None = None, + barDir: _HasTagAndGet[_BarChartBaseBarDir] | _BarChartBaseBarDir = "col", + grouping: _HasTagAndGet[_BarChartBaseGrouping] | _BarChartBaseGrouping = "clustered", + varyColors: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, ser=(), dLbls: DataLabelList | None = None, **kw, ) -> None: ... - @property - @abstractmethod - def tagname(self) -> str: ... class BarChart(_BarChartBase): - tagname: str + tagname: ClassVar[str] barDir: Incomplete grouping: Incomplete varyColors: Incomplete @@ -58,7 +59,7 @@ class BarChart(_BarChartBase): ) -> None: ... class BarChart3D(_BarChartBase, _3DBase): - tagname: str + tagname: ClassVar[str] barDir: Incomplete grouping: Incomplete varyColors: Incomplete @@ -70,7 +71,7 @@ class BarChart3D(_BarChartBase, _3DBase): backWall: Incomplete gapWidth: Incomplete gapDepth: Incomplete - shape: Incomplete + shape: NestedNoneSet[_BarChart3DShape] serLines: Typed[ChartLines, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] x_axis: Typed[TextAxis, Literal[False]] @@ -81,7 +82,7 @@ class BarChart3D(_BarChartBase, _3DBase): self, gapWidth: int = 150, gapDepth: int = 150, - shape: Incomplete | None = None, + shape: _NestedNoneSetParam[_BarChart3DShape] = None, serLines: ChartLines | None = None, extLst: Unused = None, **kw, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi index a1ba6637d512..87868815b72e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi @@ -1,37 +1,40 @@ from _typeshed import Incomplete, Unused from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.axis import NumericAxis from openpyxl.chart.label import DataLabelList -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool, _ConvertibleToFloat from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedMinMax, NestedNoneSet, _HasTagAndGet, _NestedNoneSetParam from ._chart import ChartBase +_BubbleChartSizeRepresents: TypeAlias = Literal["area", "w"] + class BubbleChart(ChartBase): - tagname: str - varyColors: Incomplete + tagname: ClassVar[str] + varyColors: NestedBool[Literal[True]] ser: Incomplete dLbls: Typed[DataLabelList, Literal[True]] dataLabels: Alias - bubble3D: Incomplete - bubbleScale: Incomplete - showNegBubbles: Incomplete - sizeRepresents: Incomplete + bubble3D: NestedBool[Literal[True]] + bubbleScale: NestedMinMax[float, Literal[True]] + showNegBubbles: NestedBool[Literal[True]] + sizeRepresents: NestedNoneSet[_BubbleChartSizeRepresents] extLst: Typed[ExtensionList, Literal[True]] x_axis: Typed[NumericAxis, Literal[False]] y_axis: Typed[NumericAxis, Literal[False]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - varyColors: Incomplete | None = None, + varyColors: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, ser=(), dLbls: DataLabelList | None = None, - bubble3D: Incomplete | None = None, - bubbleScale: Incomplete | None = None, - showNegBubbles: Incomplete | None = None, - sizeRepresents: Incomplete | None = None, + bubble3D: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + bubbleScale: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + showNegBubbles: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + sizeRepresents: _NestedNoneSetParam[_BubbleChartSizeRepresents] = None, extLst: Unused = None, **kw, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/chartspace.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/chartspace.pyi index ad1da05ff6fe..fdc79e6f5f69 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/chartspace.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/chartspace.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete, Unused from typing import ClassVar, overload -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.legend import Legend from openpyxl.chart.pivot import PivotSource @@ -9,15 +9,18 @@ from openpyxl.chart.print_settings import PrintSettings from openpyxl.chart.shapes import GraphicalProperties from openpyxl.chart.text import RichText from openpyxl.chart.title import Title -from openpyxl.descriptors.base import Alias, String, Typed +from openpyxl.descriptors.base import Alias, String, Typed, _ConvertibleToBool, _ConvertibleToFloat from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedMinMax, NestedNoneSet, NestedString, _HasTagAndGet, _NestedNoneSetParam from openpyxl.descriptors.serialisable import Serialisable from openpyxl.drawing.colors import ColorMapping +_ChartContainerDispBlanksAs: TypeAlias = Literal["span", "gap", "zero"] + class ChartContainer(Serialisable): - tagname: str + tagname: ClassVar[str] title: Typed[Title, Literal[True]] - autoTitleDeleted: Incomplete + autoTitleDeleted: NestedBool[Literal[True]] pivotFmts: Incomplete view3D: Incomplete floor: Incomplete @@ -25,15 +28,15 @@ class ChartContainer(Serialisable): backWall: Incomplete plotArea: Typed[PlotArea, Literal[False]] legend: Typed[Legend, Literal[True]] - plotVisOnly: Incomplete - dispBlanksAs: Incomplete - showDLblsOverMax: Incomplete + plotVisOnly: NestedBool[Literal[False]] + dispBlanksAs: NestedNoneSet[_ChartContainerDispBlanksAs] + showDLblsOverMax: NestedBool[Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, title: Title | None = None, - autoTitleDeleted: Incomplete | None = None, + autoTitleDeleted: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, pivotFmts=(), view3D: Incomplete | None = None, floor: Incomplete | None = None, @@ -41,44 +44,46 @@ class ChartContainer(Serialisable): backWall: Incomplete | None = None, plotArea: PlotArea | None = None, legend: Legend | None = None, - plotVisOnly: bool = True, - dispBlanksAs: str = "gap", - showDLblsOverMax: Incomplete | None = None, + plotVisOnly: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = True, + dispBlanksAs: _NestedNoneSetParam[_ChartContainerDispBlanksAs] = "gap", + showDLblsOverMax: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, extLst: Unused = None, ) -> None: ... class Protection(Serialisable): - tagname: str - chartObject: Incomplete - data: Incomplete - formatting: Incomplete - selection: Incomplete - userInterface: Incomplete + tagname: ClassVar[str] + chartObject: NestedBool[Literal[True]] + data: NestedBool[Literal[True]] + formatting: NestedBool[Literal[True]] + selection: NestedBool[Literal[True]] + userInterface: NestedBool[Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - chartObject: Incomplete | None = None, - data: Incomplete | None = None, - formatting: Incomplete | None = None, - selection: Incomplete | None = None, - userInterface: Incomplete | None = None, + chartObject: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + data: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + formatting: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + selection: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + userInterface: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, ) -> None: ... class ExternalData(Serialisable): - tagname: str - autoUpdate: Incomplete + tagname: ClassVar[str] + autoUpdate: NestedBool[Literal[True]] id: String[Literal[False]] @overload - def __init__(self, autoUpdate: Incomplete | None = None, *, id: str) -> None: ... + def __init__( + self, autoUpdate: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, *, id: str + ) -> None: ... @overload def __init__(self, autoUpdate: Incomplete | None, id: str) -> None: ... class ChartSpace(Serialisable): - tagname: str - date1904: Incomplete - lang: Incomplete - roundedCorners: Incomplete - style: Incomplete + tagname: ClassVar[str] + date1904: NestedBool[Literal[True]] + lang: NestedString[Literal[True]] + roundedCorners: NestedBool[Literal[True]] + style: NestedMinMax[float, Literal[True]] clrMapOvr: Typed[ColorMapping, Literal[True]] pivotSource: Typed[PivotSource, Literal[True]] protection: Typed[Protection, Literal[True]] @@ -95,10 +100,10 @@ class ChartSpace(Serialisable): @overload def __init__( self, - date1904: Incomplete | None = None, - lang: Incomplete | None = None, - roundedCorners: Incomplete | None = None, - style: Incomplete | None = None, + date1904: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + lang: object = None, + roundedCorners: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + style: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, clrMapOvr: ColorMapping | None = None, pivotSource: PivotSource | None = None, protection: Protection | None = None, @@ -114,10 +119,10 @@ class ChartSpace(Serialisable): @overload def __init__( self, - date1904: Incomplete | None, - lang: Incomplete | None, - roundedCorners: Incomplete | None, - style: Incomplete | None, + date1904: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None, + lang: object, + roundedCorners: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None, + style: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None, clrMapOvr: ColorMapping | None, pivotSource: PivotSource | None, protection: Protection | None, @@ -129,4 +134,4 @@ class ChartSpace(Serialisable): userShapes: Incomplete | None = None, extLst: Unused = None, ) -> None: ... - def to_tree(self, tagname: Incomplete | None = None, idx: Incomplete | None = None, namespace: Incomplete | None = None): ... + def to_tree(self, tagname: Incomplete | None = None, idx: Incomplete | None = None, namespace: str | None = None): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/data_source.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/data_source.pyi index 613f97de0f97..791f97e7a482 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/data_source.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/data_source.pyi @@ -5,7 +5,7 @@ from typing_extensions import Literal from openpyxl.descriptors import Strict from openpyxl.descriptors.base import Alias, Bool, Integer, String, Typed, _ConvertibleToBool, _ConvertibleToInt from openpyxl.descriptors.excel import ExtensionList -from openpyxl.descriptors.nested import NestedText +from openpyxl.descriptors.nested import NestedInteger, NestedText, _HasTagAndGet from openpyxl.descriptors.serialisable import Serialisable class NumFmt(Serialisable): @@ -13,56 +13,62 @@ class NumFmt(Serialisable): sourceLinked: Bool[Literal[False]] def __init__(self, formatCode: str, sourceLinked: _ConvertibleToBool = False) -> None: ... -class NumberValueDescriptor(NestedText): +class NumberValueDescriptor(NestedText[Incomplete, Incomplete]): allow_none: bool expected_type: type[Incomplete] def __set__(self, instance: Serialisable | Strict, value) -> None: ... # type: ignore[override] class NumVal(Serialisable): idx: Integer[Literal[False]] - formatCode: Incomplete + formatCode: NestedText[str, Literal[True]] v: Incomplete - def __init__(self, idx: _ConvertibleToInt, formatCode: Incomplete | None = None, v: Incomplete | None = None) -> None: ... + def __init__(self, idx: _ConvertibleToInt, formatCode: object = None, v: Incomplete | None = None) -> None: ... class NumData(Serialisable): - formatCode: Incomplete - ptCount: Incomplete + formatCode: NestedText[str, Literal[True]] + ptCount: NestedInteger[Literal[True]] pt: Incomplete extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( - self, formatCode: Incomplete | None = None, ptCount: Incomplete | None = None, pt=(), extLst: Unused = None + self, + formatCode: object = None, + ptCount: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + pt=(), + extLst: Unused = None, ) -> None: ... class NumRef(Serialisable): - f: Incomplete + f: NestedText[str, Literal[False]] ref: Alias numCache: Typed[NumData, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] - def __init__(self, f: Incomplete | None = None, numCache: NumData | None = None, extLst: Unused = None) -> None: ... + def __init__(self, f: object = None, numCache: NumData | None = None, extLst: Unused = None) -> None: ... class StrVal(Serialisable): - tagname: str + tagname: ClassVar[str] idx: Integer[Literal[False]] - v: Incomplete - def __init__(self, idx: _ConvertibleToInt = 0, v: Incomplete | None = None) -> None: ... + v: NestedText[str, Literal[False]] + def __init__(self, idx: _ConvertibleToInt = 0, v: object = None) -> None: ... class StrData(Serialisable): - tagname: str - ptCount: Incomplete + tagname: ClassVar[str] + ptCount: NestedInteger[Literal[True]] pt: Incomplete extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] - def __init__(self, ptCount: Incomplete | None = None, pt=(), extLst: Unused = None) -> None: ... + def __init__( + self, ptCount: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, pt=(), extLst: Unused = None + ) -> None: ... class StrRef(Serialisable): - tagname: str - f: Incomplete + tagname: ClassVar[str] + f: NestedText[str, Literal[True]] strCache: Typed[StrData, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] - def __init__(self, f: Incomplete | None = None, strCache: StrData | None = None, extLst: Unused = None) -> None: ... + def __init__(self, f: object = None, strCache: StrData | None = None, extLst: Unused = None) -> None: ... class NumDataSource(Serialisable): numRef: Typed[NumRef, Literal[True]] @@ -70,13 +76,13 @@ class NumDataSource(Serialisable): def __init__(self, numRef: NumRef | None = None, numLit: NumData | None = None) -> None: ... class Level(Serialisable): - tagname: str + tagname: ClassVar[str] pt: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, pt=()) -> None: ... class MultiLevelStrData(Serialisable): - tagname: str + tagname: ClassVar[str] ptCount: Integer[Literal[True]] lvl: Incomplete extLst: Typed[ExtensionList, Literal[True]] @@ -84,17 +90,15 @@ class MultiLevelStrData(Serialisable): def __init__(self, ptCount: _ConvertibleToInt | None = None, lvl=(), extLst: Unused = None) -> None: ... class MultiLevelStrRef(Serialisable): - tagname: str - f: Incomplete + tagname: ClassVar[str] + f: NestedText[str, Literal[False]] multiLvlStrCache: Typed[MultiLevelStrData, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] - def __init__( - self, f: Incomplete | None = None, multiLvlStrCache: MultiLevelStrData | None = None, extLst: Unused = None - ) -> None: ... + def __init__(self, f: object = None, multiLvlStrCache: MultiLevelStrData | None = None, extLst: Unused = None) -> None: ... class AxDataSource(Serialisable): - tagname: str + tagname: ClassVar[str] numRef: Typed[NumRef, Literal[True]] numLit: Typed[NumData, Literal[True]] strRef: Typed[StrRef, Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/descriptors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/descriptors.pyi index 8cd163b1d900..eb1d72593fb4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/descriptors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/descriptors.pyi @@ -1,4 +1,3 @@ -from _typeshed import Incomplete from typing_extensions import Literal from openpyxl.chart.data_source import NumFmt @@ -6,17 +5,17 @@ from openpyxl.descriptors import Strict, Typed from openpyxl.descriptors.nested import NestedMinMax from openpyxl.descriptors.serialisable import Serialisable -class NestedGapAmount(NestedMinMax): +class NestedGapAmount(NestedMinMax[float, bool]): allow_none: bool min: float max: float -class NestedOverlap(NestedMinMax): +class NestedOverlap(NestedMinMax[float, bool]): allow_none: bool min: float max: float -class NumberFormatDescriptor(Typed[NumFmt, Incomplete]): +class NumberFormatDescriptor(Typed[NumFmt, Literal[True]]): expected_type: type[NumFmt] allow_none: Literal[True] def __set__(self, instance: Serialisable | Strict, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/error_bar.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/error_bar.pyi index 922c7ce25f97..4f2804bc00b3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/error_bar.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/error_bar.pyi @@ -1,38 +1,43 @@ -from _typeshed import Incomplete, Unused +from _typeshed import Unused from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.data_source import NumDataSource from openpyxl.chart.shapes import GraphicalProperties -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool, _ConvertibleToFloat from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedFloat, NestedNoneSet, NestedSet, _HasTagAndGet, _NestedNoneSetParam from openpyxl.descriptors.serialisable import Serialisable +_ErrorBarsErrBarType: TypeAlias = Literal["both", "minus", "plus"] +_ErrorBarsErrValType: TypeAlias = Literal["cust", "fixedVal", "percentage", "stdDev", "stdErr"] +_ErrorBarsErrDir: TypeAlias = Literal["x", "y"] + class ErrorBars(Serialisable): - tagname: str - errDir: Incomplete + tagname: ClassVar[str] + errDir: NestedNoneSet[_ErrorBarsErrDir] direction: Alias - errBarType: Incomplete + errBarType: NestedSet[_ErrorBarsErrBarType] style: Alias - errValType: Incomplete + errValType: NestedSet[_ErrorBarsErrValType] size: Alias - noEndCap: Incomplete + noEndCap: NestedBool[Literal[True]] plus: Typed[NumDataSource, Literal[True]] minus: Typed[NumDataSource, Literal[True]] - val: Incomplete + val: NestedFloat[Literal[True]] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - errDir: Incomplete | None = None, - errBarType: str = "both", - errValType: str = "fixedVal", - noEndCap: Incomplete | None = None, + errDir: _NestedNoneSetParam[_ErrorBarsErrDir] = None, + errBarType: _HasTagAndGet[_ErrorBarsErrBarType] | _ErrorBarsErrBarType = "both", + errValType: _HasTagAndGet[_ErrorBarsErrValType] | _ErrorBarsErrValType = "fixedVal", + noEndCap: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, plus: NumDataSource | None = None, minus: NumDataSource | None = None, - val: Incomplete | None = None, + val: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, spPr: GraphicalProperties | None = None, extLst: Unused = None, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/label.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/label.pyi index 0473048ad3a6..e7396adcc855 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/label.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/label.pyi @@ -1,55 +1,54 @@ from _typeshed import Incomplete, Unused -from abc import abstractmethod from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.shapes import GraphicalProperties from openpyxl.chart.text import RichText -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool, _ConvertibleToInt from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedInteger, NestedNoneSet, NestedString, _HasTagAndGet, _NestedNoneSetParam from openpyxl.descriptors.serialisable import Serialisable as Serialisable +_DataLabelBaseDLblPos: TypeAlias = Literal["bestFit", "b", "ctr", "inBase", "inEnd", "l", "outEnd", "r", "t"] + class _DataLabelBase(Serialisable): - numFmt: Incomplete + numFmt: NestedString[Literal[True]] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias txPr: Typed[RichText, Literal[True]] textProperties: Alias - dLblPos: Incomplete + dLblPos: NestedNoneSet[_DataLabelBaseDLblPos] position: Alias - showLegendKey: Incomplete - showVal: Incomplete - showCatName: Incomplete - showSerName: Incomplete - showPercent: Incomplete - showBubbleSize: Incomplete - showLeaderLines: Incomplete - separator: Incomplete + showLegendKey: NestedBool[Literal[True]] + showVal: NestedBool[Literal[True]] + showCatName: NestedBool[Literal[True]] + showSerName: NestedBool[Literal[True]] + showPercent: NestedBool[Literal[True]] + showBubbleSize: NestedBool[Literal[True]] + showLeaderLines: NestedBool[Literal[True]] + separator: NestedString[Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - numFmt: Incomplete | None = None, + numFmt: object = None, spPr: GraphicalProperties | None = None, txPr: RichText | None = None, - dLblPos: Incomplete | None = None, - showLegendKey: Incomplete | None = None, - showVal: Incomplete | None = None, - showCatName: Incomplete | None = None, - showSerName: Incomplete | None = None, - showPercent: Incomplete | None = None, - showBubbleSize: Incomplete | None = None, - showLeaderLines: Incomplete | None = None, - separator: Incomplete | None = None, + dLblPos: _NestedNoneSetParam[_DataLabelBaseDLblPos] = None, + showLegendKey: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + showVal: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + showCatName: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + showSerName: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + showPercent: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + showBubbleSize: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + showLeaderLines: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + separator: object = None, extLst: Unused = None, ) -> None: ... - @property - @abstractmethod - def tagname(self) -> str: ... class DataLabel(_DataLabelBase): - tagname: str - idx: Incomplete + tagname: ClassVar[str] + idx: NestedInteger[Literal[False]] numFmt: Incomplete spPr: Incomplete txPr: Incomplete @@ -64,12 +63,12 @@ class DataLabel(_DataLabelBase): separator: Incomplete extLst: Incomplete __elements__: ClassVar[tuple[str, ...]] - def __init__(self, idx: int = 0, **kw) -> None: ... + def __init__(self, idx: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt = 0, **kw) -> None: ... class DataLabelList(_DataLabelBase): - tagname: str + tagname: ClassVar[str] dLbl: Incomplete - delete: Incomplete + delete: NestedBool[Literal[True]] numFmt: Incomplete spPr: Incomplete txPr: Incomplete @@ -84,4 +83,6 @@ class DataLabelList(_DataLabelBase): separator: Incomplete extLst: Incomplete __elements__: ClassVar[tuple[str, ...]] - def __init__(self, dLbl=(), delete: Incomplete | None = None, **kw) -> None: ... + def __init__( + self, dLbl=(), delete: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, **kw + ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/layout.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/layout.pyi index 0d9b6a9cc939..8d5337afc28b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/layout.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/layout.pyi @@ -1,42 +1,46 @@ -from _typeshed import Incomplete, Unused +from _typeshed import Unused from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToFloat from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedMinMax, NestedNoneSet, NestedSet, _HasTagAndGet, _NestedNoneSetParam from openpyxl.descriptors.serialisable import Serialisable +_ManualLayoutMode: TypeAlias = Literal["edge", "factor"] +_ManualLayoutLayoutTarget: TypeAlias = Literal["inner", "outer"] + class ManualLayout(Serialisable): - tagname: str - layoutTarget: Incomplete - xMode: Incomplete - yMode: Incomplete - wMode: Incomplete - hMode: Incomplete - x: Incomplete - y: Incomplete - w: Incomplete + tagname: ClassVar[str] + layoutTarget: NestedNoneSet[_ManualLayoutLayoutTarget] + xMode: NestedNoneSet[_ManualLayoutMode] + yMode: NestedNoneSet[_ManualLayoutMode] + wMode: NestedSet[_ManualLayoutMode] + hMode: NestedSet[_ManualLayoutMode] + x: NestedMinMax[float, Literal[True]] + y: NestedMinMax[float, Literal[True]] + w: NestedMinMax[float, Literal[True]] width: Alias - h: Incomplete + h: NestedMinMax[float, Literal[True]] height: Alias extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - layoutTarget: Incomplete | None = None, - xMode: Incomplete | None = None, - yMode: Incomplete | None = None, - wMode: str = "factor", - hMode: str = "factor", - x: Incomplete | None = None, - y: Incomplete | None = None, - w: Incomplete | None = None, - h: Incomplete | None = None, + layoutTarget: _NestedNoneSetParam[_ManualLayoutLayoutTarget] = None, + xMode: _NestedNoneSetParam[_ManualLayoutMode] = None, + yMode: _NestedNoneSetParam[_ManualLayoutMode] = None, + wMode: _HasTagAndGet[_ManualLayoutMode] | _ManualLayoutMode = "factor", + hMode: _HasTagAndGet[_ManualLayoutMode] | _ManualLayoutMode = "factor", + x: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + y: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + w: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + h: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, extLst: Unused = None, ) -> None: ... class Layout(Serialisable): - tagname: str + tagname: ClassVar[str] manualLayout: Typed[ManualLayout, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/legend.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/legend.pyi index e7dfc21cfbe4..6ce837c98b00 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/legend.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/legend.pyi @@ -1,30 +1,39 @@ from _typeshed import Incomplete, Unused from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.layout import Layout from openpyxl.chart.shapes import GraphicalProperties from openpyxl.chart.text import RichText -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool, _ConvertibleToInt from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedInteger, NestedSet, _HasTagAndGet from openpyxl.descriptors.serialisable import Serialisable +_LegendLegendPos: TypeAlias = Literal["b", "tr", "l", "r", "t"] + class LegendEntry(Serialisable): - tagname: str - idx: Incomplete - delete: Incomplete + tagname: ClassVar[str] + idx: NestedInteger[Literal[False]] + delete: NestedBool[Literal[False]] txPr: Typed[RichText, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] - def __init__(self, idx: int = 0, delete: bool = False, txPr: RichText | None = None, extLst: Unused = None) -> None: ... + def __init__( + self, + idx: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt = 0, + delete: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = False, + txPr: RichText | None = None, + extLst: Unused = None, + ) -> None: ... class Legend(Serialisable): - tagname: str - legendPos: Incomplete + tagname: ClassVar[str] + legendPos: NestedSet[_LegendLegendPos] position: Alias legendEntry: Incomplete layout: Typed[Layout, Literal[True]] - overlay: Incomplete + overlay: NestedBool[Literal[True]] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias txPr: Typed[RichText, Literal[True]] @@ -33,10 +42,10 @@ class Legend(Serialisable): __elements__: ClassVar[tuple[str, ...]] def __init__( self, - legendPos: str = "r", + legendPos: _HasTagAndGet[_LegendLegendPos] | _LegendLegendPos = "r", legendEntry=(), layout: Layout | None = None, - overlay: Incomplete | None = None, + overlay: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, spPr: GraphicalProperties | None = None, txPr: RichText | None = None, extLst: Unused = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/line_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/line_chart.pyi index 122b13fd7b10..344250cfedc2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/line_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/line_chart.pyi @@ -1,19 +1,21 @@ from _typeshed import Incomplete, Unused -from abc import abstractmethod from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.axis import ChartLines, NumericAxis, _BaseAxis from openpyxl.chart.label import DataLabelList from openpyxl.chart.updown_bars import UpDownBars -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedSet, _HasTagAndGet from ._chart import ChartBase +_LineChartBaseGrouping: TypeAlias = Literal["percentStacked", "standard", "stacked"] + class _LineChartBase(ChartBase): - grouping: Incomplete - varyColors: Incomplete + grouping: NestedSet[_LineChartBaseGrouping] + varyColors: NestedBool[Literal[True]] ser: Incomplete dLbls: Typed[DataLabelList, Literal[True]] dataLabels: Alias @@ -21,19 +23,16 @@ class _LineChartBase(ChartBase): __elements__: ClassVar[tuple[str, ...]] def __init__( self, - grouping: str = "standard", - varyColors: Incomplete | None = None, + grouping: _HasTagAndGet[_LineChartBaseGrouping] | _LineChartBaseGrouping = "standard", + varyColors: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, ser=(), dLbls: DataLabelList | None = None, dropLines: ChartLines | None = None, **kw, ) -> None: ... - @property - @abstractmethod - def tagname(self) -> str: ... class LineChart(_LineChartBase): - tagname: str + tagname: ClassVar[str] grouping: Incomplete varyColors: Incomplete ser: Incomplete @@ -41,8 +40,8 @@ class LineChart(_LineChartBase): dropLines: Incomplete hiLowLines: Typed[ChartLines, Literal[True]] upDownBars: Typed[UpDownBars, Literal[True]] - marker: Incomplete - smooth: Incomplete + marker: NestedBool[Literal[True]] + smooth: NestedBool[Literal[True]] extLst: Typed[ExtensionList, Literal[True]] x_axis: Typed[_BaseAxis, Literal[False]] y_axis: Typed[NumericAxis, Literal[False]] @@ -51,14 +50,14 @@ class LineChart(_LineChartBase): self, hiLowLines: ChartLines | None = None, upDownBars: UpDownBars | None = None, - marker: Incomplete | None = None, - smooth: Incomplete | None = None, + marker: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + smooth: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, extLst: Unused = None, **kw, ) -> None: ... class LineChart3D(_LineChartBase): - tagname: str + tagname: ClassVar[str] grouping: Incomplete varyColors: Incomplete ser: Incomplete @@ -67,8 +66,8 @@ class LineChart3D(_LineChartBase): gapDepth: Incomplete hiLowLines: Typed[ChartLines, Literal[True]] upDownBars: Typed[UpDownBars, Literal[True]] - marker: Incomplete - smooth: Incomplete + marker: NestedBool[Literal[True]] + smooth: NestedBool[Literal[True]] extLst: Typed[ExtensionList, Literal[True]] x_axis: Typed[ExtensionList, Literal[False]] y_axis: Typed[ExtensionList, Literal[False]] @@ -79,7 +78,7 @@ class LineChart3D(_LineChartBase): gapDepth: Incomplete | None = None, hiLowLines: ChartLines | None = None, upDownBars: UpDownBars | None = None, - marker: Incomplete | None = None, - smooth: Incomplete | None = None, + marker: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + smooth: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, **kw, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/marker.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/marker.pyi index 1a19cf824b5f..e4a158e0dc73 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/marker.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/marker.pyi @@ -1,36 +1,41 @@ -from _typeshed import Incomplete, Unused +from _typeshed import Unused from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.picture import PictureOptions from openpyxl.chart.shapes import GraphicalProperties -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool, _ConvertibleToFloat, _ConvertibleToInt from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedInteger, NestedMinMax, NestedNoneSet, _HasTagAndGet, _NestedNoneSetParam from openpyxl.descriptors.serialisable import Serialisable +_MarkerSymbol: TypeAlias = Literal[ + "circle", "dash", "diamond", "dot", "picture", "plus", "square", "star", "triangle", "x", "auto" +] + class Marker(Serialisable): - tagname: str - symbol: Incomplete - size: Incomplete + tagname: ClassVar[str] + symbol: NestedNoneSet[_MarkerSymbol] + size: NestedMinMax[float, Literal[True]] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - symbol: Incomplete | None = None, - size: Incomplete | None = None, + symbol: _NestedNoneSetParam[_MarkerSymbol] = None, + size: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, spPr: GraphicalProperties | None = None, extLst: Unused = None, ) -> None: ... class DataPoint(Serialisable): - tagname: str - idx: Incomplete - invertIfNegative: Incomplete + tagname: ClassVar[str] + idx: NestedInteger[Literal[False]] + invertIfNegative: NestedBool[Literal[True]] marker: Typed[Marker, Literal[True]] - bubble3D: Incomplete - explosion: Incomplete + bubble3D: NestedBool[Literal[True]] + explosion: NestedInteger[Literal[True]] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias pictureOptions: Typed[PictureOptions, Literal[True]] @@ -38,11 +43,11 @@ class DataPoint(Serialisable): __elements__: ClassVar[tuple[str, ...]] def __init__( self, - idx: Incomplete | None = None, - invertIfNegative: Incomplete | None = None, + idx: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt, + invertIfNegative: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, marker: Marker | None = None, - bubble3D: Incomplete | None = None, - explosion: Incomplete | None = None, + bubble3D: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + explosion: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, spPr: GraphicalProperties | None = None, pictureOptions: PictureOptions | None = None, extLst: Unused = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/picture.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/picture.pyi index ac155086d62c..0de58c404a91 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/picture.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/picture.pyi @@ -1,21 +1,25 @@ -from _typeshed import Incomplete from typing import ClassVar +from typing_extensions import Literal, TypeAlias +from openpyxl.descriptors.base import _ConvertibleToBool, _ConvertibleToFloat +from openpyxl.descriptors.nested import NestedBool, NestedFloat, NestedNoneSet, _HasTagAndGet, _NestedNoneSetParam from openpyxl.descriptors.serialisable import Serialisable +_PictureOptionsPictureFormat: TypeAlias = Literal["stretch", "stack", "stackScale"] + class PictureOptions(Serialisable): - tagname: str - applyToFront: Incomplete - applyToSides: Incomplete - applyToEnd: Incomplete - pictureFormat: Incomplete - pictureStackUnit: Incomplete + tagname: ClassVar[str] + applyToFront: NestedBool[Literal[True]] + applyToSides: NestedBool[Literal[True]] + applyToEnd: NestedBool[Literal[True]] + pictureFormat: NestedNoneSet[_PictureOptionsPictureFormat] + pictureStackUnit: NestedFloat[Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - applyToFront: Incomplete | None = None, - applyToSides: Incomplete | None = None, - applyToEnd: Incomplete | None = None, - pictureFormat: Incomplete | None = None, - pictureStackUnit: Incomplete | None = None, + applyToFront: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + applyToSides: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + applyToEnd: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + pictureFormat: _NestedNoneSetParam[_PictureOptionsPictureFormat] = None, + pictureStackUnit: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pie_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pie_chart.pyi index ca67746110d7..8d2338cd40bf 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pie_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pie_chart.pyi @@ -1,39 +1,54 @@ from _typeshed import Incomplete, Unused -from abc import abstractmethod from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.axis import ChartLines from openpyxl.chart.label import DataLabelList -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool, _ConvertibleToFloat from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import ( + NestedBool, + NestedFloat, + NestedMinMax, + NestedNoneSet, + NestedSet, + _HasTagAndGet, + _NestedNoneSetParam, +) from openpyxl.descriptors.serialisable import Serialisable from ._chart import ChartBase +_ProjectedPieChartOfPieType: TypeAlias = Literal["pie", "bar"] +_ProjectedPieChartSplitType: TypeAlias = Literal["auto", "cust", "percent", "pos", "val"] + class _PieChartBase(ChartBase): - varyColors: Incomplete + varyColors: NestedBool[Literal[True]] ser: Incomplete dLbls: Typed[DataLabelList, Literal[True]] dataLabels: Alias __elements__: ClassVar[tuple[str, ...]] - def __init__(self, varyColors: bool = True, ser=(), dLbls: DataLabelList | None = None) -> None: ... - @property - @abstractmethod - def tagname(self) -> str: ... + def __init__( + self, + varyColors: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = True, + ser=(), + dLbls: DataLabelList | None = None, + ) -> None: ... class PieChart(_PieChartBase): - tagname: str + tagname: ClassVar[str] varyColors: Incomplete ser: Incomplete dLbls: Incomplete - firstSliceAng: Incomplete + firstSliceAng: NestedMinMax[float, Literal[False]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] - def __init__(self, firstSliceAng: int = 0, extLst: Unused = None, **kw) -> None: ... + def __init__( + self, firstSliceAng: _HasTagAndGet[_ConvertibleToFloat] | _ConvertibleToFloat = 0, extLst: Unused = None, **kw + ) -> None: ... class PieChart3D(_PieChartBase): - tagname: str + tagname: ClassVar[str] varyColors: Incomplete ser: Incomplete dLbls: Incomplete @@ -41,46 +56,52 @@ class PieChart3D(_PieChartBase): __elements__: ClassVar[tuple[str, ...]] class DoughnutChart(_PieChartBase): - tagname: str + tagname: ClassVar[str] varyColors: Incomplete ser: Incomplete dLbls: Incomplete - firstSliceAng: Incomplete - holeSize: Incomplete + firstSliceAng: NestedMinMax[float, Literal[False]] + holeSize: NestedMinMax[float, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] - def __init__(self, firstSliceAng: int = 0, holeSize: int = 10, extLst: Unused = None, **kw) -> None: ... + def __init__( + self, + firstSliceAng: _HasTagAndGet[_ConvertibleToFloat] | _ConvertibleToFloat = 0, + holeSize: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = 10, + extLst: Unused = None, + **kw, + ) -> None: ... class CustomSplit(Serialisable): - tagname: str + tagname: ClassVar[str] secondPiePt: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, secondPiePt=()) -> None: ... class ProjectedPieChart(_PieChartBase): - tagname: str + tagname: ClassVar[str] varyColors: Incomplete ser: Incomplete dLbls: Incomplete - ofPieType: Incomplete + ofPieType: NestedSet[_ProjectedPieChartOfPieType] type: Alias gapWidth: Incomplete - splitType: Incomplete - splitPos: Incomplete + splitType: NestedNoneSet[_ProjectedPieChartSplitType] + splitPos: NestedFloat[Literal[True]] custSplit: Typed[CustomSplit, Literal[True]] - secondPieSize: Incomplete + secondPieSize: NestedMinMax[float, Literal[True]] serLines: Typed[ChartLines, Literal[True]] join_lines: Alias extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - ofPieType: str = "pie", + ofPieType: _HasTagAndGet[_ProjectedPieChartOfPieType] | _ProjectedPieChartOfPieType = "pie", gapWidth: Incomplete | None = None, - splitType: str = "auto", - splitPos: Incomplete | None = None, + splitType: _NestedNoneSetParam[_ProjectedPieChartSplitType] = "auto", + splitPos: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, custSplit: CustomSplit | None = None, - secondPieSize: int = 75, + secondPieSize: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = 75, serLines: ChartLines | None = None, extLst: Unused = None, **kw, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pivot.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pivot.pyi index 2d9ae811141e..fd7baf8d6679 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pivot.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/pivot.pyi @@ -1,26 +1,34 @@ -from _typeshed import Incomplete, Unused -from typing import ClassVar +from _typeshed import Unused +from typing import ClassVar, overload from typing_extensions import Literal from openpyxl.chart.label import DataLabel as _DataLabel from openpyxl.chart.marker import Marker from openpyxl.chart.shapes import GraphicalProperties from openpyxl.chart.text import RichText -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToInt from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedInteger, NestedText, _HasTagAndGet from openpyxl.descriptors.serialisable import Serialisable class PivotSource(Serialisable): - tagname: str - name: Incomplete - fmtId: Incomplete + tagname: ClassVar[str] + name: NestedText[str, Literal[False]] + fmtId: NestedInteger[Literal[False]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] - def __init__(self, name: str | None = None, fmtId: Incomplete | None = None, extLst: Unused = None) -> None: ... + @overload + def __init__( + self, name: object, fmtId: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt, extLst: Unused = None + ) -> None: ... + @overload + def __init__( + self, name: object = None, *, fmtId: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt, extLst: Unused = None + ) -> None: ... class PivotFormat(Serialisable): - tagname: str - idx: Incomplete + tagname: ClassVar[str] + idx: NestedInteger[Literal[False]] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias txPr: Typed[RichText, Literal[True]] @@ -32,7 +40,7 @@ class PivotFormat(Serialisable): __elements__: ClassVar[tuple[str, ...]] def __init__( self, - idx: int = 0, + idx: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt = 0, spPr: GraphicalProperties | None = None, txPr: RichText | None = None, marker: Marker | None = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/plotarea.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/plotarea.pyi index ef67d2b57d69..539c03fc5b84 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/plotarea.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/plotarea.pyi @@ -5,16 +5,17 @@ from typing_extensions import Literal from openpyxl.chart.layout import Layout from openpyxl.chart.shapes import GraphicalProperties from openpyxl.chart.text import RichText -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, _HasTagAndGet from openpyxl.descriptors.serialisable import Serialisable class DataTable(Serialisable): - tagname: str - showHorzBorder: Incomplete - showVertBorder: Incomplete - showOutline: Incomplete - showKeys: Incomplete + tagname: ClassVar[str] + showHorzBorder: NestedBool[Literal[True]] + showVertBorder: NestedBool[Literal[True]] + showOutline: NestedBool[Literal[True]] + showKeys: NestedBool[Literal[True]] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias txPr: Typed[RichText, Literal[True]] @@ -22,17 +23,17 @@ class DataTable(Serialisable): __elements__: ClassVar[tuple[str, ...]] def __init__( self, - showHorzBorder: Incomplete | None = None, - showVertBorder: Incomplete | None = None, - showOutline: Incomplete | None = None, - showKeys: Incomplete | None = None, + showHorzBorder: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + showVertBorder: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + showOutline: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + showKeys: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, spPr: GraphicalProperties | None = None, txPr: RichText | None = None, extLst: Unused = None, ) -> None: ... class PlotArea(Serialisable): - tagname: str + tagname: ClassVar[str] layout: Typed[Layout, Literal[True]] dTable: Typed[DataTable, Literal[True]] spPr: Typed[GraphicalProperties, Literal[True]] @@ -68,6 +69,6 @@ class PlotArea(Serialisable): _axes=(), extLst: Unused = None, ) -> None: ... - def to_tree(self, tagname: Incomplete | None = None, idx: Incomplete | None = None, namespace: Incomplete | None = None): ... + def to_tree(self, tagname: str | None = None, idx: Incomplete | None = None, namespace: str | None = None): ... @classmethod def from_tree(cls, node): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/print_settings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/print_settings.pyi index c7f5ba8811fe..f6c7a329dc1c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/print_settings.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/print_settings.pyi @@ -7,7 +7,7 @@ from openpyxl.worksheet.header_footer import HeaderFooter from openpyxl.worksheet.page import PrintPageSetup class PageMargins(Serialisable): - tagname: str + tagname: ClassVar[str] l: Float[Literal[False]] left: Alias r: Float[Literal[False]] @@ -29,7 +29,7 @@ class PageMargins(Serialisable): ) -> None: ... class PrintSettings(Serialisable): - tagname: str + tagname: ClassVar[str] headerFooter: Typed[HeaderFooter, Literal[True]] pageMargins: Typed[PageMargins, Literal[True]] pageSetup: Typed[PrintPageSetup, Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/radar_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/radar_chart.pyi index 93cda00014ca..68d53d622024 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/radar_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/radar_chart.pyi @@ -1,19 +1,22 @@ from _typeshed import Incomplete, Unused from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.axis import NumericAxis, TextAxis from openpyxl.chart.label import DataLabelList -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedSet, _HasTagAndGet from ._chart import ChartBase +_RadarChartRadarStyle: TypeAlias = Literal["standard", "marker", "filled"] + class RadarChart(ChartBase): - tagname: str - radarStyle: Incomplete + tagname: ClassVar[str] + radarStyle: NestedSet[_RadarChartRadarStyle] type: Alias - varyColors: Incomplete + varyColors: NestedBool[Literal[True]] ser: Incomplete dLbls: Typed[DataLabelList, Literal[True]] dataLabels: Alias @@ -23,8 +26,8 @@ class RadarChart(ChartBase): __elements__: ClassVar[tuple[str, ...]] def __init__( self, - radarStyle: str = "standard", - varyColors: Incomplete | None = None, + radarStyle: _HasTagAndGet[_RadarChartRadarStyle] | _RadarChartRadarStyle = "standard", + varyColors: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, ser=(), dLbls: DataLabelList | None = None, extLst: Unused = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/scatter_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/scatter_chart.pyi index 2aebe5b13b7a..59d92ba27e71 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/scatter_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/scatter_chart.pyi @@ -1,18 +1,21 @@ from _typeshed import Incomplete, Unused from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.axis import NumericAxis, TextAxis from openpyxl.chart.label import DataLabelList -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedNoneSet, _HasTagAndGet, _NestedNoneSetParam from ._chart import ChartBase as ChartBase +_ScatterChartScatterStyle: TypeAlias = Literal["line", "lineMarker", "marker", "smooth", "smoothMarker"] + class ScatterChart(ChartBase): - tagname: str - scatterStyle: Incomplete - varyColors: Incomplete + tagname: ClassVar[str] + scatterStyle: NestedNoneSet[_ScatterChartScatterStyle] + varyColors: NestedBool[Literal[True]] ser: Incomplete dLbls: Typed[DataLabelList, Literal[True]] dataLabels: Alias @@ -22,8 +25,8 @@ class ScatterChart(ChartBase): __elements__: ClassVar[tuple[str, ...]] def __init__( self, - scatterStyle: Incomplete | None = None, - varyColors: Incomplete | None = None, + scatterStyle: _NestedNoneSetParam[_ScatterChartScatterStyle] = None, + varyColors: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, ser=(), dLbls: DataLabelList | None = None, extLst: Unused = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series.pyi index 7dcb7b7713c7..b87eac1d9ebe 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/series.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete, Unused from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.data_source import AxDataSource, NumDataSource, StrRef from openpyxl.chart.error_bar import ErrorBars @@ -9,24 +9,27 @@ from openpyxl.chart.marker import Marker from openpyxl.chart.picture import PictureOptions from openpyxl.chart.shapes import GraphicalProperties from openpyxl.chart.trendline import Trendline -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool, _ConvertibleToInt from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedInteger, NestedNoneSet, NestedText, _HasTagAndGet, _NestedNoneSetParam from openpyxl.descriptors.serialisable import Serialisable +_SeriesShape: TypeAlias = Literal["cone", "coneToMax", "box", "cylinder", "pyramid", "pyramidToMax"] + attribute_mapping: Incomplete class SeriesLabel(Serialisable): - tagname: str + tagname: ClassVar[str] strRef: Typed[StrRef, Literal[True]] - v: Incomplete + v: NestedText[str, Literal[True]] value: Alias __elements__: ClassVar[tuple[str, ...]] - def __init__(self, strRef: StrRef | None = None, v: Incomplete | None = None) -> None: ... + def __init__(self, strRef: StrRef | None = None, v: object = None) -> None: ... class Series(Serialisable): - tagname: str - idx: Incomplete - order: Incomplete + tagname: ClassVar[str] + idx: NestedInteger[Literal[False]] + order: NestedInteger[Literal[False]] tx: Typed[SeriesLabel, Literal[True]] title: Alias spPr: Typed[GraphicalProperties, Literal[True]] @@ -42,21 +45,21 @@ class Series(Serialisable): identifiers: Alias val: Typed[NumDataSource, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] - invertIfNegative: Incomplete - shape: Incomplete + invertIfNegative: NestedBool[Literal[True]] + shape: NestedNoneSet[_SeriesShape] xVal: Typed[AxDataSource, Literal[True]] yVal: Typed[NumDataSource, Literal[True]] bubbleSize: Typed[NumDataSource, Literal[True]] zVal: Alias - bubble3D: Incomplete + bubble3D: NestedBool[Literal[True]] marker: Typed[Marker, Literal[True]] - smooth: Incomplete - explosion: Incomplete + smooth: NestedBool[Literal[True]] + explosion: NestedInteger[Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - idx: int = 0, - order: int = 0, + idx: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt = 0, + order: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt = 0, tx: SeriesLabel | None = None, spPr: GraphicalProperties | None = None, pictureOptions: PictureOptions | None = None, @@ -66,18 +69,18 @@ class Series(Serialisable): errBars: ErrorBars | None = None, cat: AxDataSource | None = None, val: NumDataSource | None = None, - invertIfNegative: Incomplete | None = None, - shape: Incomplete | None = None, + invertIfNegative: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + shape: _NestedNoneSetParam[_SeriesShape] = None, xVal: AxDataSource | None = None, yVal: NumDataSource | None = None, bubbleSize: NumDataSource | None = None, - bubble3D: Incomplete | None = None, + bubble3D: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, marker: Marker | None = None, - smooth: Incomplete | None = None, - explosion: Incomplete | None = None, + smooth: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + explosion: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, extLst: Unused = None, ) -> None: ... - def to_tree(self, tagname: Incomplete | None = None, idx: Incomplete | None = None): ... # type: ignore[override] + def to_tree(self, tagname: str | None = None, idx: Incomplete | None = None): ... # type: ignore[override] class XYSeries(Series): idx: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/shapes.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/shapes.pyi index 11f1cb588689..f973f30047ad 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/shapes.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/shapes.pyi @@ -2,7 +2,8 @@ from _typeshed import Incomplete, Unused from typing import ClassVar from typing_extensions import Literal, TypeAlias -from openpyxl.descriptors.base import Alias, NoneSet, Typed +from openpyxl.descriptors.base import Alias, NoneSet, Typed, _ConvertibleToBool +from openpyxl.descriptors.nested import EmptyTag, _HasTagAndGet from openpyxl.descriptors.serialisable import Serialisable from openpyxl.drawing.fill import GradientFillProperties, PatternFillProperties from openpyxl.drawing.geometry import CustomGeometry2D, PresetGeometry2D, Scene3D, Shape3D, Transform2D @@ -13,13 +14,13 @@ _GraphicalPropertiesBwMode: TypeAlias = Literal[ ] class GraphicalProperties(Serialisable): - tagname: str + tagname: ClassVar[str] bwMode: NoneSet[_GraphicalPropertiesBwMode] xfrm: Typed[Transform2D, Literal[True]] transform: Alias custGeom: Typed[CustomGeometry2D, Literal[True]] prstGeom: Typed[PresetGeometry2D, Literal[True]] - noFill: Incomplete + noFill: EmptyTag[Literal[False]] solidFill: Incomplete gradFill: Typed[GradientFillProperties, Literal[True]] pattFill: Typed[PatternFillProperties, Literal[True]] @@ -34,7 +35,7 @@ class GraphicalProperties(Serialisable): self, bwMode: _GraphicalPropertiesBwMode | Literal["none"] | None = None, xfrm: Transform2D | None = None, - noFill: Incomplete | None = None, + noFill: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, solidFill: Incomplete | None = None, gradFill: GradientFillProperties | None = None, pattFill: PatternFillProperties | None = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/stock_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/stock_chart.pyi index f97cc12498cf..54ac6ae5ef52 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/stock_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/stock_chart.pyi @@ -11,7 +11,7 @@ from openpyxl.descriptors.excel import ExtensionList from ._chart import ChartBase class StockChart(ChartBase): - tagname: str + tagname: ClassVar[str] ser: Incomplete dLbls: Typed[DataLabelList, Literal[True]] dataLabels: Alias diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/surface_chart.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/surface_chart.pyi index ea9d2a3bb7a3..4178fcf21fee 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/surface_chart.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/surface_chart.pyi @@ -1,43 +1,48 @@ from _typeshed import Incomplete -from abc import abstractmethod from typing import ClassVar from typing_extensions import Literal from openpyxl.chart.axis import NumericAxis, SeriesAxis, TextAxis from openpyxl.chart.shapes import GraphicalProperties -from openpyxl.descriptors.base import Alias, Typed +from openpyxl.descriptors.base import Alias, Typed, _ConvertibleToBool, _ConvertibleToInt from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedInteger, _HasTagAndGet from openpyxl.descriptors.serialisable import Serialisable from ._3d import _3DBase from ._chart import ChartBase class BandFormat(Serialisable): - tagname: str - idx: Incomplete + tagname: ClassVar[str] + idx: NestedInteger[Literal[False]] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias __elements__: ClassVar[tuple[str, ...]] - def __init__(self, idx: int = 0, spPr: GraphicalProperties | None = None) -> None: ... + def __init__( + self, idx: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt = 0, spPr: GraphicalProperties | None = None + ) -> None: ... class BandFormatList(Serialisable): - tagname: str + tagname: ClassVar[str] bandFmt: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, bandFmt=()) -> None: ... class _SurfaceChartBase(ChartBase): - wireframe: Incomplete + wireframe: NestedBool[Literal[True]] ser: Incomplete bandFmts: Typed[BandFormatList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] - def __init__(self, wireframe: Incomplete | None = None, ser=(), bandFmts: BandFormatList | None = None, **kw) -> None: ... - @property - @abstractmethod - def tagname(self) -> str: ... + def __init__( + self, + wireframe: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + ser=(), + bandFmts: BandFormatList | None = None, + **kw, + ) -> None: ... class SurfaceChart3D(_SurfaceChartBase, _3DBase): - tagname: str + tagname: ClassVar[str] wireframe: Incomplete ser: Incomplete bandFmts: Incomplete @@ -49,7 +54,7 @@ class SurfaceChart3D(_SurfaceChartBase, _3DBase): def __init__(self, **kw) -> None: ... class SurfaceChart(SurfaceChart3D): - tagname: str + tagname: ClassVar[str] wireframe: Incomplete ser: Incomplete bandFmts: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/text.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/text.pyi index 72edd6947b2f..c9bebcc878b5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/text.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/text.pyi @@ -8,7 +8,7 @@ from openpyxl.descriptors.serialisable import Serialisable from openpyxl.drawing.text import ListStyle, RichTextProperties class RichText(Serialisable): - tagname: str + tagname: ClassVar[str] bodyPr: Typed[RichTextProperties, Literal[False]] properties: Alias lstStyle: Typed[ListStyle, Literal[True]] @@ -20,9 +20,9 @@ class RichText(Serialisable): ) -> None: ... class Text(Serialisable): - tagname: str + tagname: ClassVar[str] strRef: Typed[StrRef, Literal[True]] rich: Typed[RichText, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__(self, strRef: StrRef | None = None, rich: RichText | None = None) -> None: ... - def to_tree(self, tagname: Incomplete | None = None, idx: Incomplete | None = None, namespace: Incomplete | None = None): ... + def to_tree(self, tagname: str | None = None, idx: Incomplete | None = None, namespace: str | None = None): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/title.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/title.pyi index 49c4f8efdac3..5159ccb324da 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/title.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/title.pyi @@ -6,16 +6,17 @@ from openpyxl.chart.layout import Layout from openpyxl.chart.shapes import GraphicalProperties from openpyxl.chart.text import RichText, Text from openpyxl.descriptors import Strict, Typed -from openpyxl.descriptors.base import Alias +from openpyxl.descriptors.base import Alias, _ConvertibleToBool from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, _HasTagAndGet from openpyxl.descriptors.serialisable import Serialisable class Title(Serialisable): - tagname: str + tagname: ClassVar[str] tx: Typed[Text, Literal[True]] text: Alias layout: Typed[Layout, Literal[True]] - overlay: Incomplete + overlay: NestedBool[Literal[True]] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias txPr: Typed[RichText, Literal[True]] @@ -26,7 +27,7 @@ class Title(Serialisable): self, tx: Text | None = None, layout: Layout | None = None, - overlay: Incomplete | None = None, + overlay: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, spPr: GraphicalProperties | None = None, txPr: RichText | None = None, extLst: Unused = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/trendline.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/trendline.pyi index aff6c94730f7..409b34b25f21 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/trendline.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/trendline.pyi @@ -1,17 +1,20 @@ -from _typeshed import Incomplete, Unused +from _typeshed import Unused from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias from openpyxl.chart.data_source import NumFmt from openpyxl.chart.layout import Layout from openpyxl.chart.shapes import GraphicalProperties from openpyxl.chart.text import RichText, Text -from openpyxl.descriptors.base import Alias, String, Typed +from openpyxl.descriptors.base import Alias, String, Typed, _ConvertibleToBool, _ConvertibleToFloat, _ConvertibleToInt from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedBool, NestedFloat, NestedInteger, NestedSet, _HasTagAndGet from openpyxl.descriptors.serialisable import Serialisable +_TrendlineTrendlineType: TypeAlias = Literal["exp", "linear", "log", "movingAvg", "poly", "power"] + class TrendlineLabel(Serialisable): - tagname: str + tagname: ClassVar[str] layout: Typed[Layout, Literal[True]] tx: Typed[Text, Literal[True]] numFmt: Typed[NumFmt, Literal[True]] @@ -32,18 +35,18 @@ class TrendlineLabel(Serialisable): ) -> None: ... class Trendline(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[True]] spPr: Typed[ExtensionList, Literal[True]] graphicalProperties: Alias - trendlineType: Incomplete - order: Incomplete - period: Incomplete - forward: Incomplete - backward: Incomplete - intercept: Incomplete - dispRSqr: Incomplete - dispEq: Incomplete + trendlineType: NestedSet[_TrendlineTrendlineType] + order: NestedInteger[Literal[True]] + period: NestedInteger[Literal[True]] + forward: NestedFloat[Literal[True]] + backward: NestedFloat[Literal[True]] + intercept: NestedFloat[Literal[True]] + dispRSqr: NestedBool[Literal[True]] + dispEq: NestedBool[Literal[True]] trendlineLbl: Typed[ExtensionList, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] @@ -51,14 +54,14 @@ class Trendline(Serialisable): self, name: str | None = None, spPr: ExtensionList | None = None, - trendlineType: str = "linear", - order: Incomplete | None = None, - period: Incomplete | None = None, - forward: Incomplete | None = None, - backward: Incomplete | None = None, - intercept: Incomplete | None = None, - dispRSqr: Incomplete | None = None, - dispEq: Incomplete | None = None, + trendlineType: _HasTagAndGet[_TrendlineTrendlineType] | _TrendlineTrendlineType = "linear", + order: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + period: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + forward: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + backward: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + intercept: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + dispRSqr: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + dispEq: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, trendlineLbl: ExtensionList | None = None, extLst: Unused = None, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/updown_bars.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/updown_bars.pyi index 5e789b700f84..60e7ad44751e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/updown_bars.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chart/updown_bars.pyi @@ -8,7 +8,7 @@ from openpyxl.descriptors.excel import ExtensionList from openpyxl.descriptors.serialisable import Serialisable class UpDownBars(Serialisable): - tagname: str + tagname: ClassVar[str] gapWidth: Incomplete upBars: Typed[ChartLines, Literal[True]] downBars: Typed[ChartLines, Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/chartsheet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/chartsheet.pyi index 8df0c1eaaed8..d174f5ffab9e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/chartsheet.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/chartsheet.pyi @@ -19,7 +19,7 @@ from openpyxl.worksheet.page import PageMargins, PrintPageSetup _ChartsheetSheetState: TypeAlias = Literal["visible", "hidden", "veryHidden"] class Chartsheet(_WorkbookChild, Serialisable): - tagname: str + tagname: ClassVar[str] mime_type: str sheetPr: Typed[ChartsheetProperties, Literal[True]] sheetViews: Typed[ChartsheetViewList, Literal[False]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/custom.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/custom.pyi index 657bf69b6738..4298cd190c34 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/custom.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/custom.pyi @@ -10,7 +10,7 @@ from openpyxl.worksheet.page import PageMargins, PrintPageSetup _CustomChartsheetViewState: TypeAlias = Literal["visible", "hidden", "veryHidden"] class CustomChartsheetView(Serialisable): - tagname: str + tagname: ClassVar[str] guid: Incomplete scale: Integer[Literal[False]] state: Set[_CustomChartsheetViewState] @@ -44,7 +44,7 @@ class CustomChartsheetView(Serialisable): ) -> None: ... class CustomChartsheetViews(Serialisable): - tagname: str + tagname: ClassVar[str] customSheetView: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, customSheetView: Incomplete | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/properties.pyi index aa960694f8df..9c0eec5b6cba 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/properties.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/properties.pyi @@ -6,7 +6,7 @@ from openpyxl.descriptors.serialisable import Serialisable as Serialisable from openpyxl.styles.colors import Color class ChartsheetProperties(Serialisable): - tagname: str + tagname: ClassVar[str] published: Bool[Literal[True]] codeName: String[Literal[True]] tabColor: Typed[Color, Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/protection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/protection.pyi index 629fa3abc383..9504f187bea8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/protection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/protection.pyi @@ -7,7 +7,7 @@ from openpyxl.descriptors.serialisable import Serialisable from openpyxl.worksheet.protection import _Protected class ChartsheetProtection(Serialisable, _Protected): - tagname: str + tagname: ClassVar[str] algorithmName: String[Literal[True]] hashValue: Incomplete saltValue: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/publish.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/publish.pyi index 667706d14a46..92c6008a7ddb 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/publish.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/publish.pyi @@ -10,7 +10,7 @@ _WebPublishItemSourceType: TypeAlias = Literal[ ] class WebPublishItem(Serialisable): - tagname: str + tagname: ClassVar[str] id: Integer[Literal[False]] divId: String[Literal[False]] sourceType: Set[_WebPublishItemSourceType] @@ -46,7 +46,7 @@ class WebPublishItem(Serialisable): ) -> None: ... class WebPublishItems(Serialisable): - tagname: str + tagname: ClassVar[str] count: Integer[Literal[True]] webPublishItem: Incomplete __elements__: ClassVar[tuple[str, ...]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/relation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/relation.pyi index 95ae0902f6f4..718a65b37959 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/relation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/relation.pyi @@ -1,11 +1,12 @@ from _typeshed import Incomplete +from typing import ClassVar from typing_extensions import Literal from openpyxl.descriptors.base import Alias, Integer, _ConvertibleToInt from openpyxl.descriptors.serialisable import Serialisable class SheetBackgroundPicture(Serialisable): - tagname: str + tagname: ClassVar[str] id: Incomplete def __init__(self, id) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/views.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/views.pyi index 5f20f7c956cb..cdc5d1ad608d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/views.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/chartsheet/views.pyi @@ -7,7 +7,7 @@ from openpyxl.descriptors.excel import ExtensionList from openpyxl.descriptors.serialisable import Serialisable class ChartsheetView(Serialisable): - tagname: str + tagname: ClassVar[str] tabSelected: Bool[Literal[True]] zoomScale: Integer[Literal[True]] workbookViewId: Integer[Literal[False]] @@ -24,7 +24,7 @@ class ChartsheetView(Serialisable): ) -> None: ... class ChartsheetViewList(Serialisable): - tagname: str + tagname: ClassVar[str] sheetView: Incomplete extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/author.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/author.pyi index 89ef622d436e..ceba5327e302 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/author.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/author.pyi @@ -1,10 +1,11 @@ from _typeshed import Incomplete +from typing import ClassVar from openpyxl.descriptors.base import Alias from openpyxl.descriptors.serialisable import Serialisable class AuthorList(Serialisable): - tagname: str + tagname: ClassVar[str] author: Incomplete authors: Alias def __init__(self, author=()) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi index 2fb64a3b8f33..4d10664d0c4f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/comments/comment_sheet.pyi @@ -74,7 +74,7 @@ class Properties(Serialisable): ) -> None: ... class CommentRecord(Serialisable): - tagname: str + tagname: ClassVar[str] ref: String[Literal[False]] authorId: Integer[Literal[False]] guid: Incomplete @@ -104,7 +104,7 @@ class CommentRecord(Serialisable): def content(self): ... class CommentSheet(Serialisable): - tagname: str + tagname: ClassVar[str] authors: Typed[AuthorList, Literal[False]] commentList: Incomplete extLst: Typed[ExtensionList, Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/numbers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/numbers.pyi index 2d5d36fc12e0..5e49423c0bbc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/numbers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/numbers.pyi @@ -1,4 +1,17 @@ -from _typeshed import Incomplete +from decimal import Decimal +from typing_extensions import Final, TypeAlias -NUMERIC_TYPES: Incomplete -NUMPY: bool +# NOTE: Can't specify numpy as a dependency because openpyxl doesn't declare it as one +# import numpy +# if sys.version_info >= (3, 8): +# import numpy._typing + +# _NBitBase: TypeAlias = numpy._typing.NBitBase +# else: +# _NBitBase: TypeAlias = Any +# _NumericTypes: TypeAlias = int | float | Decimal | numpy.bool_ | numpy.floating[_NBitBase] | numpy.integer[_NBitBase] + +_NumericTypes: TypeAlias = int | float | Decimal +NUMERIC_TYPES: Final[tuple[type[_NumericTypes], ...]] + +NUMPY: Final[bool] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/strings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/strings.pyi index 0e3080ebd38e..7a6789a20400 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/strings.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/compat/strings.pyi @@ -1,5 +1,6 @@ -from _typeshed import Incomplete +import sys +from typing_extensions import Final -VER: Incomplete +VER: Final[sys._version_info] def safe_string(value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/base.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/base.pyi index 5fa2dac3356c..1360e48edc02 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/base.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/base.pyi @@ -30,10 +30,11 @@ class Descriptor(Generic[_T]): def __set__(self, instance: Serialisable | Strict, value: _T) -> None: ... class Typed(Descriptor[_T], Generic[_T, _N]): + __doc__: str + # Members optional in __init__ expected_type: type[_T] allow_none: _N nested: bool - __doc__: Incomplete @overload def __init__( @@ -265,7 +266,7 @@ class Bool(Convertible[bool, _N]): @overload def __init__(self: Bool[Literal[False]], name: str | None = None, *, allow_none: Literal[False] = False) -> None: ... def __set__( # type:ignore[override] # Different restrictions - self: Bool[Literal[True]], instance: Serialisable | Strict, value: _ConvertibleToBool | None + self, instance: Serialisable | Strict, value: _ConvertibleToBool ) -> None: ... class String(Typed[str, _N]): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/excel.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/excel.pyi index 4424ddc88d7c..7bf24ad9dc2a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/excel.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/excel.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -from typing import TypeVar +from typing import ClassVar, TypeVar from typing_extensions import Literal from . import Integer, MatchPattern, MinMax, Strict, String @@ -36,7 +36,7 @@ class ExtensionList(Serialisable): def __init__(self, ext=()) -> None: ... class Relation(String[Incomplete]): - namespace: Incomplete + namespace: ClassVar[str] allow_none: bool class Base64Binary(MatchPattern[str, Incomplete]): diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/namespace.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/namespace.pyi index db3a017fc2cc..68d35cd8cf57 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/namespace.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/namespace.pyi @@ -1,3 +1 @@ -from _typeshed import Incomplete - -def namespaced(obj, tagname, namespace: Incomplete | None = None): ... +def namespaced(obj, tagname, namespace: str | None = None): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/nested.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/nested.pyi index 2c0643e5d219..7a68e909d306 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/nested.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/nested.pyi @@ -1,41 +1,281 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused +from collections.abc import Callable, Iterable +from typing import Any, ClassVar, NoReturn, Protocol, TypeVar, overload +from typing_extensions import Literal, TypeAlias from openpyxl.descriptors import Strict from openpyxl.descriptors.base import Bool, Convertible, Descriptor, Float, Integer, MinMax, NoneSet, Set, String from openpyxl.descriptors.serialisable import Serialisable +from openpyxl.drawing.fill import Blip +from openpyxl.xml.functions import Element -# NOTE: # type: ignore[misc]: Class does not reimplement the relevant methods, so runtime also has incompatible supertypes - -class Nested(Descriptor[Incomplete]): - nested: bool - attribute: str - def __set__(self, instance: Serialisable | Strict, value) -> None: ... - def from_tree(self, node): ... - def to_tree( - self, tagname: Incomplete | None = None, value: Incomplete | None = None, namespace: Incomplete | None = None - ): ... - -class NestedValue(Nested, Convertible[Incomplete, Incomplete]): ... # type: ignore[misc] - -class NestedText(NestedValue): - def from_tree(self, node): ... - def to_tree( - self, tagname: Incomplete | None = None, value: Incomplete | None = None, namespace: Incomplete | None = None - ): ... - -class NestedFloat(NestedValue, Float[Incomplete]): ... # type: ignore[misc] -class NestedInteger(NestedValue, Integer[Incomplete]): ... # type: ignore[misc] -class NestedString(NestedValue, String[Incomplete]): ... # type: ignore[misc] - -class NestedBool(NestedValue, Bool[Incomplete]): # type: ignore[misc] - def from_tree(self, node): ... - -class NestedNoneSet(Nested, NoneSet[Incomplete]): ... -class NestedSet(Nested, Set[Incomplete]): ... -class NestedMinMax(Nested, MinMax[Incomplete, Incomplete]): ... # type: ignore[misc] - -class EmptyTag(Nested, Bool[Incomplete]): # type: ignore[misc] - def from_tree(self, node): ... - def to_tree( - self, tagname: Incomplete | None = None, value: Incomplete | None = None, namespace: Incomplete | None = None - ): ... +from .base import _M, _N, _T, _ConvertibleToBool, _ConvertibleToFloat, _ConvertibleToInt, _ExpectedTypeParam + +_T_co = TypeVar("_T_co", covariant=True) + +# Usually an Element() from either lxml or xml.etree (has a 'tag' element) +class _HasTagAndGet(Protocol[_T_co]): + tag: Any # str | None | Callable[..., Any] + def get(self, __value: str) -> _T_co | None: ... + +class _HasTagAndText(Protocol): + tag: str | Callable[..., Any] + text: str + +_NestedNoneSetParam: TypeAlias = _HasTagAndGet[_T | Literal["none"] | None] | _T | Literal["none"] | None + +# NOTE: type: ignore[misc]: Class does not reimplement the relevant methods, so runtime also has incompatible supertypes + +class Nested(Descriptor[_T]): + nested: ClassVar[Literal[True]] + attribute: ClassVar[str] + # Members optional in __init__ + expected_type: type[_T] + allow_none: bool + namespace: str | None + # In usage, "Nested" is closed to "Typed" than "Descriptor", but doesn't use allow_none + def __init__( + self: Nested[_T], + name: str | None = None, + *, + expected_type: _ExpectedTypeParam[_T], + allow_none: bool = False, + nested: Unused = True, + namespace: str | None = None, + ) -> None: ... + def __get__(self, instance: Serialisable | Strict, cls: type | None) -> _T: ... + def __set__(self, instance: Serialisable | Strict, value: _HasTagAndGet[_T] | _T) -> None: ... + def from_tree(self, node: _HasTagAndGet[_T]) -> _T: ... + def to_tree(self, tagname: str | None = None, value: Incomplete | None = None, namespace: str | None = None) -> Element: ... + +class NestedValue(Nested[_T], Convertible[_T, _N]): # type: ignore[misc] + @overload + def __init__( + self: NestedValue[_T, Literal[True]], + name: str | None = None, + *, + expected_type: _ExpectedTypeParam[_T], + allow_none: Literal[True], + ) -> None: ... + @overload + def __init__( + self: NestedValue[_T, Literal[False]], + name: str | None = None, + *, + expected_type: _ExpectedTypeParam[_T], + allow_none: Literal[False] = False, + ) -> None: ... + @overload + def __get__(self: NestedValue[_T, Literal[True]], instance: Serialisable | Strict, cls: type | None = None) -> _T | None: ... + @overload + def __get__(self: NestedValue[_T, Literal[False]], instance: Serialisable | Strict, cls: type | None = None) -> _T: ... + # NOTE: It is currently impossible to make a generic based on the parameter type of another generic + # So we implement explicitely the types used internally + # str | Blip + @overload + def __set__( + self: NestedValue[str, bool] | NestedValue[Blip, bool], + instance: Serialisable | Strict, + value: object, # Not[None] when _N = False + ) -> None: ... + # bool + @overload + def __set__( + self: NestedValue[bool, bool], + instance: Serialisable | Strict, + value: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool, + ) -> None: ... + # int + @overload + def __set__( + self: NestedValue[int, Literal[True]], + instance: Serialisable | Strict, + value: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + ) -> None: ... + @overload + def __set__( + self: NestedValue[int, Literal[False]], + instance: Serialisable | Strict, + value: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt, + ) -> None: ... + # float + @overload + def __set__( + self: NestedValue[float, Literal[True]], + instance: Serialisable | Strict, + value: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None, + ) -> None: ... + @overload + def __set__( + self: NestedValue[float, Literal[False]], + instance: Serialisable | Strict, + value: _HasTagAndGet[_ConvertibleToFloat] | _ConvertibleToFloat, + ) -> None: ... + # Anything else + @overload + def __set__( + self: NestedValue[_T, Literal[True]], + instance: Serialisable | Strict, + value: _HasTagAndGet[_T | int | Any] | _T | int | Any | None, + ) -> None: ... + +class NestedText(NestedValue[_T, _N]): + @overload + def __init__( + self: NestedText[_T, Literal[True]], + name: str | None = None, + *, + expected_type: _ExpectedTypeParam[_T], + allow_none: Literal[True], + ) -> None: ... + @overload + def __init__( + self: NestedText[_T, Literal[False]], + name: str | None = None, + *, + expected_type: _ExpectedTypeParam[_T], + allow_none: Literal[False] = False, + ) -> None: ... + @overload + def __get__(self: NestedText[_T, Literal[True]], instance: Serialisable | Strict, cls: type | None = None) -> _T | None: ... + @overload + def __get__(self: NestedText[_T, Literal[False]], instance: Serialisable | Strict, cls: type | None = None) -> _T: ... + # NOTE: It is currently impossible to make a generic based on the parameter type of another generic + # So we implement explicitely the types used internally + # str + @overload + def __set__( # type: ignore[misc] # Incompatible return type because of NoReturn + self: NestedValue[str, bool], instance: Serialisable | Strict, value: object # Not[None] when _N = False + ) -> None: ... + # int + @overload + def __set__( + self: NestedValue[int, Literal[True]], instance: Serialisable | Strict, value: _ConvertibleToInt | None + ) -> None: ... + @overload + def __set__(self: NestedValue[int, Literal[False]], instance: Serialisable | Strict, value: _ConvertibleToInt) -> None: ... + # If expected type (_T) is not str, it's impossible to use an Element as the value + @overload + def __set__(self: NestedValue[_T, Literal[True]], instance: Serialisable | Strict, value: _HasTagAndGet[Any]) -> NoReturn: ... + # Anything else + @overload + def __set__(self: NestedValue[_T, Literal[True]], instance: Serialisable | Strict, value: _T | int | Any | None) -> None: ... + def from_tree(self, node: _HasTagAndText) -> str: ... # type: ignore[override] + def to_tree(self, tagname: str | None = None, value: Incomplete | None = None, namespace: str | None = None) -> Element: ... + +class NestedFloat(NestedValue[float, _N], Float[_N]): # type: ignore[misc] + @overload + def __init__(self: NestedFloat[Literal[True]], name: str | None = None, *, allow_none: Literal[True]) -> None: ... + @overload + def __init__(self: NestedFloat[Literal[False]], name: str | None = None, *, allow_none: Literal[False] = False) -> None: ... + +class NestedInteger(NestedValue[int, _N], Integer[_N]): # type: ignore[misc] + @overload + def __init__(self: NestedInteger[Literal[True]], name: str | None = None, *, allow_none: Literal[True]) -> None: ... + @overload + def __init__(self: NestedInteger[Literal[False]], name: str | None = None, *, allow_none: Literal[False] = False) -> None: ... + +class NestedString(NestedValue[str, _N], String[_N]): # type: ignore[misc] + @overload + def __init__(self: NestedString[Literal[True]], name: str | None = None, *, allow_none: Literal[True]) -> None: ... + @overload + def __init__(self: NestedString[Literal[False]], name: str | None = None, *, allow_none: Literal[False] = False) -> None: ... + +class NestedBool(NestedValue[bool, _N], Bool[_N]): # type: ignore[misc] + @overload + def __init__(self: NestedBool[Literal[True]], name: str | None = None, *, allow_none: Literal[True]) -> None: ... + @overload + def __init__(self: NestedBool[Literal[False]], name: str | None = None, *, allow_none: Literal[False] = False) -> None: ... + def __set__( # type:ignore[override] # Different restrictions + self, instance: Serialisable | Strict, value: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool + ) -> None: ... + def from_tree(self, node) -> bool: ... # type: ignore[override] # Actual overriden return type + +class NestedNoneSet(Nested[_T | None], NoneSet[_T]): # type: ignore[misc] + def __init__(self, name: str | None = None, *, values: Iterable[_T | None]) -> None: ... + def __set__(self, instance: Serialisable | Strict, value: _NestedNoneSetParam[_T]) -> None: ... + +class NestedSet(Nested[_T], Set[_T]): + def __init__(self, name: str | None = None, *, values: Iterable[_T]) -> None: ... + +class NestedMinMax(Nested[_M], MinMax[_M, _N]): # type: ignore[misc] + @overload + def __init__( + self: NestedMinMax[int, Literal[True]], + *, + expected_type: _ExpectedTypeParam[int], + allow_none: Literal[True], + min: float, + max: float, + ) -> None: ... + @overload + def __init__( + self: NestedMinMax[int, Literal[False]], + *, + expected_type: _ExpectedTypeParam[int], + allow_none: Literal[False] = False, + min: float, + max: float, + ) -> None: ... + # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads + @overload + def __init__( + self: NestedMinMax[float, Literal[True]], + *, + expected_type: _ExpectedTypeParam[float] = ..., + allow_none: Literal[True], + min: float, + max: float, + ) -> None: ... + @overload + def __init__( + self: NestedMinMax[float, Literal[False]], + *, + expected_type: _ExpectedTypeParam[float] = ..., + allow_none: Literal[False] = False, + min: float, + max: float, + ) -> None: ... + @overload + def __get__(self: NestedMinMax[_M, Literal[True]], instance: Serialisable | Strict, cls: type | None = None) -> _M | None: ... + @overload + def __get__(self: NestedMinMax[_M, Literal[False]], instance: Serialisable | Strict, cls: type | None = None) -> _M: ... + @overload # type:ignore[override] # Different restrictions + def __set__( + self: NestedMinMax[int, Literal[True]], + instance: Serialisable | Strict, + value: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + ) -> None: ... + @overload + def __set__( + self: NestedMinMax[int, Literal[False]], + instance: Serialisable | Strict, + value: _HasTagAndGet[_ConvertibleToInt] | _ConvertibleToInt, + ) -> None: ... + @overload + def __set__( + self: NestedMinMax[float, Literal[True]], + instance: Serialisable | Strict, + value: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None, + ) -> None: ... + @overload + def __set__( + self: NestedMinMax[float, Literal[False]], + instance: Serialisable | Strict, + value: _HasTagAndGet[_ConvertibleToFloat] | _ConvertibleToFloat, + ) -> None: ... + +class EmptyTag(Nested[bool], Bool[_N]): # type: ignore[misc] + @overload + def __init__(self: EmptyTag[Literal[True]], name: str | None = None, *, allow_none: Literal[True]) -> None: ... + @overload + def __init__(self: EmptyTag[Literal[False]], name: str | None = None, *, allow_none: Literal[False] = False) -> None: ... + @overload + def __get__(self: EmptyTag[Literal[True]], instance: Serialisable | Strict, cls: type | None = None) -> bool | None: ... + @overload + def __get__(self: EmptyTag[Literal[False]], instance: Serialisable | Strict, cls: type | None = None) -> bool: ... + def __set__( # type:ignore[override] # Different restrictions + self, instance: Serialisable | Strict, value: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool + ) -> None: ... + def from_tree(self, node: Unused) -> Literal[True]: ... # type: ignore[override] # Actual overriden return type + def to_tree(self, tagname: str | None = None, value: Incomplete | None = None, namespace: str | None = None) -> Element: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi index 0a76df3a3497..333a592a2d40 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/sequence.pyi @@ -13,21 +13,21 @@ class Sequence(Descriptor[Incomplete]): idx_base: int unique: bool def __set__(self, instance: Serialisable | Strict, seq) -> None: ... - def to_tree(self, tagname, obj, namespace: Incomplete | None = None) -> Generator[Incomplete, None, None]: ... + def to_tree(self, tagname, obj, namespace: str | None = None) -> Generator[Incomplete, None, None]: ... class ValueSequence(Sequence): attribute: str - def to_tree(self, tagname, obj, namespace: Incomplete | None = None) -> Generator[Incomplete, None, None]: ... + def to_tree(self, tagname, obj, namespace: str | None = None) -> Generator[Incomplete, None, None]: ... def from_tree(self, node): ... class NestedSequence(Sequence): count: bool - def to_tree(self, tagname, obj, namespace: Incomplete | None = None): ... + def to_tree(self, tagname, obj, namespace: str | None = None): ... def from_tree(self, node): ... class MultiSequence(Sequence): def __set__(self, instance: Serialisable | Strict, seq) -> None: ... - def to_tree(self, tagname, obj, namespace: Incomplete | None = None) -> Generator[Incomplete, None, None]: ... + def to_tree(self, tagname, obj, namespace: str | None = None) -> Generator[Incomplete, None, None]: ... class MultiSequencePart(Alias): expected_type: type[Incomplete] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/serialisable.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/serialisable.pyi index 671ed3a82193..6f415875613e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/serialisable.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/descriptors/serialisable.pyi @@ -1,10 +1,11 @@ from _typeshed import Incomplete -from typing import ClassVar +from typing import Any, ClassVar, NoReturn +from typing_extensions import Final from openpyxl.descriptors import MetaSerialisable -KEYWORDS: Incomplete -seq_types: Incomplete +KEYWORDS: Final[frozenset[str]] +seq_types: Final[tuple[type[list[Any]], type[tuple[Any, ...]]]] class Serialisable(metaclass=MetaSerialisable): # These dunders are always set at runtime by MetaSerialisable so they can't be None @@ -13,14 +14,13 @@ class Serialisable(metaclass=MetaSerialisable): __elements__: ClassVar[tuple[str, ...]] __namespaced__: ClassVar[tuple[tuple[str, str], ...]] idx_base: int + # Needs overrides in many sub-classes. But a lot of subclasses are instanciated without overriding it, so can't be abstract @property - # TODO: needs overrides in many sub-classes - # @abstractmethod - def tagname(self) -> str: ... - namespace: Incomplete + def tagname(self) -> str | NoReturn: ... + namespace: ClassVar[str | None] @classmethod def from_tree(cls, node): ... - def to_tree(self, tagname: Incomplete | None = None, idx: Incomplete | None = None, namespace: Incomplete | None = None): ... + def to_tree(self, tagname: str | None = None, idx: Incomplete | None = None, namespace: str | None = None): ... def __iter__(self): ... def __eq__(self, other): ... def __ne__(self, other): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/colors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/colors.pyi index 29bba5a9052d..3ce090a3961c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/colors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/colors.pyi @@ -1,10 +1,11 @@ from _typeshed import Incomplete from typing import ClassVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Final, Literal, TypeAlias from openpyxl.descriptors import Strict, Typed -from openpyxl.descriptors.base import Alias, Integer, MinMax, Set, _ConvertibleToFloat, _ConvertibleToInt +from openpyxl.descriptors.base import Alias, Integer, MinMax, Set, _ConvertibleToBool, _ConvertibleToFloat, _ConvertibleToInt from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import EmptyTag, NestedInteger, NestedNoneSet, NestedValue, _HasTagAndGet, _NestedNoneSetParam from openpyxl.descriptors.serialisable import Serialisable _ColorSetType: TypeAlias = Literal[ @@ -42,7 +43,7 @@ _SystemColorVal: TypeAlias = Literal[ "menuHighlight", "menuBar", ] -_SchemeColorVal: TypeAlias = Literal[ +_SchemeColors: TypeAlias = Literal[ "bg1", "tx1", "bg2", @@ -61,41 +62,233 @@ _SchemeColorVal: TypeAlias = Literal[ "dk2", "lt2", ] +_PresetColors: TypeAlias = Literal[ + "aliceBlue", + "antiqueWhite", + "aqua", + "aquamarine", + "azure", + "beige", + "bisque", + "black", + "blanchedAlmond", + "blue", + "blueViolet", + "brown", + "burlyWood", + "cadetBlue", + "chartreuse", + "chocolate", + "coral", + "cornflowerBlue", + "cornsilk", + "crimson", + "cyan", + "darkBlue", + "darkCyan", + "darkGoldenrod", + "darkGray", + "darkGrey", + "darkGreen", + "darkKhaki", + "darkMagenta", + "darkOliveGreen", + "darkOrange", + "darkOrchid", + "darkRed", + "darkSalmon", + "darkSeaGreen", + "darkSlateBlue", + "darkSlateGray", + "darkSlateGrey", + "darkTurquoise", + "darkViolet", + "dkBlue", + "dkCyan", + "dkGoldenrod", + "dkGray", + "dkGrey", + "dkGreen", + "dkKhaki", + "dkMagenta", + "dkOliveGreen", + "dkOrange", + "dkOrchid", + "dkRed", + "dkSalmon", + "dkSeaGreen", + "dkSlateBlue", + "dkSlateGray", + "dkSlateGrey", + "dkTurquoise", + "dkViolet", + "deepPink", + "deepSkyBlue", + "dimGray", + "dimGrey", + "dodgerBlue", + "firebrick", + "floralWhite", + "forestGreen", + "fuchsia", + "gainsboro", + "ghostWhite", + "gold", + "goldenrod", + "gray", + "grey", + "green", + "greenYellow", + "honeydew", + "hotPink", + "indianRed", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderBlush", + "lawnGreen", + "lemonChiffon", + "lightBlue", + "lightCoral", + "lightCyan", + "lightGoldenrodYellow", + "lightGray", + "lightGrey", + "lightGreen", + "lightPink", + "lightSalmon", + "lightSeaGreen", + "lightSkyBlue", + "lightSlateGray", + "lightSlateGrey", + "lightSteelBlue", + "lightYellow", + "ltBlue", + "ltCoral", + "ltCyan", + "ltGoldenrodYellow", + "ltGray", + "ltGrey", + "ltGreen", + "ltPink", + "ltSalmon", + "ltSeaGreen", + "ltSkyBlue", + "ltSlateGray", + "ltSlateGrey", + "ltSteelBlue", + "ltYellow", + "lime", + "limeGreen", + "linen", + "magenta", + "maroon", + "medAquamarine", + "medBlue", + "medOrchid", + "medPurple", + "medSeaGreen", + "medSlateBlue", + "medSpringGreen", + "medTurquoise", + "medVioletRed", + "mediumAquamarine", + "mediumBlue", + "mediumOrchid", + "mediumPurple", + "mediumSeaGreen", + "mediumSlateBlue", + "mediumSpringGreen", + "mediumTurquoise", + "mediumVioletRed", + "midnightBlue", + "mintCream", + "mistyRose", + "moccasin", + "navajoWhite", + "navy", + "oldLace", + "olive", + "oliveDrab", + "orange", + "orangeRed", + "orchid", + "paleGoldenrod", + "paleGreen", + "paleTurquoise", + "paleVioletRed", + "papayaWhip", + "peachPuff", + "peru", + "pink", + "plum", + "powderBlue", + "purple", + "red", + "rosyBrown", + "royalBlue", + "saddleBrown", + "salmon", + "sandyBrown", + "seaGreen", + "seaShell", + "sienna", + "silver", + "skyBlue", + "slateBlue", + "slateGray", + "slateGrey", + "snow", + "springGreen", + "steelBlue", + "tan", + "teal", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "white", + "whiteSmoke", + "yellow", + "yellowGreen", +] -PRESET_COLORS: Incomplete -SCHEME_COLORS: Incomplete +PRESET_COLORS: Final[list[_PresetColors]] +SCHEME_COLORS: Final[list[_SchemeColors]] class Transform(Serialisable): ... class SystemColor(Serialisable): - tagname: str - namespace: Incomplete - tint: Incomplete - shade: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] + tint: NestedInteger[Literal[True]] + shade: NestedInteger[Literal[True]] comp: Typed[Transform, Literal[True]] inv: Typed[Transform, Literal[True]] gray: Typed[Transform, Literal[True]] - alpha: Incomplete - alphaOff: Incomplete - alphaMod: Incomplete - hue: Incomplete - hueOff: Incomplete - hueMod: Incomplete - sat: Incomplete - satOff: Incomplete - satMod: Incomplete - lum: Incomplete - lumOff: Incomplete - lumMod: Incomplete - red: Incomplete - redOff: Incomplete - redMod: Incomplete - green: Incomplete - greenOff: Incomplete - greenMod: Incomplete - blue: Incomplete - blueOff: Incomplete - blueMod: Incomplete + alpha: NestedInteger[Literal[True]] + alphaOff: NestedInteger[Literal[True]] + alphaMod: NestedInteger[Literal[True]] + hue: NestedInteger[Literal[True]] + hueOff: NestedInteger[Literal[True]] + hueMod: NestedInteger[Literal[True]] + sat: NestedInteger[Literal[True]] + satOff: NestedInteger[Literal[True]] + satMod: NestedInteger[Literal[True]] + lum: NestedInteger[Literal[True]] + lumOff: NestedInteger[Literal[True]] + lumMod: NestedInteger[Literal[True]] + red: NestedInteger[Literal[True]] + redOff: NestedInteger[Literal[True]] + redMod: NestedInteger[Literal[True]] + green: NestedInteger[Literal[True]] + greenOff: NestedInteger[Literal[True]] + greenMod: NestedInteger[Literal[True]] + blue: NestedInteger[Literal[True]] + blueOff: NestedInteger[Literal[True]] + blueMod: NestedInteger[Literal[True]] gamma: Typed[Transform, Literal[True]] invGamma: Typed[Transform, Literal[True]] val: Set[_SystemColorVal] @@ -105,45 +298,45 @@ class SystemColor(Serialisable): self, val: _SystemColorVal = "windowText", lastClr: Incomplete | None = None, - tint: Incomplete | None = None, - shade: Incomplete | None = None, + tint: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + shade: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, comp: Transform | None = None, inv: Transform | None = None, gray: Transform | None = None, - alpha: Incomplete | None = None, - alphaOff: Incomplete | None = None, - alphaMod: Incomplete | None = None, - hue: Incomplete | None = None, - hueOff: Incomplete | None = None, - hueMod: Incomplete | None = None, - sat: Incomplete | None = None, - satOff: Incomplete | None = None, - satMod: Incomplete | None = None, - lum: Incomplete | None = None, - lumOff: Incomplete | None = None, - lumMod: Incomplete | None = None, - red: Incomplete | None = None, - redOff: Incomplete | None = None, - redMod: Incomplete | None = None, - green: Incomplete | None = None, - greenOff: Incomplete | None = None, - greenMod: Incomplete | None = None, - blue: Incomplete | None = None, - blueOff: Incomplete | None = None, - blueMod: Incomplete | None = None, + alpha: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + alphaOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + alphaMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + hue: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + hueOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + hueMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + sat: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + satOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + satMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + lum: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + lumOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + lumMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + red: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + redOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + redMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + green: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + greenOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + greenMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + blue: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + blueOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + blueMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, gamma: Transform | None = None, invGamma: Transform | None = None, ) -> None: ... class HSLColor(Serialisable): - tagname: str + tagname: ClassVar[str] hue: Integer[Literal[False]] sat: MinMax[float, Literal[False]] lum: MinMax[float, Literal[False]] def __init__(self, hue: _ConvertibleToInt, sat: _ConvertibleToFloat, lum: _ConvertibleToFloat) -> None: ... class RGBPercent(Serialisable): - tagname: str + tagname: ClassVar[str] r: MinMax[float, Literal[False]] g: MinMax[float, Literal[False]] b: MinMax[float, Literal[False]] @@ -152,132 +345,132 @@ class RGBPercent(Serialisable): _RGBPercent: TypeAlias = RGBPercent class SchemeColor(Serialisable): - tagname: str - namespace: Incomplete - tint: Incomplete - shade: Incomplete - comp: Incomplete - inv: Incomplete - gray: Incomplete - alpha: Incomplete - alphaOff: Incomplete - alphaMod: Incomplete - hue: Incomplete - hueOff: Incomplete - hueMod: Incomplete - sat: Incomplete - satOff: Incomplete - satMod: Incomplete - lum: Incomplete - lumOff: Incomplete - lumMod: Incomplete - red: Incomplete - redOff: Incomplete - redMod: Incomplete - green: Incomplete - greenOff: Incomplete - greenMod: Incomplete - blue: Incomplete - blueOff: Incomplete - blueMod: Incomplete - gamma: Incomplete - invGamma: Incomplete - val: Set[_SchemeColorVal] + tagname: ClassVar[str] + namespace: ClassVar[str] + tint: NestedInteger[Literal[True]] + shade: NestedInteger[Literal[True]] + comp: EmptyTag[Literal[True]] + inv: NestedInteger[Literal[True]] + gray: NestedInteger[Literal[True]] + alpha: NestedInteger[Literal[True]] + alphaOff: NestedInteger[Literal[True]] + alphaMod: NestedInteger[Literal[True]] + hue: NestedInteger[Literal[True]] + hueOff: NestedInteger[Literal[True]] + hueMod: NestedInteger[Literal[True]] + sat: NestedInteger[Literal[True]] + satOff: NestedInteger[Literal[True]] + satMod: NestedInteger[Literal[True]] + lum: NestedInteger[Literal[True]] + lumOff: NestedInteger[Literal[True]] + lumMod: NestedInteger[Literal[True]] + red: NestedInteger[Literal[True]] + redOff: NestedInteger[Literal[True]] + redMod: NestedInteger[Literal[True]] + green: NestedInteger[Literal[True]] + greenOff: NestedInteger[Literal[True]] + greenMod: NestedInteger[Literal[True]] + blue: NestedInteger[Literal[True]] + blueOff: NestedInteger[Literal[True]] + blueMod: NestedInteger[Literal[True]] + gamma: EmptyTag[Literal[True]] + invGamma: EmptyTag[Literal[True]] + val: Set[_SchemeColors] __elements__: ClassVar[tuple[str, ...]] @overload def __init__( self, - tint: Incomplete | None = None, - shade: Incomplete | None = None, - comp: Incomplete | None = None, - inv: Incomplete | None = None, - gray: Incomplete | None = None, - alpha: Incomplete | None = None, - alphaOff: Incomplete | None = None, - alphaMod: Incomplete | None = None, - hue: Incomplete | None = None, - hueOff: Incomplete | None = None, - hueMod: Incomplete | None = None, - sat: Incomplete | None = None, - satOff: Incomplete | None = None, - satMod: Incomplete | None = None, - lum: Incomplete | None = None, - lumOff: Incomplete | None = None, - lumMod: Incomplete | None = None, - red: Incomplete | None = None, - redOff: Incomplete | None = None, - redMod: Incomplete | None = None, - green: Incomplete | None = None, - greenOff: Incomplete | None = None, - greenMod: Incomplete | None = None, - blue: Incomplete | None = None, - blueOff: Incomplete | None = None, - blueMod: Incomplete | None = None, - gamma: Incomplete | None = None, - invGamma: Incomplete | None = None, + tint: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + shade: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + comp: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + inv: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + gray: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + alpha: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + alphaOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + alphaMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + hue: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + hueOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + hueMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + sat: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + satOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + satMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + lum: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + lumOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + lumMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + red: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + redOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + redMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + green: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + greenOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + greenMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + blue: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + blueOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + blueMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + gamma: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + invGamma: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, *, - val: _SchemeColorVal, + val: _SchemeColors, ) -> None: ... @overload def __init__( self, - tint: Incomplete | None, - shade: Incomplete | None, - comp: Incomplete | None, - inv: Incomplete | None, - gray: Incomplete | None, - alpha: Incomplete | None, - alphaOff: Incomplete | None, - alphaMod: Incomplete | None, - hue: Incomplete | None, - hueOff: Incomplete | None, - hueMod: Incomplete | None, - sat: Incomplete | None, - satOff: Incomplete | None, - satMod: Incomplete | None, - lum: Incomplete | None, - lumOff: Incomplete | None, - lumMod: Incomplete | None, - red: Incomplete | None, - redOff: Incomplete | None, - redMod: Incomplete | None, - green: Incomplete | None, - greenOff: Incomplete | None, - greenMod: Incomplete | None, - blue: Incomplete | None, - blueOff: Incomplete | None, - blueMod: Incomplete | None, - gamma: Incomplete | None, - invGamma: Incomplete | None, - val: _SchemeColorVal, + tint: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + shade: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + comp: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None, + inv: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + gray: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + alpha: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + alphaOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + alphaMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + hue: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + hueOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + hueMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + sat: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + satOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + satMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + lum: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + lumOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + lumMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + red: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + redOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + redMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + green: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + greenOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + greenMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + blue: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + blueOff: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + blueMod: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None, + gamma: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None, + invGamma: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None, + val: _SchemeColors, ) -> None: ... class ColorChoice(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] scrgbClr: Typed[_RGBPercent, Literal[True]] RGBPercent: Alias - srgbClr: Incomplete + srgbClr: NestedValue[_RGBPercent, Literal[True]] RGB: Alias hslClr: Typed[HSLColor, Literal[True]] sysClr: Typed[SystemColor, Literal[True]] schemeClr: Typed[SystemColor, Literal[True]] - prstClr: Incomplete + prstClr: NestedNoneSet[_PresetColors] __elements__: ClassVar[tuple[str, ...]] def __init__( self, scrgbClr: _RGBPercent | None = None, - srgbClr: Incomplete | None = None, + srgbClr: _HasTagAndGet[_RGBPercent | None] | _RGBPercent | None = None, hslClr: HSLColor | None = None, sysClr: SystemColor | None = None, schemeClr: SystemColor | None = None, - prstClr: Incomplete | None = None, + prstClr: _NestedNoneSetParam[_PresetColors] = None, ) -> None: ... -_COLOR_SET: tuple[_ColorSetType, ...] +_COLOR_SET: Final[tuple[_ColorSetType, ...]] class ColorMapping(Serialisable): - tagname: str + tagname: ClassVar[str] bg1: Set[_ColorSetType] tx1: Set[_ColorSetType] bg2: Set[_ColorSetType] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/connector.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/connector.pyi index 565b1b08ee52..3216c7d1ecb7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/connector.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/connector.pyi @@ -39,7 +39,7 @@ class ConnectorNonVisual(Serialisable): def __init__(self, cNvPr: NonVisualDrawingProps, cNvCxnSpPr: NonVisualConnectorProperties) -> None: ... class ConnectorShape(Serialisable): - tagname: str + tagname: ClassVar[str] nvCxnSpPr: Typed[ConnectorNonVisual, Literal[False]] spPr: Typed[GraphicalProperties, Literal[False]] style: Typed[ShapeStyle, Literal[True]] @@ -55,7 +55,7 @@ class ConnectorShape(Serialisable): ) -> None: ... class ShapeMeta(Serialisable): - tagname: str + tagname: ClassVar[str] cNvPr: Typed[NonVisualDrawingProps, Literal[False]] cNvSpPr: Typed[NonVisualDrawingShapeProps, Literal[False]] def __init__(self, cNvPr: NonVisualDrawingProps, cNvSpPr: NonVisualDrawingShapeProps) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/effect.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/effect.pyi index 130714d4894a..98cd790bff8f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/effect.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/effect.pyi @@ -44,13 +44,13 @@ _PresetShadowEffectPrst: TypeAlias = Literal[ ] class TintEffect(Serialisable): - tagname: str + tagname: ClassVar[str] hue: Integer[Literal[False]] amt: Integer[Literal[False]] def __init__(self, hue: _ConvertibleToInt = 0, amt: _ConvertibleToInt = 0) -> None: ... class LuminanceEffect(Serialisable): - tagname: str + tagname: ClassVar[str] bright: Integer[Literal[False]] contrast: Integer[Literal[False]] def __init__(self, bright: _ConvertibleToInt = 0, contrast: _ConvertibleToInt = 0) -> None: ... @@ -62,7 +62,7 @@ class HSLEffect(Serialisable): def __init__(self, hue: _ConvertibleToInt, sat: _ConvertibleToInt, lum: _ConvertibleToInt) -> None: ... class GrayscaleEffect(Serialisable): - tagname: str + tagname: ClassVar[str] class FillOverlayEffect(Serialisable): blend: Set[_FillOverlayEffectBlend] @@ -140,7 +140,7 @@ class InnerShadowEffect(ColorChoice): def __init__(self, blurRad: _ConvertibleToFloat, dist: _ConvertibleToFloat, dir: _ConvertibleToInt, **kw) -> None: ... class OuterShadow(ColorChoice): - tagname: str + tagname: ClassVar[str] blurRad: Float[Literal[True]] dist: Float[Literal[True]] dir: Integer[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/fill.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/fill.pyi index 4ff6baf3da23..f416248318f7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/fill.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/fill.pyi @@ -15,8 +15,9 @@ from openpyxl.descriptors.base import ( _ConvertibleToInt, ) from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedNoneSet, NestedValue, _HasTagAndGet, _NestedNoneSetParam from openpyxl.descriptors.serialisable import Serialisable -from openpyxl.drawing.colors import ColorChoice, HSLColor, RGBPercent as _RGBPercent, SchemeColor, SystemColor +from openpyxl.drawing.colors import ColorChoice, HSLColor, RGBPercent as _RGBPercent, SchemeColor, SystemColor, _PresetColors from openpyxl.drawing.effect import ( AlphaBiLevelEffect, AlphaCeilingEffect, @@ -99,8 +100,8 @@ _BlipCstate: TypeAlias = Literal["email", "screen", "print", "hqprint"] _PathShadePropertiesPath: TypeAlias = Literal["shape", "circle", "rect"] class PatternFillProperties(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] prst: NoneSet[_PatternFillPropertiesPrst] preset: Alias fgClr: Typed[ColorChoice, Literal[True]] @@ -116,8 +117,8 @@ class PatternFillProperties(Serialisable): ) -> None: ... class RelativeRect(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] l: Incomplete left: Alias t: Incomplete @@ -131,52 +132,52 @@ class RelativeRect(Serialisable): ) -> None: ... class StretchInfoProperties(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] fillRect: Typed[RelativeRect, Literal[True]] def __init__(self, fillRect: RelativeRect = ...) -> None: ... class GradientStop(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] pos: MinMax[float, Literal[True]] scrgbClr: Typed[_RGBPercent, Literal[True]] RGBPercent: Alias - srgbClr: Incomplete + srgbClr: NestedValue[_RGBPercent, Literal[True]] RGB: Alias hslClr: Typed[HSLColor, Literal[True]] sysClr: Typed[SystemColor, Literal[True]] schemeClr: Typed[SchemeColor, Literal[True]] - prstClr: Incomplete + prstClr: NestedNoneSet[_PresetColors] __elements__: ClassVar[tuple[str, ...]] def __init__( self, pos: _ConvertibleToFloat | None = None, scrgbClr: _RGBPercent | None = None, - srgbClr: Incomplete | None = None, + srgbClr: _HasTagAndGet[_RGBPercent | None] | _RGBPercent | None = None, hslClr: HSLColor | None = None, sysClr: SystemColor | None = None, schemeClr: SchemeColor | None = None, - prstClr: Incomplete | None = None, + prstClr: _NestedNoneSetParam[_PresetColors] = None, ) -> None: ... class LinearShadeProperties(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] ang: Integer[Literal[False]] scaled: Bool[Literal[True]] def __init__(self, ang: _ConvertibleToInt, scaled: _ConvertibleToBool | None = None) -> None: ... class PathShadeProperties(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] path: Set[_PathShadePropertiesPath] fillToRect: Typed[RelativeRect, Literal[True]] def __init__(self, path: _PathShadePropertiesPath, fillToRect: RelativeRect | None = None) -> None: ... class GradientFillProperties(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] flip: NoneSet[_PropertiesFlip] rotWithShape: Bool[Literal[True]] gsLst: Incomplete @@ -197,29 +198,29 @@ class GradientFillProperties(Serialisable): ) -> None: ... class SolidColorFillProperties(Serialisable): - tagname: str + tagname: ClassVar[str] scrgbClr: Typed[_RGBPercent, Literal[True]] RGBPercent: Alias - srgbClr: Incomplete + srgbClr: NestedValue[_RGBPercent, Literal[True]] RGB: Alias hslClr: Typed[HSLColor, Literal[True]] sysClr: Typed[SystemColor, Literal[True]] schemeClr: Typed[SchemeColor, Literal[True]] - prstClr: Incomplete + prstClr: NestedNoneSet[_PresetColors] __elements__: ClassVar[tuple[str, ...]] def __init__( self, scrgbClr: _RGBPercent | None = None, - srgbClr: Incomplete | None = None, + srgbClr: _HasTagAndGet[_RGBPercent | None] | _RGBPercent | None = None, hslClr: HSLColor | None = None, sysClr: SystemColor | None = None, schemeClr: SchemeColor | None = None, - prstClr: Incomplete | None = None, + prstClr: _NestedNoneSetParam[_PresetColors] = None, ) -> None: ... class Blip(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] cstate: NoneSet[_BlipCstate] embed: Incomplete link: Incomplete @@ -306,7 +307,7 @@ class TileInfoProperties(Serialisable): ) -> None: ... class BlipFillProperties(Serialisable): - tagname: str + tagname: ClassVar[str] dpi: Integer[Literal[True]] rotWithShape: Bool[Literal[True]] blip: Typed[Blip, Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/geometry.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/geometry.pyi index 8b9b5321526c..272b618cf0a3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/geometry.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/geometry.pyi @@ -338,15 +338,15 @@ _PresetGeometry2DPrst: TypeAlias = Literal[ ] class Point2D(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] x: Incomplete y: Incomplete def __init__(self, x: Incomplete | None = None, y: Incomplete | None = None) -> None: ... class PositiveSize2D(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] cx: Integer[Literal[False]] width: Alias cy: Integer[Literal[False]] @@ -354,8 +354,8 @@ class PositiveSize2D(Serialisable): def __init__(self, cx: _ConvertibleToInt, cy: _ConvertibleToInt) -> None: ... class Transform2D(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] rot: Integer[Literal[True]] flipH: Bool[Literal[True]] flipV: Bool[Literal[True]] @@ -376,8 +376,8 @@ class Transform2D(Serialisable): ) -> None: ... class GroupTransform2D(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] rot: Integer[Literal[True]] flipH: Bool[Literal[True]] flipV: Bool[Literal[True]] @@ -398,14 +398,14 @@ class GroupTransform2D(Serialisable): ) -> None: ... class SphereCoords(Serialisable): - tagname: str + tagname: ClassVar[str] lat: Integer[Literal[False]] lon: Integer[Literal[False]] rev: Integer[Literal[False]] def __init__(self, lat: _ConvertibleToInt, lon: _ConvertibleToInt, rev: _ConvertibleToInt) -> None: ... class Camera(Serialisable): - tagname: str + tagname: ClassVar[str] prst: Set[_CameraPrst] fov: Integer[Literal[True]] zoom: Typed[Percentage, Literal[True]] @@ -419,21 +419,21 @@ class Camera(Serialisable): ) -> None: ... class LightRig(Serialisable): - tagname: str + tagname: ClassVar[str] rig: Set[_LightRigRig] dir: Set[_LightRigDir] rot: Typed[SphereCoords, Literal[True]] def __init__(self, rig: _LightRigRig, dir: _LightRigDir, rot: SphereCoords | None = None) -> None: ... class Vector3D(Serialisable): - tagname: str + tagname: ClassVar[str] dx: Integer[Literal[False]] dy: Integer[Literal[False]] dz: Integer[Literal[False]] def __init__(self, dx: _ConvertibleToInt, dy: _ConvertibleToInt, dz: _ConvertibleToInt) -> None: ... class Point3D(Serialisable): - tagname: str + tagname: ClassVar[str] x: Integer[Literal[False]] y: Integer[Literal[False]] z: Integer[Literal[False]] @@ -456,14 +456,14 @@ class Scene3D(Serialisable): ) -> None: ... class Bevel(Serialisable): - tagname: str + tagname: ClassVar[str] w: Integer[Literal[False]] h: Integer[Literal[False]] prst: NoneSet[_BevelPrst] def __init__(self, w: _ConvertibleToInt, h: _ConvertibleToInt, prst: _BevelPrst | Literal["none"] | None = None) -> None: ... class Shape3D(Serialisable): - namespace: Incomplete + namespace: ClassVar[str] z: Typed[Coordinate[bool], Literal[True]] extrusionH: Integer[Literal[True]] contourW: Integer[Literal[True]] @@ -569,7 +569,7 @@ class CustomGeometry2D(Serialisable): ) -> None: ... class PresetGeometry2D(Serialisable): - namespace: Incomplete + namespace: ClassVar[str] prst: Set[_PresetGeometry2DPrst] avLst: Typed[GeomGuideList, Literal[True]] def __init__(self, prst: _PresetGeometry2DPrst, avLst: GeomGuideList | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/graphic.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/graphic.pyi index 4e5e5b209103..a23c66b0b286 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/graphic.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/graphic.pyi @@ -30,33 +30,33 @@ class GraphicFrameLocking(Serialisable): ) -> None: ... class NonVisualGraphicFrameProperties(Serialisable): - tagname: str + tagname: ClassVar[str] graphicFrameLocks: Typed[GraphicFrameLocking, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] def __init__(self, graphicFrameLocks: GraphicFrameLocking | None = None, extLst: ExtensionList | None = None) -> None: ... class NonVisualGraphicFrame(Serialisable): - tagname: str + tagname: ClassVar[str] cNvPr: Typed[ExtensionList, Literal[False]] cNvGraphicFramePr: Typed[ExtensionList, Literal[False]] __elements__: ClassVar[tuple[str, ...]] def __init__(self, cNvPr: Incomplete | None = None, cNvGraphicFramePr: Incomplete | None = None) -> None: ... class GraphicData(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] uri: String[Literal[False]] chart: Typed[ChartRelation, Literal[True]] def __init__(self, uri: str = ..., chart: ChartRelation | None = None) -> None: ... class GraphicObject(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] graphicData: Typed[GraphicData, Literal[False]] def __init__(self, graphicData: GraphicData | None = None) -> None: ... class GraphicFrame(Serialisable): - tagname: str + tagname: ClassVar[str] nvGraphicFramePr: Typed[NonVisualGraphicFrame, Literal[False]] xfrm: Typed[XDRTransform2D, Literal[False]] graphic: Typed[GraphicObject, Literal[False]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/line.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/line.pyi index af2e168af425..325f59930498 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/line.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/line.pyi @@ -2,8 +2,18 @@ from _typeshed import Incomplete, Unused from typing import ClassVar from typing_extensions import Literal, TypeAlias -from openpyxl.descriptors.base import Alias, Integer, MinMax, NoneSet, Typed, _ConvertibleToFloat, _ConvertibleToInt +from openpyxl.descriptors.base import ( + Alias, + Integer, + MinMax, + NoneSet, + Typed, + _ConvertibleToBool, + _ConvertibleToFloat, + _ConvertibleToInt, +) from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import EmptyTag, NestedInteger, NestedNoneSet, _HasTagAndGet, _NestedNoneSetParam from openpyxl.descriptors.serialisable import Serialisable from openpyxl.drawing.fill import GradientFillProperties, PatternFillProperties @@ -12,10 +22,13 @@ _LineEndPropertiesWLen: TypeAlias = Literal["sm", "med", "lg"] _LinePropertiesCap: TypeAlias = Literal["rnd", "sq", "flat"] _LinePropertiesCmpd: TypeAlias = Literal["sng", "dbl", "thickThin", "thinThick", "tri"] _LinePropertiesAlgn: TypeAlias = Literal["ctr", "in"] +_LinePropertiesPrstDash: TypeAlias = Literal[ + "solid", "dot", "dash", "lgDash", "dashDot", "lgDashDot", "lgDashDotDot", "sysDash", "sysDot", "sysDashDot", "sysDashDotDot" +] class LineEndProperties(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] type: NoneSet[_LineEndPropertiesType] w: NoneSet[_LineEndPropertiesWLen] len: NoneSet[_LineEndPropertiesWLen] @@ -27,8 +40,8 @@ class LineEndProperties(Serialisable): ) -> None: ... class DashStop(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] d: Integer[Literal[False]] length: Alias sp: Integer[Literal[False]] @@ -40,23 +53,23 @@ class DashStopList(Serialisable): def __init__(self, ds: Incomplete | None = None) -> None: ... class LineProperties(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] w: MinMax[float, Literal[True]] width: Alias cap: NoneSet[_LinePropertiesCap] cmpd: NoneSet[_LinePropertiesCmpd] algn: NoneSet[_LinePropertiesAlgn] - noFill: Incomplete + noFill: EmptyTag[Literal[False]] solidFill: Incomplete gradFill: Typed[GradientFillProperties, Literal[True]] pattFill: Typed[PatternFillProperties, Literal[True]] - prstDash: Incomplete + prstDash: NestedNoneSet[_LinePropertiesPrstDash] dashStyle: Alias custDash: Typed[DashStop, Literal[True]] - round: Incomplete - bevel: Incomplete - miter: Incomplete + round: EmptyTag[Literal[False]] + bevel: EmptyTag[Literal[False]] + miter: NestedInteger[Literal[True]] headEnd: Typed[LineEndProperties, Literal[True]] tailEnd: Typed[LineEndProperties, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] @@ -67,15 +80,15 @@ class LineProperties(Serialisable): cap: _LinePropertiesCap | Literal["none"] | None = None, cmpd: _LinePropertiesCmpd | Literal["none"] | None = None, algn: _LinePropertiesAlgn | Literal["none"] | None = None, - noFill: Incomplete | None = None, + noFill: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, solidFill: Incomplete | None = None, gradFill: GradientFillProperties | None = None, pattFill: PatternFillProperties | None = None, - prstDash: Incomplete | None = None, + prstDash: _NestedNoneSetParam[_LinePropertiesPrstDash] = None, custDash: DashStop | None = None, - round: Incomplete | None = None, - bevel: Incomplete | None = None, - miter: Incomplete | None = None, + round: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, + bevel: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, + miter: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, headEnd: LineEndProperties | None = None, tailEnd: LineEndProperties | None = None, extLst: Unused = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/picture.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/picture.pyi index 27a0ceccfac2..776129e148ce 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/picture.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/picture.pyi @@ -11,8 +11,8 @@ from openpyxl.drawing.geometry import ShapeStyle from openpyxl.drawing.properties import NonVisualDrawingProps class PictureLocking(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] noCrop: Bool[Literal[True]] noGrp: Bool[Literal[True]] noSelect: Bool[Literal[True]] @@ -43,7 +43,7 @@ class PictureLocking(Serialisable): ) -> None: ... class NonVisualPictureProperties(Serialisable): - tagname: str + tagname: ClassVar[str] preferRelativeResize: Bool[Literal[True]] picLocks: Typed[PictureLocking, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] @@ -53,7 +53,7 @@ class NonVisualPictureProperties(Serialisable): ) -> None: ... class PictureNonVisual(Serialisable): - tagname: str + tagname: ClassVar[str] cNvPr: Typed[NonVisualDrawingProps, Literal[False]] cNvPicPr: Typed[NonVisualPictureProperties, Literal[False]] __elements__: ClassVar[tuple[str, ...]] @@ -62,7 +62,7 @@ class PictureNonVisual(Serialisable): ) -> None: ... class PictureFrame(Serialisable): - tagname: str + tagname: ClassVar[str] macro: String[Literal[True]] fPublished: Bool[Literal[True]] nvPicPr: Typed[PictureNonVisual, Literal[False]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/properties.pyi index 6addd6f8c0ce..a7b12d4462f9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/properties.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/properties.pyi @@ -13,7 +13,7 @@ _GroupShapePropertiesBwMode: TypeAlias = Literal[ ] class GroupShapeProperties(Serialisable): - tagname: str + tagname: ClassVar[str] bwMode: NoneSet[_GroupShapePropertiesBwMode] xfrm: Typed[GroupTransform2D, Literal[True]] scene3d: Typed[Scene3D, Literal[True]] @@ -27,8 +27,8 @@ class GroupShapeProperties(Serialisable): ) -> None: ... class GroupLocking(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] noGrp: Bool[Literal[True]] noUngrp: Bool[Literal[True]] noSelect: Bool[Literal[True]] @@ -59,14 +59,14 @@ class GroupLocking(Serialisable): ) -> None: ... class NonVisualGroupDrawingShapeProps(Serialisable): - tagname: str + tagname: ClassVar[str] grpSpLocks: Typed[GroupLocking, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__(self, grpSpLocks: Incomplete | None = None, extLst: Unused = None) -> None: ... class NonVisualDrawingShapeProps(Serialisable): - tagname: str + tagname: ClassVar[str] spLocks: Typed[GroupLocking, Literal[True]] txBax: Bool[Literal[True]] extLst: Typed[ExtensionList, Literal[True]] @@ -77,7 +77,7 @@ class NonVisualDrawingShapeProps(Serialisable): ) -> None: ... class NonVisualDrawingProps(Serialisable): - tagname: str + tagname: ClassVar[str] id: Incomplete name: String[Literal[False]] descr: String[Literal[True]] @@ -115,7 +115,7 @@ class NonVisualDrawingProps(Serialisable): ) -> None: ... class NonVisualGroupShape(Serialisable): - tagname: str + tagname: ClassVar[str] cNvPr: Typed[NonVisualDrawingProps, Literal[False]] cNvGrpSpPr: Typed[NonVisualGroupDrawingShapeProps, Literal[False]] __elements__: ClassVar[tuple[str, ...]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/relation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/relation.pyi index 05c831ed13de..46828b6f9767 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/relation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/relation.pyi @@ -1,9 +1,10 @@ from _typeshed import Incomplete +from typing import ClassVar from openpyxl.descriptors.serialisable import Serialisable class ChartRelation(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] id: Incomplete def __init__(self, id) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/spreadsheet_drawing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/spreadsheet_drawing.pyi index 13b70b2870d0..127666b66726 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/spreadsheet_drawing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/spreadsheet_drawing.pyi @@ -2,7 +2,8 @@ from _typeshed import Incomplete from typing import ClassVar from typing_extensions import Literal, TypeAlias -from openpyxl.descriptors.base import Alias, Bool, NoneSet, Typed, _ConvertibleToBool +from openpyxl.descriptors.base import Alias, Bool, NoneSet, Typed, _ConvertibleToBool, _ConvertibleToInt +from openpyxl.descriptors.nested import NestedText from openpyxl.descriptors.serialisable import Serialisable from openpyxl.drawing.connector import Shape from openpyxl.drawing.graphic import GraphicFrame, GroupShape @@ -19,12 +20,14 @@ class AnchorClientData(Serialisable): ) -> None: ... class AnchorMarker(Serialisable): - tagname: str - col: Incomplete - colOff: Incomplete - row: Incomplete - rowOff: Incomplete - def __init__(self, col: int = 0, colOff: int = 0, row: int = 0, rowOff: int = 0) -> None: ... + tagname: ClassVar[str] + col: NestedText[int, Literal[False]] + colOff: NestedText[int, Literal[False]] + row: NestedText[int, Literal[False]] + rowOff: NestedText[int, Literal[False]] + def __init__( + self, col: _ConvertibleToInt = 0, colOff: _ConvertibleToInt = 0, row: _ConvertibleToInt = 0, rowOff: _ConvertibleToInt = 0 + ) -> None: ... class _AnchorBase(Serialisable): sp: Typed[Shape, Literal[True]] @@ -50,7 +53,7 @@ class _AnchorBase(Serialisable): ) -> None: ... class AbsoluteAnchor(_AnchorBase): - tagname: str + tagname: ClassVar[str] pos: Typed[XDRPoint2D, Literal[False]] ext: Typed[XDRPositiveSize2D, Literal[False]] sp: Incomplete @@ -64,7 +67,7 @@ class AbsoluteAnchor(_AnchorBase): def __init__(self, pos: XDRPoint2D | None = None, ext: XDRPositiveSize2D | None = None, **kw) -> None: ... class OneCellAnchor(_AnchorBase): - tagname: str + tagname: ClassVar[str] _from: Typed[AnchorMarker, Literal[False]] # Not private. Avoids name clash ext: Typed[XDRPositiveSize2D, Literal[False]] sp: Incomplete @@ -78,7 +81,7 @@ class OneCellAnchor(_AnchorBase): def __init__(self, _from: AnchorMarker | None = None, ext: XDRPositiveSize2D | None = None, **kw) -> None: ... class TwoCellAnchor(_AnchorBase): - tagname: str + tagname: ClassVar[str] editAs: NoneSet[_TwoCellAnchorEditAs] _from: Typed[AnchorMarker, Literal[False]] # Not private. Avoids name clash to: Typed[AnchorMarker, Literal[False]] @@ -99,7 +102,7 @@ class TwoCellAnchor(_AnchorBase): ) -> None: ... class SpreadsheetDrawing(Serialisable): - tagname: str + tagname: ClassVar[str] mime_type: str PartName: str twoCellAnchor: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/text.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/text.pyi index 57eebdc0b2af..c14018576c2b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/text.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/text.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from typing import ClassVar from typing_extensions import Literal, TypeAlias @@ -16,9 +16,10 @@ from openpyxl.descriptors.base import ( _ConvertibleToInt, ) from openpyxl.descriptors.excel import Coordinate, ExtensionList +from openpyxl.descriptors.nested import EmptyTag, NestedBool, NestedInteger, NestedText, NestedValue, _HasTagAndGet from openpyxl.descriptors.serialisable import Serialisable from openpyxl.drawing.effect import Color, EffectContainer, EffectList -from openpyxl.drawing.fill import BlipFillProperties, GradientFillProperties, PatternFillProperties +from openpyxl.drawing.fill import Blip, BlipFillProperties, GradientFillProperties, PatternFillProperties from openpyxl.drawing.geometry import Scene3D from openpyxl.drawing.line import LineProperties @@ -145,8 +146,8 @@ class EmbeddedWAVAudioFile(Serialisable): def __init__(self, name: str | None = None) -> None: ... class Hyperlink(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] invalidUrl: String[Literal[True]] action: String[Literal[True]] tgtFrame: String[Literal[True]] @@ -173,8 +174,8 @@ class Hyperlink(Serialisable): ) -> None: ... class Font(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] typeface: String[Literal[False]] panose: Incomplete pitchFamily: MinMax[float, Literal[True]] @@ -188,8 +189,8 @@ class Font(Serialisable): ) -> None: ... class CharacterProperties(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] kumimoji: Bool[Literal[True]] lang: String[Literal[True]] altLang: String[Literal[True]] @@ -217,20 +218,20 @@ class CharacterProperties(Serialisable): sym: Typed[Font, Literal[True]] hlinkClick: Typed[Hyperlink, Literal[True]] hlinkMouseOver: Typed[Hyperlink, Literal[True]] - rtl: Incomplete + rtl: NestedBool[Literal[True]] extLst: Typed[ExtensionList, Literal[True]] - noFill: Incomplete + noFill: EmptyTag[Literal[False]] solidFill: Incomplete gradFill: Typed[GradientFillProperties, Literal[True]] blipFill: Typed[BlipFillProperties, Literal[True]] pattFill: Typed[PatternFillProperties, Literal[True]] - grpFill: Incomplete + grpFill: EmptyTag[Literal[False]] effectLst: Typed[EffectList, Literal[True]] effectDag: Typed[EffectContainer, Literal[True]] - uLnTx: Incomplete + uLnTx: EmptyTag[Literal[False]] uLn: Typed[LineProperties, Literal[True]] - uFillTx: Incomplete - uFill: Incomplete + uFillTx: EmptyTag[Literal[False]] + uFill: EmptyTag[Literal[False]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, @@ -261,20 +262,20 @@ class CharacterProperties(Serialisable): sym: Font | None = None, hlinkClick: Hyperlink | None = None, hlinkMouseOver: Hyperlink | None = None, - rtl: Incomplete | None = None, + rtl: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, extLst: ExtensionList | None = None, - noFill: Incomplete | None = None, + noFill: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, solidFill: Incomplete | None = None, gradFill: GradientFillProperties | None = None, blipFill: BlipFillProperties | None = None, pattFill: PatternFillProperties | None = None, - grpFill: Incomplete | None = None, + grpFill: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, effectLst: EffectList | None = None, effectDag: EffectContainer | None = None, - uLnTx: Incomplete | None = None, + uLnTx: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, uLn: LineProperties | None = None, - uFillTx: Incomplete | None = None, - uFill: Incomplete | None = None, + uFillTx: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, + uFill: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, ) -> None: ... class TabStop(Serialisable): @@ -287,10 +288,14 @@ class TabStopList(Serialisable): def __init__(self, tab: Incomplete | None = None) -> None: ... class Spacing(Serialisable): - spcPct: Incomplete - spcPts: Incomplete + spcPct: NestedInteger[Literal[True]] + spcPts: NestedInteger[Literal[True]] __elements__: ClassVar[tuple[str, ...]] - def __init__(self, spcPct: Incomplete | None = None, spcPts: Incomplete | None = None) -> None: ... + def __init__( + self, + spcPct: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + spcPts: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + ) -> None: ... class AutonumberBullet(Serialisable): type: Set[_AutonumberBulletType] @@ -298,8 +303,8 @@ class AutonumberBullet(Serialisable): def __init__(self, type: _AutonumberBulletType, startAt: _ConvertibleToInt) -> None: ... class ParagraphProperties(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] marL: Integer[Literal[True]] marR: Integer[Literal[True]] lvl: Integer[Literal[True]] @@ -317,17 +322,17 @@ class ParagraphProperties(Serialisable): tabLst: Typed[TabStopList, Literal[True]] defRPr: Typed[CharacterProperties, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] - buClrTx: Incomplete + buClrTx: EmptyTag[Literal[False]] buClr: Typed[Color, Literal[True]] - buSzTx: Incomplete - buSzPct: Incomplete - buSzPts: Incomplete - buFontTx: Incomplete + buSzTx: EmptyTag[Literal[False]] + buSzPct: NestedInteger[Literal[True]] + buSzPts: NestedInteger[Literal[True]] + buFontTx: EmptyTag[Literal[False]] buFont: Typed[Font, Literal[True]] - buNone: Incomplete - buAutoNum: Incomplete - buChar: Incomplete - buBlip: Incomplete + buNone: EmptyTag[Literal[False]] + buAutoNum: EmptyTag[Literal[False]] + buChar: NestedValue[str, Literal[True]] + buBlip: NestedValue[Blip, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, @@ -348,22 +353,22 @@ class ParagraphProperties(Serialisable): tabLst: TabStopList | None = None, defRPr: CharacterProperties | None = None, extLst: ExtensionList | None = None, - buClrTx: Incomplete | None = None, + buClrTx: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, buClr: Color | None = None, - buSzTx: Incomplete | None = None, - buSzPct: Incomplete | None = None, - buSzPts: Incomplete | None = None, - buFontTx: Incomplete | None = None, + buSzTx: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, + buSzPct: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + buSzPts: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + buFontTx: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, buFont: Font | None = None, - buNone: Incomplete | None = None, - buAutoNum: Incomplete | None = None, - buChar: Incomplete | None = None, - buBlip: Incomplete | None = None, + buNone: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, + buAutoNum: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, + buChar: object = None, + buBlip: object = None, ) -> None: ... class ListStyle(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] defPPr: Typed[ParagraphProperties, Literal[True]] lvl1pPr: Typed[ParagraphProperties, Literal[True]] lvl2pPr: Typed[ParagraphProperties, Literal[True]] @@ -392,18 +397,18 @@ class ListStyle(Serialisable): ) -> None: ... class RegularTextRun(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] rPr: Typed[CharacterProperties, Literal[True]] properties: Alias - t: Incomplete + t: NestedText[str, Literal[False]] value: Alias __elements__: ClassVar[tuple[str, ...]] - def __init__(self, rPr: CharacterProperties | None = None, t: str = "") -> None: ... + def __init__(self, rPr: CharacterProperties | None = None, t: object = "") -> None: ... class LineBreak(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] rPr: Typed[CharacterProperties, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__(self, rPr: CharacterProperties | None = None) -> None: ... @@ -425,8 +430,8 @@ class TextField(Serialisable): ) -> None: ... class Paragraph(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] pPr: Typed[ParagraphProperties, Literal[True]] properties: Alias endParaRPr: Typed[CharacterProperties, Literal[True]] @@ -464,8 +469,8 @@ class TextNormalAutofit(Serialisable): def __init__(self, fontScale: _ConvertibleToInt, lnSpcReduction: _ConvertibleToInt) -> None: ... class RichTextProperties(Serialisable): - tagname: str - namespace: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] rot: Integer[Literal[True]] spcFirstLastPara: Bool[Literal[True]] vertOverflow: NoneSet[_RichTextPropertiesVertOverflow] @@ -488,10 +493,10 @@ class RichTextProperties(Serialisable): prstTxWarp: Typed[PresetTextShape, Literal[True]] scene3d: Typed[Scene3D, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] - noAutofit: Incomplete - normAutofit: Incomplete - spAutoFit: Incomplete - flatTx: Incomplete + noAutofit: EmptyTag[Literal[False]] + normAutofit: EmptyTag[Literal[False]] + spAutoFit: EmptyTag[Literal[False]] + flatTx: NestedInteger[Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, @@ -514,11 +519,11 @@ class RichTextProperties(Serialisable): forceAA: _ConvertibleToBool | None = None, upright: _ConvertibleToBool | None = None, compatLnSpc: _ConvertibleToBool | None = None, - prstTxWarp: Incomplete | None = None, - scene3d: Incomplete | None = None, - extLst: Incomplete | None = None, - noAutofit: Incomplete | None = None, - normAutofit: Incomplete | None = None, - spAutoFit: Incomplete | None = None, - flatTx: Incomplete | None = None, + prstTxWarp: PresetTextShape | None = None, + scene3d: Scene3D | None = None, + extLst: Unused = None, + noAutofit: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, + normAutofit: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, + spAutoFit: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, + flatTx: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/xdr.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/xdr.pyi index c77a2b7e1ff1..fb67f3eda7c8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/xdr.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/drawing/xdr.pyi @@ -1,19 +1,20 @@ from _typeshed import Incomplete +from typing import ClassVar from .geometry import Point2D, PositiveSize2D, Transform2D class XDRPoint2D(Point2D): - namespace: Incomplete + namespace: ClassVar[None] # type:ignore[assignment] x: Incomplete y: Incomplete class XDRPositiveSize2D(PositiveSize2D): - namespace: Incomplete + namespace: ClassVar[None] # type:ignore[assignment] cx: Incomplete cy: Incomplete class XDRTransform2D(Transform2D): - namespace: Incomplete + namespace: ClassVar[None] # type:ignore[assignment] rot: Incomplete flipH: Incomplete flipV: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/formatting.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/formatting.pyi index 80d0ef8379f7..a828d3c08e77 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/formatting.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/formatting.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete, Unused +from typing import ClassVar from typing_extensions import Literal from openpyxl.descriptors.base import Alias, Bool, Convertible, _ConvertibleToBool, _ConvertibleToMultiCellRange @@ -6,7 +7,7 @@ from openpyxl.descriptors.serialisable import Serialisable from openpyxl.worksheet.cell_range import MultiCellRange class ConditionalFormatting(Serialisable): - tagname: str + tagname: ClassVar[str] sqref: Convertible[MultiCellRange, Literal[False]] cells: Alias pivot: Bool[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/rule.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/rule.pyi index ccb97c501ed6..b9e99931d5e3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/rule.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formatting/rule.pyi @@ -71,7 +71,7 @@ class ValueDescriptor(Float[Incomplete]): def __set__(self, instance: Serialisable | Strict, value) -> None: ... # type: ignore[override] class FormatObject(Serialisable): - tagname: str + tagname: ClassVar[str] type: Set[_FormatObjectType] val: Incomplete gte: Bool[Literal[True]] @@ -85,7 +85,7 @@ class RuleType(Serialisable): cfvo: Incomplete class IconSet(RuleType): - tagname: str + tagname: ClassVar[str] iconSet: NoneSet[_IconSetIconSet] showValue: Bool[Literal[True]] percent: Bool[Literal[True]] @@ -102,7 +102,7 @@ class IconSet(RuleType): ) -> None: ... class DataBar(RuleType): - tagname: str + tagname: ClassVar[str] minLength: Integer[Literal[True]] maxLength: Integer[Literal[True]] showValue: Bool[Literal[True]] @@ -119,14 +119,14 @@ class DataBar(RuleType): ) -> None: ... class ColorScale(RuleType): - tagname: str + tagname: ClassVar[str] color: Incomplete __elements__: ClassVar[tuple[str, ...]] cfvo: Incomplete def __init__(self, cfvo: Incomplete | None = None, color: Incomplete | None = None) -> None: ... class Rule(Serialisable): - tagname: str + tagname: ClassVar[str] type: Set[_RuleType] dxfId: Integer[Literal[True]] priority: Integer[Literal[False]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/tokenizer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/tokenizer.pyi index 4f2561741b1e..6b7d97431fd7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/tokenizer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/tokenizer.pyi @@ -1,13 +1,15 @@ from _typeshed import Incomplete +from re import Pattern +from typing_extensions import Final class TokenizerError(Exception): ... class Tokenizer: - SN_RE: Incomplete - WSPACE_RE: Incomplete - STRING_REGEXES: Incomplete - ERROR_CODES: Incomplete - TOKEN_ENDERS: str + SN_RE: Final[Pattern[str]] + WSPACE_RE: Final[Pattern[str]] + STRING_REGEXES: Final[dict[str, Pattern[str]]] + ERROR_CODES: Final[tuple[str, ...]] + TOKEN_ENDERS: Final = ",;}) +-*/^&=><%" formula: Incomplete items: Incomplete token_stack: Incomplete @@ -20,33 +22,33 @@ class Tokenizer: def render(self): ... class Token: - LITERAL: str - OPERAND: str - FUNC: str - ARRAY: str - PAREN: str - SEP: str - OP_PRE: str - OP_IN: str - OP_POST: str - WSPACE: str + LITERAL: Final = "LITERAL" + OPERAND: Final = "OPERAND" + FUNC: Final = "FUNC" + ARRAY: Final = "ARRAY" + PAREN: Final = "PAREN" + SEP: Final = "SEP" + OP_PRE: Final = "OPERATOR-PREFIX" + OP_IN: Final = "OPERATOR-INFIX" + OP_POST: Final = "OPERATOR-POSTFIX" + WSPACE: Final = "WHITE-SPACE" value: Incomplete type: Incomplete subtype: Incomplete def __init__(self, value, type_, subtype: str = "") -> None: ... - TEXT: str - NUMBER: str - LOGICAL: str - ERROR: str - RANGE: str + TEXT: Final = "TEXT" + NUMBER: Final = "NUMBER" + LOGICAL: Final = "LOGICAL" + ERROR: Final = "ERROR" + RANGE: Final = "RANGE" @classmethod def make_operand(cls, value): ... - OPEN: str - CLOSE: str + OPEN: Final = "OPEN" + CLOSE: Final = "CLOSE" @classmethod def make_subexp(cls, value, func: bool = False): ... def get_closer(self): ... - ARG: str - ROW: str + ARG: Final = "ARG" + ROW: Final = "ROW" @classmethod def make_separator(cls, value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/translate.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/translate.pyi index 61c6187305d0..edbec1d541f8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/translate.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/formula/translate.pyi @@ -1,4 +1,6 @@ from _typeshed import Incomplete +from re import Pattern +from typing_extensions import Final class TranslatorError(Exception): ... @@ -6,9 +8,9 @@ class Translator: tokenizer: Incomplete def __init__(self, formula, origin) -> None: ... def get_tokens(self): ... - ROW_RANGE_RE: Incomplete - COL_RANGE_RE: Incomplete - CELL_REF_RE: Incomplete + ROW_RANGE_RE: Final[Pattern[str]] + COL_RANGE_RE: Final[Pattern[str]] + CELL_REF_RE: Final[Pattern[str]] @staticmethod def translate_row(row_str, rdelta): ... @staticmethod diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/core.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/core.pyi index 96e68ca37e0f..29f0191b40a2 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/core.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/core.pyi @@ -1,5 +1,6 @@ from _typeshed import Incomplete from typing import ClassVar +from typing_extensions import Literal from openpyxl.descriptors import DateTime from openpyxl.descriptors.base import Alias @@ -7,52 +8,48 @@ from openpyxl.descriptors.nested import NestedText from openpyxl.descriptors.serialisable import Serialisable # Does not reimplement the relevant methods, so runtime also has incompatible supertypes -class NestedDateTime(DateTime[Incomplete], NestedText): # type: ignore[misc] +class NestedDateTime(DateTime[Incomplete], NestedText[Incomplete, Incomplete]): # type: ignore[misc] expected_type: type[Incomplete] - def to_tree( - self, tagname: Incomplete | None = None, value: Incomplete | None = None, namespace: Incomplete | None = None - ): ... + def to_tree(self, tagname: str | None = None, value: Incomplete | None = None, namespace: str | None = None): ... class QualifiedDateTime(NestedDateTime): - def to_tree( - self, tagname: Incomplete | None = None, value: Incomplete | None = None, namespace: Incomplete | None = None - ): ... + def to_tree(self, tagname: str | None = None, value: Incomplete | None = None, namespace: str | None = None): ... class DocumentProperties(Serialisable): - tagname: str - namespace: Incomplete - category: Incomplete - contentStatus: Incomplete - keywords: Incomplete - lastModifiedBy: Incomplete + tagname: ClassVar[str] + namespace: ClassVar[str] + category: NestedText[str, Literal[True]] + contentStatus: NestedText[str, Literal[True]] + keywords: NestedText[str, Literal[True]] + lastModifiedBy: NestedText[str, Literal[True]] lastPrinted: Incomplete - revision: Incomplete - version: Incomplete + revision: NestedText[str, Literal[True]] + version: NestedText[str, Literal[True]] last_modified_by: Alias - subject: Incomplete - title: Incomplete - creator: Incomplete - description: Incomplete - identifier: Incomplete - language: Incomplete + subject: NestedText[str, Literal[True]] + title: NestedText[str, Literal[True]] + creator: NestedText[str, Literal[True]] + description: NestedText[str, Literal[True]] + identifier: NestedText[str, Literal[True]] + language: NestedText[str, Literal[True]] created: Incomplete modified: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__( self, - category: Incomplete | None = None, - contentStatus: Incomplete | None = None, - keywords: Incomplete | None = None, - lastModifiedBy: Incomplete | None = None, + category: object = None, + contentStatus: object = None, + keywords: object = None, + lastModifiedBy: object = None, lastPrinted: Incomplete | None = None, - revision: Incomplete | None = None, - version: Incomplete | None = None, + revision: object = None, + version: object = None, created=None, - creator: str = "openpyxl", - description: Incomplete | None = None, - identifier: Incomplete | None = None, - language: Incomplete | None = None, + creator: object = "openpyxl", + description: object = None, + identifier: object = None, + language: object = None, modified=None, - subject: Incomplete | None = None, - title: Incomplete | None = None, + subject: object = None, + title: object = None, ) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/custom.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/custom.pyi index 188498ea0c30..9aadb179cd35 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/custom.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/custom.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete from collections.abc import Iterator from datetime import datetime from typing import Any, Generic, TypeVar -from typing_extensions import Literal, Self +from typing_extensions import Final, Literal, Self, TypeAlias from openpyxl.descriptors import Sequence, Strict from openpyxl.descriptors.base import ( @@ -20,7 +20,7 @@ from openpyxl.descriptors.nested import NestedText _T = TypeVar("_T") # Does not reimplement anything, so runtime also has incompatible supertypes -class NestedBoolText(Bool[Incomplete], NestedText): ... # type: ignore[misc] +class NestedBoolText(Bool[Incomplete], NestedText[Incomplete, Incomplete]): ... # type: ignore[misc] class _TypedProperty(Strict, Generic[_T]): name: String[Literal[False]] @@ -49,8 +49,9 @@ class BoolProperty(_TypedProperty[_ConvertibleToBool]): class LinkProperty(_TypedProperty[str]): value: String[Literal[False]] -CLASS_MAPPING: Incomplete -XML_MAPPING: Incomplete +_MappingPropertyType: TypeAlias = StringProperty | IntProperty | FloatProperty | DateTimeProperty | BoolProperty | LinkProperty +CLASS_MAPPING: Final[dict[type[_MappingPropertyType], str]] +XML_MAPPING: Final[dict[str, type[_MappingPropertyType]]] class CustomPropertyList(Strict): props: Sequence diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi index c50f9fe3f177..698fe016406d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/extended.pyi @@ -1,8 +1,9 @@ -from _typeshed import Incomplete, Unused +from _typeshed import Unused from typing import ClassVar from typing_extensions import Literal -from openpyxl.descriptors.base import Typed +from openpyxl.descriptors.base import Typed, _ConvertibleToInt +from openpyxl.descriptors.nested import NestedText from openpyxl.descriptors.serialisable import Serialisable def get_version(): ... @@ -20,63 +21,63 @@ class VectorVariant(Serialisable): __attrs__: ClassVar[tuple[str, ...]] class ExtendedProperties(Serialisable): - tagname: str - Template: Incomplete - Manager: Incomplete - Company: Incomplete - Pages: Incomplete - Words: Incomplete - Characters: Incomplete - PresentationFormat: Incomplete - Lines: Incomplete - Paragraphs: Incomplete - Slides: Incomplete - Notes: Incomplete - TotalTime: Incomplete - HiddenSlides: Incomplete - MMClips: Incomplete - ScaleCrop: Incomplete + tagname: ClassVar[str] + Template: NestedText[str, Literal[True]] + Manager: NestedText[str, Literal[True]] + Company: NestedText[str, Literal[True]] + Pages: NestedText[int, Literal[True]] + Words: NestedText[int, Literal[True]] + Characters: NestedText[int, Literal[True]] + PresentationFormat: NestedText[str, Literal[True]] + Lines: NestedText[int, Literal[True]] + Paragraphs: NestedText[int, Literal[True]] + Slides: NestedText[int, Literal[True]] + Notes: NestedText[int, Literal[True]] + TotalTime: NestedText[int, Literal[True]] + HiddenSlides: NestedText[int, Literal[True]] + MMClips: NestedText[int, Literal[True]] + ScaleCrop: NestedText[str, Literal[True]] HeadingPairs: Typed[VectorVariant, Literal[True]] TitlesOfParts: Typed[VectorLpstr, Literal[True]] - LinksUpToDate: Incomplete - CharactersWithSpaces: Incomplete - SharedDoc: Incomplete - HyperlinkBase: Incomplete + LinksUpToDate: NestedText[str, Literal[True]] + CharactersWithSpaces: NestedText[int, Literal[True]] + SharedDoc: NestedText[str, Literal[True]] + HyperlinkBase: NestedText[str, Literal[True]] HLinks: Typed[VectorVariant, Literal[True]] - HyperlinksChanged: Incomplete + HyperlinksChanged: NestedText[str, Literal[True]] DigSig: Typed[DigSigBlob, Literal[True]] - Application: Incomplete - AppVersion: Incomplete - DocSecurity: Incomplete + Application: NestedText[str, Literal[True]] + AppVersion: NestedText[str, Literal[True]] + DocSecurity: NestedText[int, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - Template: Incomplete | None = None, - Manager: Incomplete | None = None, - Company: Incomplete | None = None, - Pages: Incomplete | None = None, - Words: Incomplete | None = None, - Characters: Incomplete | None = None, - PresentationFormat: Incomplete | None = None, - Lines: Incomplete | None = None, - Paragraphs: Incomplete | None = None, - Slides: Incomplete | None = None, - Notes: Incomplete | None = None, - TotalTime: Incomplete | None = None, - HiddenSlides: Incomplete | None = None, - MMClips: Incomplete | None = None, - ScaleCrop: Incomplete | None = None, + Template: object = None, + Manager: object = None, + Company: object = None, + Pages: _ConvertibleToInt | None = None, + Words: _ConvertibleToInt | None = None, + Characters: _ConvertibleToInt | None = None, + PresentationFormat: object = None, + Lines: _ConvertibleToInt | None = None, + Paragraphs: _ConvertibleToInt | None = None, + Slides: _ConvertibleToInt | None = None, + Notes: _ConvertibleToInt | None = None, + TotalTime: _ConvertibleToInt | None = None, + HiddenSlides: _ConvertibleToInt | None = None, + MMClips: _ConvertibleToInt | None = None, + ScaleCrop: object = None, HeadingPairs: Unused = None, TitlesOfParts: Unused = None, - LinksUpToDate: Incomplete | None = None, - CharactersWithSpaces: Incomplete | None = None, - SharedDoc: Incomplete | None = None, - HyperlinkBase: Incomplete | None = None, + LinksUpToDate: object = None, + CharactersWithSpaces: _ConvertibleToInt | None = None, + SharedDoc: object = None, + HyperlinkBase: object = None, HLinks: Unused = None, - HyperlinksChanged: Incomplete | None = None, + HyperlinksChanged: object = None, DigSig: Unused = None, - Application: str = "Microsoft Excel", - AppVersion: Incomplete | None = None, - DocSecurity: Incomplete | None = None, + Application: object = "Microsoft Excel", + AppVersion: object = None, + DocSecurity: _ConvertibleToInt | None = None, ) -> None: ... def to_tree(self): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/manifest.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/manifest.pyi index bcc569d4ed60..e0b8b8430ec7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/manifest.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/manifest.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from collections.abc import Generator from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Final, Literal from openpyxl.descriptors.base import String from openpyxl.descriptors.serialisable import Serialisable @@ -9,22 +9,22 @@ from openpyxl.descriptors.serialisable import Serialisable mimetypes: Incomplete class FileExtension(Serialisable): - tagname: str + tagname: ClassVar[str] Extension: String[Literal[False]] ContentType: String[Literal[False]] def __init__(self, Extension: str, ContentType: str) -> None: ... class Override(Serialisable): - tagname: str + tagname: ClassVar[str] PartName: String[Literal[False]] ContentType: String[Literal[False]] def __init__(self, PartName: str, ContentType: str) -> None: ... -DEFAULT_TYPES: Incomplete -DEFAULT_OVERRIDE: Incomplete +DEFAULT_TYPES: Final[list[FileExtension]] +DEFAULT_OVERRIDE: Final[list[Override]] class Manifest(Serialisable): - tagname: str + tagname: ClassVar[str] Default: Incomplete Override: Incomplete path: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi index 04cb557b1556..09165e7bb179 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/relationship.pyi @@ -1,13 +1,13 @@ from _typeshed import Incomplete, Unused from collections.abc import Generator -from typing import overload +from typing import ClassVar, overload from typing_extensions import Literal from openpyxl.descriptors.base import Alias, String from openpyxl.descriptors.serialisable import Serialisable class Relationship(Serialisable): - tagname: str + tagname: ClassVar[str] Type: String[Literal[False]] Target: String[Literal[False]] target: Alias @@ -26,7 +26,7 @@ class Relationship(Serialisable): ) -> None: ... class RelationshipList(Serialisable): - tagname: str + tagname: ClassVar[str] Relationship: Incomplete def __init__(self, Relationship=()) -> None: ... def append(self, value) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/workbook.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/workbook.pyi index 4875deb6b118..303fa16accd1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/workbook.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/packaging/workbook.pyi @@ -4,6 +4,7 @@ from typing_extensions import Literal, TypeAlias from openpyxl.descriptors.base import Alias, Bool, Integer, NoneSet, String, Typed, _ConvertibleToBool, _ConvertibleToInt from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedString from openpyxl.descriptors.serialisable import Serialisable from openpyxl.workbook.defined_name import DefinedNameList from openpyxl.workbook.function_group import FunctionGroupList @@ -16,7 +17,7 @@ _ChildSheetState: TypeAlias = Literal["visible", "hidden", "veryHidden"] _WorkbookPackageConformance: TypeAlias = Literal["strict", "transitional"] class FileRecoveryProperties(Serialisable): - tagname: str + tagname: ClassVar[str] autoRecover: Bool[Literal[True]] crashSave: Bool[Literal[True]] dataExtractLoad: Bool[Literal[True]] @@ -30,7 +31,7 @@ class FileRecoveryProperties(Serialisable): ) -> None: ... class ChildSheet(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[False]] sheetId: Integer[Literal[False]] state: NoneSet[_ChildSheetState] @@ -44,13 +45,13 @@ class ChildSheet(Serialisable): ) -> None: ... class PivotCache(Serialisable): - tagname: str + tagname: ClassVar[str] cacheId: Integer[Literal[False]] id: Incomplete def __init__(self, cacheId: _ConvertibleToInt, id: Incomplete | None = None) -> None: ... class WorkbookPackage(Serialisable): - tagname: str + tagname: ClassVar[str] conformance: NoneSet[_WorkbookPackageConformance] fileVersion: Typed[FileVersion, Literal[True]] fileSharing: Typed[FileSharing, Literal[True]] @@ -63,7 +64,7 @@ class WorkbookPackage(Serialisable): externalReferences: Incomplete definedNames: Typed[DefinedNameList, Literal[True]] calcPr: Typed[CalcProperties, Literal[True]] - oleSize: Incomplete + oleSize: NestedString[Literal[True]] customWorkbookViews: Incomplete pivotCaches: Incomplete smartTagPr: Typed[SmartTagProperties, Literal[True]] @@ -72,7 +73,7 @@ class WorkbookPackage(Serialisable): fileRecoveryPr: Typed[FileRecoveryProperties, Literal[True]] webPublishObjects: Typed[WebPublishObjectList, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] - Ignorable: Incomplete + Ignorable: NestedString[Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( self, @@ -87,7 +88,7 @@ class WorkbookPackage(Serialisable): externalReferences=(), definedNames: DefinedNameList | None = None, calcPr: CalcProperties | None = None, - oleSize: Incomplete | None = None, + oleSize: object = None, customWorkbookViews=(), pivotCaches=(), smartTagPr: SmartTagProperties | None = None, diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/cache.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/cache.pyi index 2a456dc95774..635b93a5bd1e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/cache.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/cache.pyi @@ -16,6 +16,7 @@ from openpyxl.descriptors.base import ( _ConvertibleToInt, ) from openpyxl.descriptors.excel import ExtensionList +from openpyxl.descriptors.nested import NestedInteger, _HasTagAndGet from openpyxl.descriptors.serialisable import Serialisable from openpyxl.pivot.fields import Error, Missing, Number, Text, TupleList from openpyxl.pivot.table import PivotArea @@ -24,19 +25,19 @@ _RangePrGroupBy: TypeAlias = Literal["range", "seconds", "minutes", "hours", "da _CacheSourceType: TypeAlias = Literal["worksheet", "external", "consolidation", "scenario"] class MeasureDimensionMap(Serialisable): - tagname: str + tagname: ClassVar[str] measureGroup: Integer[Literal[True]] dimension: Integer[Literal[True]] def __init__(self, measureGroup: _ConvertibleToInt | None = None, dimension: _ConvertibleToInt | None = None) -> None: ... class MeasureGroup(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[False]] caption: String[Literal[False]] def __init__(self, name: str, caption: str) -> None: ... class PivotDimension(Serialisable): - tagname: str + tagname: ClassVar[str] measure: Bool[Literal[False]] name: String[Literal[False]] uniqueName: String[Literal[False]] @@ -47,7 +48,7 @@ class PivotDimension(Serialisable): def __init__(self, measure: _ConvertibleToBool, name: str, uniqueName: str, caption: str) -> None: ... class CalculatedMember(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[False]] mdx: String[Literal[False]] memberName: String[Literal[False]] @@ -70,7 +71,7 @@ class CalculatedMember(Serialisable): ) -> None: ... class CalculatedItem(Serialisable): - tagname: str + tagname: ClassVar[str] field: Integer[Literal[True]] formula: String[Literal[False]] pivotArea: Typed[PivotArea, Literal[False]] @@ -86,13 +87,13 @@ class CalculatedItem(Serialisable): ) -> None: ... class ServerFormat(Serialisable): - tagname: str + tagname: ClassVar[str] culture: String[Literal[True]] format: String[Literal[True]] def __init__(self, culture: str | None = None, format: str | None = None) -> None: ... class ServerFormatList(Serialisable): - tagname: str + tagname: ClassVar[str] serverFormat: Incomplete __elements__: ClassVar[tuple[str, ...]] __attrs__: ClassVar[tuple[str, ...]] @@ -101,21 +102,21 @@ class ServerFormatList(Serialisable): def count(self): ... class Query(Serialisable): - tagname: str + tagname: ClassVar[str] mdx: String[Literal[False]] tpls: Typed[TupleList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__(self, mdx: str, tpls: TupleList | None = None) -> None: ... class QueryCache(Serialisable): - tagname: str + tagname: ClassVar[str] count: Integer[Literal[False]] query: Typed[Query, Literal[False]] __elements__: ClassVar[tuple[str, ...]] def __init__(self, count: _ConvertibleToInt, query: Query) -> None: ... class OLAPSet(Serialisable): - tagname: str + tagname: ClassVar[str] count: Integer[Literal[False]] maxRank: Integer[Literal[False]] setDefinition: String[Literal[False]] @@ -142,7 +143,7 @@ class OLAPSets(Serialisable): def __init__(self, count: _ConvertibleToInt, set: OLAPSet) -> None: ... class PCDSDTCEntries(Serialisable): - tagname: str + tagname: ClassVar[str] count: Integer[Literal[False]] m: Typed[Missing, Literal[False]] n: Typed[Number, Literal[False]] @@ -152,7 +153,7 @@ class PCDSDTCEntries(Serialisable): def __init__(self, count: _ConvertibleToInt, m: Missing, n: Number, e: Error, s: Text) -> None: ... class TupleCache(Serialisable): - tagname: str + tagname: ClassVar[str] entries: Typed[PCDSDTCEntries, Literal[True]] sets: Typed[OLAPSets, Literal[True]] queryCache: Typed[QueryCache, Literal[True]] @@ -169,7 +170,7 @@ class TupleCache(Serialisable): ) -> None: ... class PCDKPI(Serialisable): - tagname: str + tagname: ClassVar[str] uniqueName: String[Literal[False]] caption: String[Literal[True]] displayFolder: String[Literal[False]] @@ -214,7 +215,7 @@ class PCDKPI(Serialisable): ) -> None: ... class GroupMember(Serialisable): - tagname: str + tagname: ClassVar[str] uniqueName: String[Literal[False]] group: Bool[Literal[False]] def __init__(self, uniqueName: str, group: _ConvertibleToBool = None) -> None: ... @@ -226,7 +227,7 @@ class GroupMembers(Serialisable): def __init__(self, count: _ConvertibleToInt, groupMember: GroupMember) -> None: ... class LevelGroup(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[False]] uniqueName: String[Literal[False]] caption: String[Literal[False]] @@ -239,14 +240,14 @@ class LevelGroup(Serialisable): ) -> None: ... class Groups(Serialisable): - tagname: str + tagname: ClassVar[str] count: Integer[Literal[False]] group: Typed[LevelGroup, Literal[False]] __elements__: ClassVar[tuple[str, ...]] def __init__(self, count: _ConvertibleToInt, group: LevelGroup) -> None: ... class GroupLevel(Serialisable): - tagname: str + tagname: ClassVar[str] uniqueName: String[Literal[False]] caption: String[Literal[False]] user: Bool[Literal[False]] @@ -271,7 +272,7 @@ class GroupLevels(Serialisable): def __init__(self, count: _ConvertibleToInt, groupLevel: GroupLevel) -> None: ... class FieldUsage(Serialisable): - tagname: str + tagname: ClassVar[str] x: Integer[Literal[False]] def __init__(self, x: _ConvertibleToInt) -> None: ... @@ -282,7 +283,7 @@ class FieldsUsage(Serialisable): def __init__(self, count: _ConvertibleToInt, fieldUsage: FieldUsage | None = None) -> None: ... class CacheHierarchy(Serialisable): - tagname: str + tagname: ClassVar[str] uniqueName: String[Literal[False]] caption: String[Literal[True]] measure: Bool[Literal[False]] @@ -370,7 +371,7 @@ class CacheHierarchy(Serialisable): ) -> None: ... class GroupItems(Serialisable): - tagname: str + tagname: ClassVar[str] m: Incomplete n: Incomplete b: Incomplete @@ -384,14 +385,16 @@ class GroupItems(Serialisable): def count(self): ... class DiscretePr(Serialisable): - tagname: str + tagname: ClassVar[str] count: Integer[Literal[False]] - x: Incomplete + x: NestedInteger[Literal[True]] __elements__: ClassVar[tuple[str, ...]] - def __init__(self, count: _ConvertibleToInt, x: Incomplete | None = None) -> None: ... + def __init__( + self, count: _ConvertibleToInt, x: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None + ) -> None: ... class RangePr(Serialisable): - tagname: str + tagname: ClassVar[str] autoStart: Bool[Literal[True]] autoEnd: Bool[Literal[True]] groupBy: Set[_RangePrGroupBy] @@ -413,7 +416,7 @@ class RangePr(Serialisable): ) -> None: ... class FieldGroup(Serialisable): - tagname: str + tagname: ClassVar[str] par: Integer[Literal[True]] base: Integer[Literal[True]] rangePr: Typed[RangePr, Literal[True]] @@ -430,7 +433,7 @@ class FieldGroup(Serialisable): ) -> None: ... class SharedItems(Serialisable): - tagname: str + tagname: ClassVar[str] m: Incomplete n: Incomplete b: Incomplete @@ -473,10 +476,10 @@ class SharedItems(Serialisable): def count(self): ... class CacheField(Serialisable): - tagname: str + tagname: ClassVar[str] sharedItems: Typed[SharedItems, Literal[True]] fieldGroup: Typed[FieldGroup, Literal[True]] - mpMap: Incomplete + mpMap: NestedInteger[Literal[True]] extLst: Typed[ExtensionList, Literal[True]] name: String[Literal[False]] caption: String[Literal[True]] @@ -497,7 +500,7 @@ class CacheField(Serialisable): self, sharedItems: SharedItems | None = None, fieldGroup: FieldGroup | None = None, - mpMap: Incomplete | None = None, + mpMap: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, extLst: ExtensionList | None = None, *, name: str, @@ -537,7 +540,7 @@ class CacheField(Serialisable): ) -> None: ... class RangeSet(Serialisable): - tagname: str + tagname: ClassVar[str] i1: Integer[Literal[True]] i2: Integer[Literal[True]] i3: Integer[Literal[True]] @@ -570,12 +573,12 @@ class RangeSet(Serialisable): ) -> None: ... class PageItem(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[False]] def __init__(self, name: str) -> None: ... class Page(Serialisable): - tagname: str + tagname: ClassVar[str] pageItem: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, count: Incomplete | None = None, pageItem: Incomplete | None = None) -> None: ... @@ -583,7 +586,7 @@ class Page(Serialisable): def count(self): ... class Consolidation(Serialisable): - tagname: str + tagname: ClassVar[str] autoPage: Bool[Literal[True]] pages: Incomplete rangeSets: Incomplete @@ -591,14 +594,14 @@ class Consolidation(Serialisable): def __init__(self, autoPage: _ConvertibleToBool | None = None, pages=(), rangeSets=()) -> None: ... class WorksheetSource(Serialisable): - tagname: str + tagname: ClassVar[str] ref: String[Literal[True]] name: String[Literal[True]] sheet: String[Literal[True]] def __init__(self, ref: str | None = None, name: str | None = None, sheet: str | None = None) -> None: ... class CacheSource(Serialisable): - tagname: str + tagname: ClassVar[str] type: Set[_CacheSourceType] connectionId: Integer[Literal[True]] worksheetSource: Typed[WorksheetSource, Literal[True]] @@ -618,7 +621,7 @@ class CacheDefinition(Serialisable): mime_type: str rel_type: str records: Incomplete - tagname: str + tagname: ClassVar[str] invalid: Bool[Literal[True]] saveData: Bool[Literal[True]] refreshOnLoad: Bool[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/fields.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/fields.pyi index 536929917acf..661b671a43d9 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/fields.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/fields.pyi @@ -17,7 +17,7 @@ from openpyxl.descriptors.base import ( from openpyxl.descriptors.serialisable import Serialisable class Index(Serialisable): - tagname: str + tagname: ClassVar[str] v: Integer[Literal[True]] def __init__(self, v: _ConvertibleToInt | None = 0) -> None: ... @@ -37,7 +37,7 @@ class TupleList(Serialisable): def __init__(self, c: _ConvertibleToInt | None, tpl: Tuple) -> None: ... class Missing(Serialisable): - tagname: str + tagname: ClassVar[str] tpls: Incomplete x: Incomplete u: Bool[Literal[True]] @@ -70,7 +70,7 @@ class Missing(Serialisable): ) -> None: ... class Number(Serialisable): - tagname: str + tagname: ClassVar[str] tpls: Incomplete x: Incomplete v: Float[Literal[False]] @@ -125,7 +125,7 @@ class Number(Serialisable): ) -> None: ... class Error(Serialisable): - tagname: str + tagname: ClassVar[str] tpls: Typed[TupleList, Literal[True]] x: Incomplete v: String[Literal[False]] @@ -180,7 +180,7 @@ class Error(Serialisable): ) -> None: ... class Boolean(Serialisable): - tagname: str + tagname: ClassVar[str] x: Incomplete v: Bool[Literal[False]] u: Bool[Literal[True]] @@ -199,7 +199,7 @@ class Boolean(Serialisable): ) -> None: ... class Text(Serialisable): - tagname: str + tagname: ClassVar[str] tpls: Incomplete x: Incomplete v: String[Literal[False]] @@ -234,7 +234,7 @@ class Text(Serialisable): ) -> None: ... class DateTimeField(Serialisable): - tagname: str + tagname: ClassVar[str] x: Incomplete v: DateTime[Literal[False]] u: Bool[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/record.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/record.pyi index cc3cb4979f44..7e90dac95258 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/record.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/record.pyi @@ -7,7 +7,7 @@ from openpyxl.descriptors.excel import ExtensionList from openpyxl.descriptors.serialisable import Serialisable class Record(Serialisable): - tagname: str + tagname: ClassVar[str] m: Incomplete n: Incomplete b: Incomplete @@ -30,7 +30,7 @@ class Record(Serialisable): class RecordList(Serialisable): mime_type: str rel_type: str - tagname: str + tagname: ClassVar[str] r: Incomplete extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/table.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/table.pyi index d3d10f626605..59af9e6eb3a3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/table.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/pivot/table.pyi @@ -106,12 +106,12 @@ _ItemType: TypeAlias = Literal[ _PivotFieldSortType: TypeAlias = Literal["manual", "ascending", "descending"] class HierarchyUsage(Serialisable): - tagname: str + tagname: ClassVar[str] hierarchyUsage: Integer[Literal[False]] def __init__(self, hierarchyUsage: _ConvertibleToInt) -> None: ... class ColHierarchiesUsage(Serialisable): - tagname: str + tagname: ClassVar[str] colHierarchyUsage: Incomplete __elements__: ClassVar[tuple[str, ...]] __attrs__: ClassVar[tuple[str, ...]] @@ -120,7 +120,7 @@ class ColHierarchiesUsage(Serialisable): def count(self): ... class RowHierarchiesUsage(Serialisable): - tagname: str + tagname: ClassVar[str] rowHierarchyUsage: Incomplete __elements__: ClassVar[tuple[str, ...]] __attrs__: ClassVar[tuple[str, ...]] @@ -129,7 +129,7 @@ class RowHierarchiesUsage(Serialisable): def count(self): ... class PivotFilter(Serialisable): - tagname: str + tagname: ClassVar[str] fld: Integer[Literal[False]] mpFld: Integer[Literal[True]] type: Set[_PivotFilterType] @@ -187,7 +187,7 @@ class PivotFilters(Serialisable): def __init__(self, count: _ConvertibleToInt, filter: PivotFilter | None = None) -> None: ... class PivotTableStyle(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[True]] showRowHeaders: Bool[Literal[False]] showColHeaders: Bool[Literal[False]] @@ -205,7 +205,7 @@ class PivotTableStyle(Serialisable): ) -> None: ... class MemberList(Serialisable): - tagname: str + tagname: ClassVar[str] level: Integer[Literal[True]] member: Incomplete __elements__: ClassVar[tuple[str, ...]] @@ -214,7 +214,7 @@ class MemberList(Serialisable): def count(self): ... class MemberProperty(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[True]] showCell: Bool[Literal[True]] showTip: Bool[Literal[True]] @@ -253,7 +253,7 @@ class MemberProperty(Serialisable): ) -> None: ... class PivotHierarchy(Serialisable): - tagname: str + tagname: ClassVar[str] outline: Bool[Literal[False]] multipleItemSelectionAllowed: Bool[Literal[False]] subtotalTop: Bool[Literal[False]] @@ -288,7 +288,7 @@ class PivotHierarchy(Serialisable): ) -> None: ... class Reference(Serialisable): - tagname: str + tagname: ClassVar[str] field: Integer[Literal[True]] selected: Bool[Literal[True]] byPosition: Bool[Literal[True]] @@ -334,7 +334,7 @@ class Reference(Serialisable): def count(self): ... class PivotArea(Serialisable): - tagname: str + tagname: ClassVar[str] references: Incomplete extLst: Typed[ExtensionList, Literal[True]] field: Integer[Literal[True]] @@ -369,7 +369,7 @@ class PivotArea(Serialisable): ) -> None: ... class ChartFormat(Serialisable): - tagname: str + tagname: ClassVar[str] chart: Integer[Literal[False]] format: Integer[Literal[False]] series: Bool[Literal[False]] @@ -385,7 +385,7 @@ class ChartFormat(Serialisable): ) -> None: ... class ConditionalFormat(Serialisable): - tagname: str + tagname: ClassVar[str] scope: Set[_ConditionalFormatScope] type: NoneSet[_ConditionalFormatType] priority: Integer[Literal[False]] @@ -413,17 +413,17 @@ class ConditionalFormat(Serialisable): ) -> None: ... class ConditionalFormatList(Serialisable): - tagname: str + tagname: ClassVar[str] conditionalFormat: Incomplete __attrs__: ClassVar[tuple[str, ...]] def __init__(self, conditionalFormat=..., count: Incomplete | None = ...) -> None: ... def by_priority(self): ... @property def count(self): ... - def to_tree(self, tagname: Incomplete | None = ...): ... # type: ignore[override] + def to_tree(self, tagname: str | None = None): ... # type: ignore[override] class Format(Serialisable): - tagname: str + tagname: ClassVar[str] action: NoneSet[_FormatAction] dxfId: Integer[Literal[True]] pivotArea: Typed[PivotArea, Literal[False]] @@ -448,7 +448,7 @@ class Format(Serialisable): ) -> None: ... class DataField(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[True]] fld: Integer[Literal[False]] subtotal: Set[_DataFieldSubtotal] @@ -485,7 +485,7 @@ class DataField(Serialisable): ) -> None: ... class PageField(Serialisable): - tagname: str + tagname: ClassVar[str] fld: Integer[Literal[False]] item: Integer[Literal[True]] hier: Integer[Literal[True]] @@ -504,7 +504,7 @@ class PageField(Serialisable): ) -> None: ... class RowColItem(Serialisable): - tagname: str + tagname: ClassVar[str] t: Set[_ItemType] r: Integer[Literal[False]] i: Integer[Literal[False]] @@ -513,7 +513,7 @@ class RowColItem(Serialisable): def __init__(self, t: _ItemType = "data", r: _ConvertibleToInt = 0, i: _ConvertibleToInt = 0, x=()) -> None: ... class RowColField(Serialisable): - tagname: str + tagname: ClassVar[str] x: Integer[Literal[False]] def __init__(self, x: _ConvertibleToInt) -> None: ... @@ -523,7 +523,7 @@ class AutoSortScope(Serialisable): def __init__(self, pivotArea: PivotArea) -> None: ... class FieldItem(Serialisable): - tagname: str + tagname: ClassVar[str] n: String[Literal[True]] t: Set[_ItemType] h: Bool[Literal[True]] @@ -551,7 +551,7 @@ class FieldItem(Serialisable): ) -> None: ... class PivotField(Serialisable): - tagname: str + tagname: ClassVar[str] items: Incomplete autoSortScope: Typed[AutoSortScope, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] @@ -660,7 +660,7 @@ class PivotField(Serialisable): ) -> None: ... class Location(Serialisable): - tagname: str + tagname: ClassVar[str] ref: String[Literal[False]] firstHeaderRow: Integer[Literal[False]] firstDataRow: Integer[Literal[False]] @@ -680,7 +680,7 @@ class Location(Serialisable): class TableDefinition(Serialisable): mime_type: str rel_type: str - tagname: str + tagname: ClassVar[str] cache: Incomplete name: String[Literal[False]] cacheId: Integer[Literal[False]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/excel.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/excel.pyi index 410ba2223611..4747182a4353 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/excel.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/reader/excel.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete, StrPath, SupportsRead +from typing_extensions import Final, Literal, TypeAlias from zipfile import ZipFile from openpyxl.chartsheet.chartsheet import Chartsheet @@ -7,7 +8,8 @@ from openpyxl.packaging.relationship import Relationship from openpyxl.reader.workbook import WorkbookParser from openpyxl.workbook import Workbook -SUPPORTED_FORMATS: Incomplete +_SupportedFormats: TypeAlias = Literal[".xlsx", ".xlsm", ".xltx", ".xltm"] +SUPPORTED_FORMATS: Final[tuple[_SupportedFormats, ...]] class ExcelReader: archive: ZipFile diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/alignment.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/alignment.pyi index d38c39286bdd..752312b986fe 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/alignment.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/alignment.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from typing import ClassVar from typing_extensions import Literal, TypeAlias from openpyxl.descriptors.base import Alias, Bool, Min, MinMax, NoneSet, _ConvertibleToBool, _ConvertibleToFloat @@ -13,8 +14,8 @@ horizontal_alignments: tuple[_HorizontalAlignmentsType, ...] vertical_aligments: tuple[_VerticalAlignmentsType, ...] class Alignment(Serialisable): - tagname: str - __fields__: Incomplete + tagname: ClassVar[str] + __fields__: ClassVar[tuple[str, ...]] horizontal: NoneSet[_HorizontalAlignmentsType] vertical: NoneSet[_VerticalAlignmentsType] textRotation: NoneSet[int] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/borders.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/borders.pyi index f11117c9cd0f..3a9607925d8c 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/borders.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/borders.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete from typing import ClassVar -from typing_extensions import Literal, TypeAlias +from typing_extensions import Final, Literal, TypeAlias from openpyxl.descriptors.base import Alias, Bool, NoneSet, Typed, _ConvertibleToBool from openpyxl.descriptors.serialisable import Serialisable @@ -21,23 +21,23 @@ _SideStyle: TypeAlias = Literal[ "thin", ] -BORDER_NONE: Incomplete -BORDER_DASHDOT: str -BORDER_DASHDOTDOT: str -BORDER_DASHED: str -BORDER_DOTTED: str -BORDER_DOUBLE: str -BORDER_HAIR: str -BORDER_MEDIUM: str -BORDER_MEDIUMDASHDOT: str -BORDER_MEDIUMDASHDOTDOT: str -BORDER_MEDIUMDASHED: str -BORDER_SLANTDASHDOT: str -BORDER_THICK: str -BORDER_THIN: str +BORDER_NONE: Final = None +BORDER_DASHDOT: Final = "dashDot" +BORDER_DASHDOTDOT: Final = "dashDotDot" +BORDER_DASHED: Final = "dashed" +BORDER_DOTTED: Final = "dotted" +BORDER_DOUBLE: Final = "double" +BORDER_HAIR: Final = "hair" +BORDER_MEDIUM: Final = "medium" +BORDER_MEDIUMDASHDOT: Final = "mediumDashDot" +BORDER_MEDIUMDASHDOTDOT: Final = "mediumDashDotDot" +BORDER_MEDIUMDASHED: Final = "mediumDashed" +BORDER_SLANTDASHDOT: Final = "slantDashDot" +BORDER_THICK: Final = "thick" +BORDER_THIN: Final = "thin" class Side(Serialisable): - __fields__: Incomplete + __fields__: ClassVar[tuple[str, ...]] color: Incomplete style: NoneSet[_SideStyle] border_style: Alias @@ -49,8 +49,8 @@ class Side(Serialisable): ) -> None: ... class Border(Serialisable): - tagname: str - __fields__: Incomplete + tagname: ClassVar[str] + __fields__: ClassVar[tuple[str, ...]] __elements__: ClassVar[tuple[str, ...]] start: Typed[Side, Literal[True]] end: Typed[Side, Literal[True]] @@ -83,4 +83,4 @@ class Border(Serialisable): ) -> None: ... def __iter__(self): ... -DEFAULT_BORDER: Incomplete +DEFAULT_BORDER: Final[Border] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/cell_style.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/cell_style.pyi index d1cd9284637c..22362cf54be5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/cell_style.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/cell_style.pyi @@ -17,7 +17,7 @@ class ArrayDescriptor: def __set__(self, instance: Serialisable | Strict, value) -> None: ... class StyleArray(array[Incomplete]): - tagname: str + tagname: ClassVar[str] fontId: Incomplete fillId: Incomplete borderId: Incomplete @@ -33,7 +33,7 @@ class StyleArray(array[Incomplete]): def __deepcopy__(self, memo): ... class CellStyle(Serialisable): - tagname: str + tagname: ClassVar[str] numFmtId: Integer[Literal[False]] fontId: Integer[Literal[False]] fillId: Integer[Literal[False]] @@ -81,7 +81,7 @@ class CellStyle(Serialisable): def applyAlignment(self): ... class CellStyleList(Serialisable): - tagname: str + tagname: ClassVar[str] __attrs__: ClassVar[tuple[str, ...]] # Overwritten by property below # count: Integer diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/colors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/colors.pyi index 67fbdd86119f..3b69fc27111b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/colors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/colors.pyi @@ -1,23 +1,24 @@ from _typeshed import Incomplete, Unused +from re import Pattern from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Final, Literal from openpyxl.descriptors import Strict, Typed from openpyxl.descriptors.base import Bool, Integer, MinMax, String, _ConvertibleToBool, _ConvertibleToFloat, _ConvertibleToInt from openpyxl.descriptors.serialisable import Serialisable -COLOR_INDEX: Incomplete -BLACK: Incomplete -WHITE: Incomplete -BLUE: Incomplete -aRGB_REGEX: Incomplete +COLOR_INDEX: Final[tuple[str, ...]] +BLACK: Final = "00000000" +WHITE: Final = "00FFFFFF" +BLUE: Final = "00FFFFFF" +aRGB_REGEX: Final[Pattern[str]] class RGB(Typed[str, Incomplete]): expected_type: type[str] def __set__(self, instance: Serialisable | Strict, value) -> None: ... class Color(Serialisable): - tagname: str + tagname: ClassVar[str] rgb: Incomplete indexed: Integer[Literal[False]] auto: Bool[Literal[False]] @@ -48,12 +49,12 @@ class ColorDescriptor(Typed[Color, Incomplete]): def __set__(self, instance: Serialisable | Strict, value) -> None: ... class RgbColor(Serialisable): - tagname: str + tagname: ClassVar[str] rgb: Incomplete def __init__(self, rgb: Incomplete | None = None) -> None: ... class ColorList(Serialisable): - tagname: str + tagname: ClassVar[str] indexedColors: Incomplete mruColors: Incomplete __elements__: ClassVar[tuple[str, ...]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/differential.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/differential.pyi index a30bf66a5876..508463dd5a6e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/differential.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/differential.pyi @@ -9,7 +9,7 @@ from openpyxl.styles import Alignment, Border, Fill, Font, Protection from openpyxl.styles.numbers import NumberFormat class DifferentialStyle(Serialisable): - tagname: str + tagname: ClassVar[str] __elements__: ClassVar[tuple[str, ...]] font: Typed[Font, Literal[True]] numFmt: Typed[NumberFormat, Literal[True]] @@ -30,7 +30,7 @@ class DifferentialStyle(Serialisable): ) -> None: ... class DifferentialStyleList(Serialisable): - tagname: str + tagname: ClassVar[str] dxf: Incomplete styles: Alias __attrs__: ClassVar[tuple[str, ...]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fills.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fills.pyi index 88984480019e..b65e4d567c78 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fills.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fills.pyi @@ -51,12 +51,12 @@ _FillsType: TypeAlias = Literal[ fills: tuple[_FillsType, ...] class Fill(Serialisable): - tagname: str + tagname: ClassVar[str] @classmethod def from_tree(cls, el): ... class PatternFill(Fill): - tagname: str + tagname: ClassVar[str] __elements__: ClassVar[tuple[str, ...]] patternType: NoneSet[_FillsType] fill_type: Alias @@ -73,13 +73,13 @@ class PatternFill(Fill): start_color: Incomplete | None = None, end_color: Incomplete | None = None, ) -> None: ... - def to_tree(self, tagname: Incomplete | None = None, idx: Incomplete | None = None): ... # type: ignore[override] + def to_tree(self, tagname: str | None = None, idx: Incomplete | None = None): ... # type: ignore[override] -DEFAULT_EMPTY_FILL: Incomplete -DEFAULT_GRAY_FILL: Incomplete +DEFAULT_EMPTY_FILL: Final[PatternFill] +DEFAULT_GRAY_FILL: Final[PatternFill] class Stop(Serialisable): - tagname: str + tagname: ClassVar[str] position: MinMax[float, Literal[False]] color: Incomplete def __init__(self, color, position: _ConvertibleToFloat) -> None: ... @@ -89,7 +89,7 @@ class StopList(Sequence): def __set__(self, obj, values) -> None: ... class GradientFill(Fill): - tagname: str + tagname: ClassVar[str] type: Set[_GradientFillType] fill_type: Alias degree: Float[Literal[False]] @@ -109,4 +109,4 @@ class GradientFill(Fill): stop=(), ) -> None: ... def __iter__(self): ... - def to_tree(self, tagname: Incomplete | None = None, namespace: Incomplete | None = None, idx: Incomplete | None = None): ... # type: ignore[override] + def to_tree(self, tagname: str | None = None, namespace: str | None = None, idx: Incomplete | None = None): ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fonts.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fonts.pyi index 88ad1e98e250..b6dbd78596a0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fonts.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/fonts.pyi @@ -1,60 +1,75 @@ from _typeshed import Incomplete from typing import ClassVar +from typing_extensions import Final, Literal, TypeAlias -from openpyxl.descriptors.base import Alias +from openpyxl.descriptors.base import Alias, _ConvertibleToBool, _ConvertibleToFloat, _ConvertibleToInt +from openpyxl.descriptors.nested import ( + NestedBool, + NestedFloat, + NestedInteger, + NestedMinMax, + NestedNoneSet, + NestedString, + _HasTagAndGet, + _NestedNoneSetParam, +) from openpyxl.descriptors.serialisable import Serialisable +_FontU: TypeAlias = Literal["single", "double", "singleAccounting", "doubleAccounting"] +_FontVertAlign: TypeAlias = Literal["superscript", "subscript", "baseline"] +_FontScheme: TypeAlias = Literal["major", "minor"] + class Font(Serialisable): - UNDERLINE_DOUBLE: str - UNDERLINE_DOUBLE_ACCOUNTING: str - UNDERLINE_SINGLE: str - UNDERLINE_SINGLE_ACCOUNTING: str - name: Incomplete - charset: Incomplete - family: Incomplete - sz: Incomplete + UNDERLINE_DOUBLE: Final = "double" + UNDERLINE_DOUBLE_ACCOUNTING: Final = "doubleAccounting" + UNDERLINE_SINGLE: Final = "single" + UNDERLINE_SINGLE_ACCOUNTING: Final = "singleAccounting" + name: NestedString[Literal[True]] + charset: NestedInteger[Literal[True]] + family: NestedMinMax[float, Literal[True]] + sz: NestedFloat[Literal[True]] size: Alias - b: Incomplete + b: NestedBool[Literal[False]] bold: Alias - i: Incomplete + i: NestedBool[Literal[False]] italic: Alias - strike: Incomplete + strike: NestedBool[Literal[True]] strikethrough: Alias - outline: Incomplete - shadow: Incomplete - condense: Incomplete - extend: Incomplete - u: Incomplete + outline: NestedBool[Literal[True]] + shadow: NestedBool[Literal[True]] + condense: NestedBool[Literal[True]] + extend: NestedBool[Literal[True]] + u: NestedNoneSet[_FontU] underline: Alias - vertAlign: Incomplete + vertAlign: NestedNoneSet[_FontVertAlign] color: Incomplete - scheme: Incomplete - tagname: str + scheme: NestedNoneSet[_FontScheme] + tagname: ClassVar[str] __elements__: ClassVar[tuple[str, ...]] def __init__( self, - name: Incomplete | None = None, - sz: Incomplete | None = None, - b: Incomplete | None = None, - i: Incomplete | None = None, - charset: Incomplete | None = None, - u: Incomplete | None = None, - strike: Incomplete | None = None, + name: object = None, + sz: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + b: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, + i: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool = None, + charset: _HasTagAndGet[_ConvertibleToInt | None] | _ConvertibleToInt | None = None, + u: _NestedNoneSetParam[_FontU] = None, + strike: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, color: Incomplete | None = None, - scheme: Incomplete | None = None, - family: Incomplete | None = None, - size: Incomplete | None = None, - bold: Incomplete | None = None, - italic: Incomplete | None = None, - strikethrough: Incomplete | None = None, - underline: Incomplete | None = None, - vertAlign: Incomplete | None = None, - outline: Incomplete | None = None, - shadow: Incomplete | None = None, - condense: Incomplete | None = None, - extend: Incomplete | None = None, + scheme: _NestedNoneSetParam[_FontScheme] = None, + family: _HasTagAndGet[_ConvertibleToFloat | None] | _ConvertibleToFloat | None = None, + size: _HasTagAndGet[_ConvertibleToFloat] | _ConvertibleToFloat | None = None, + bold: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool | None = None, + italic: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool | None = None, + strikethrough: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool | None = None, + underline: _NestedNoneSetParam[_FontU] = None, + vertAlign: _NestedNoneSetParam[_FontVertAlign] = None, + outline: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + shadow: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + condense: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, + extend: _HasTagAndGet[_ConvertibleToBool | None] | _ConvertibleToBool | None = None, ) -> None: ... @classmethod def from_tree(cls, node): ... -DEFAULT_FONT: Incomplete +DEFAULT_FONT: Final[Font] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi index e029b84e0fa5..aa858f0a7ca6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/named_styles.pyi @@ -52,7 +52,7 @@ class NamedStyleList(list[Incomplete]): def append(self, style) -> None: ... class _NamedCellStyle(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[False]] xfId: Integer[Literal[False]] builtinId: Integer[Literal[True]] @@ -73,7 +73,7 @@ class _NamedCellStyle(Serialisable): ) -> None: ... class _NamedCellStyleList(Serialisable): - tagname: str + tagname: ClassVar[str] # Overwritten by property below # count: Integer cellStyle: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/numbers.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/numbers.pyi index a2ad642a1aaa..d23d987c884b 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/numbers.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/numbers.pyi @@ -1,53 +1,55 @@ from _typeshed import Incomplete, Unused +from re import Pattern from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Final, Literal from openpyxl.descriptors import Strict, String from openpyxl.descriptors.base import Integer, _ConvertibleToInt from openpyxl.descriptors.serialisable import Serialisable -BUILTIN_FORMATS: Incomplete -BUILTIN_FORMATS_MAX_SIZE: int -BUILTIN_FORMATS_REVERSE: Incomplete -FORMAT_GENERAL: Incomplete -FORMAT_TEXT: Incomplete -FORMAT_NUMBER: Incomplete -FORMAT_NUMBER_00: Incomplete -FORMAT_NUMBER_COMMA_SEPARATED1: Incomplete -FORMAT_NUMBER_COMMA_SEPARATED2: str -FORMAT_PERCENTAGE: Incomplete -FORMAT_PERCENTAGE_00: Incomplete -FORMAT_DATE_YYYYMMDD2: str -FORMAT_DATE_YYMMDD: str -FORMAT_DATE_DDMMYY: str -FORMAT_DATE_DMYSLASH: str -FORMAT_DATE_DMYMINUS: str -FORMAT_DATE_DMMINUS: str -FORMAT_DATE_MYMINUS: str -FORMAT_DATE_XLSX14: Incomplete -FORMAT_DATE_XLSX15: Incomplete -FORMAT_DATE_XLSX16: Incomplete -FORMAT_DATE_XLSX17: Incomplete -FORMAT_DATE_XLSX22: Incomplete -FORMAT_DATE_DATETIME: str -FORMAT_DATE_TIME1: Incomplete -FORMAT_DATE_TIME2: Incomplete -FORMAT_DATE_TIME3: Incomplete -FORMAT_DATE_TIME4: Incomplete -FORMAT_DATE_TIME5: Incomplete -FORMAT_DATE_TIME6: Incomplete -FORMAT_DATE_TIME7: str -FORMAT_DATE_TIME8: str -FORMAT_DATE_TIMEDELTA: str -FORMAT_DATE_YYMMDDSLASH: str -FORMAT_CURRENCY_USD_SIMPLE: str -FORMAT_CURRENCY_USD: str -FORMAT_CURRENCY_EUR_SIMPLE: str -COLORS: str -LITERAL_GROUP: str -LOCALE_GROUP: str -STRIP_RE: Incomplete -TIMEDELTA_RE: Incomplete +BUILTIN_FORMATS: Final[dict[int, str]] +BUILTIN_FORMATS_MAX_SIZE: Final = 164 +BUILTIN_FORMATS_REVERSE: Final[dict[str, int]] +FORMAT_GENERAL: Final = "General" +FORMAT_TEXT: Final = "@" +FORMAT_NUMBER: Final = "0" +FORMAT_NUMBER_00: Final = "0.00" +FORMAT_NUMBER_COMMA_SEPARATED1: Final = "#,##0.00" +FORMAT_NUMBER_COMMA_SEPARATED2: Final = "#,##0.00_-" +FORMAT_PERCENTAGE: Final = "0%" +FORMAT_PERCENTAGE_00: Final = "0.00%" +FORMAT_DATE_YYYYMMDD2: Final = "yyyy-mm-dd" +FORMAT_DATE_YYMMDD: Final = "yy-mm-dd" +FORMAT_DATE_DDMMYY: Final = "dd/mm/yy" +FORMAT_DATE_DMYSLASH: Final = "d/m/y" +FORMAT_DATE_DMYMINUS: Final = "d-m-y" +FORMAT_DATE_DMMINUS: Final = "d-m" +FORMAT_DATE_MYMINUS: Final = "m-y" +FORMAT_DATE_XLSX14: Final = "mm-dd-yy" +FORMAT_DATE_XLSX15: Final = "d-mmm-yy" +FORMAT_DATE_XLSX16: Final = "d-mmm" +FORMAT_DATE_XLSX17: Final = "mmm-yy" +FORMAT_DATE_XLSX22: Final = "m/d/yy h:mm" +FORMAT_DATE_DATETIME: Final = "yyyy-mm-dd h:mm:ss" +FORMAT_DATE_TIME1: Final = "h:mm AM/PM" +FORMAT_DATE_TIME2: Final = "h:mm:ss AM/PM" +FORMAT_DATE_TIME3: Final = "h:mm" +FORMAT_DATE_TIME4: Final = "h:mm:ss" +FORMAT_DATE_TIME5: Final = "mm:ss" +FORMAT_DATE_TIME6: Final = "h:mm:ss" +FORMAT_DATE_TIME7: Final = "i:s.S" +FORMAT_DATE_TIME8: Final = "h:mm:ss@" +FORMAT_DATE_TIMEDELTA: Final = "[hh]:mm:ss" +FORMAT_DATE_YYMMDDSLASH: Final = "yy/mm/dd@" +FORMAT_CURRENCY_USD_SIMPLE: Final = '"$"#,##0.00_-' +FORMAT_CURRENCY_USD: Final = "$#,##0_-" +FORMAT_CURRENCY_EUR_SIMPLE: Final = "[$EUR ]#,##0.00_-" + +COLORS: Final[str] +LITERAL_GROUP: Final = r'".*?"' +LOCALE_GROUP: Final = r"\[(?!hh?\]|mm?\]|ss?\])[^\]]*\]" +STRIP_RE: Final[Pattern[str]] +TIMEDELTA_RE: Final[Pattern[str]] def is_date_format(fmt): ... def is_timedelta_format(fmt): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/protection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/protection.pyi index 0f533a668680..7295cbf2397f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/protection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/protection.pyi @@ -1,9 +1,10 @@ from _typeshed import Incomplete +from typing import ClassVar from openpyxl.descriptors.serialisable import Serialisable class Protection(Serialisable): - tagname: str + tagname: ClassVar[str] locked: Incomplete hidden: Incomplete def __init__(self, locked: bool = True, hidden: bool = False) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/stylesheet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/stylesheet.pyi index ae36e48132c7..1d7b2fe266b3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/stylesheet.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/stylesheet.pyi @@ -12,7 +12,7 @@ from openpyxl.styles.numbers import NumberFormatList from openpyxl.styles.table import TableStyleList class Stylesheet(Serialisable): - tagname: str + tagname: ClassVar[str] numFmts: Typed[NumberFormatList, Literal[False]] fonts: Incomplete fills: Incomplete @@ -48,7 +48,7 @@ class Stylesheet(Serialisable): def from_tree(cls, node): ... @property def custom_formats(self): ... - def to_tree(self, tagname: Incomplete | None = None, idx: Incomplete | None = None, namespace: Incomplete | None = None): ... + def to_tree(self, tagname: str | None = None, idx: Incomplete | None = None, namespace: str | None = None): ... def apply_stylesheet(archive, wb): ... def write_stylesheet(wb): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/table.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/table.pyi index 9e83304b5d91..e9853be0fcd3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/table.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/styles/table.pyi @@ -37,7 +37,7 @@ _TableStyleElementType: TypeAlias = Literal[ ] class TableStyleElement(Serialisable): - tagname: str + tagname: ClassVar[str] type: Set[_TableStyleElementType] size: Integer[Literal[True]] dxfId: Integer[Literal[True]] @@ -46,7 +46,7 @@ class TableStyleElement(Serialisable): ) -> None: ... class TableStyle(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[False]] pivot: Bool[Literal[True]] table: Bool[Literal[True]] @@ -63,7 +63,7 @@ class TableStyle(Serialisable): ) -> None: ... class TableStyleList(Serialisable): - tagname: str + tagname: ClassVar[str] defaultTableStyle: String[Literal[True]] defaultPivotStyle: String[Literal[True]] tableStyle: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi index bddf718b7e43..5b15e29f355e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/cell.pyi @@ -1,20 +1,19 @@ from _typeshed import Incomplete from collections.abc import Generator +from re import Pattern +from typing_extensions import Final -COORD_RE: Incomplete -COL_RANGE: str -ROW_RANGE: str -RANGE_EXPR: str -ABSOLUTE_RE: Incomplete -SHEET_TITLE: str -SHEETRANGE_RE: Incomplete +COORD_RE: Final[Pattern[str]] +COL_RANGE: Final = """[A-Z]{1,3}:[A-Z]{1,3}:""" +ROW_RANGE: Final = r"""\d+:\d+:""" +RANGE_EXPR: Final[str] +ABSOLUTE_RE: Final[Pattern[str]] +SHEET_TITLE: Final[str] +SHEETRANGE_RE: Final[Pattern[str]] def get_column_interval(start: str | int, end: str | int) -> list[str]: ... def coordinate_from_string(coord_string: str) -> tuple[str, int]: ... def absolute_coordinate(coord_string: str) -> str: ... - -col: Incomplete - def get_column_letter(idx: int) -> str: ... def column_index_from_string(str_col: str) -> int: ... def range_boundaries(range_string: str) -> tuple[int, int, int, int]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/datetime.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/datetime.pyi index 70b029bdecf4..de2c233d5274 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/datetime.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/datetime.pyi @@ -1,14 +1,16 @@ -from _typeshed import Incomplete +from datetime import datetime +from re import Pattern +from typing_extensions import Final -MAC_EPOCH: Incomplete -WINDOWS_EPOCH: Incomplete +MAC_EPOCH: Final[datetime] +WINDOWS_EPOCH: Final[datetime] # The following two constants are defined twice in the implementation. CALENDAR_WINDOWS_1900 = WINDOWS_EPOCH CALENDAR_MAC_1904 = MAC_EPOCH -SECS_PER_DAY: int -ISO_FORMAT: str -ISO_REGEX: Incomplete -ISO_DURATION: Incomplete +SECS_PER_DAY: Final = 86400 +ISO_FORMAT: Final = "%Y-%m-%dT%H:%M:%SZ" +ISO_REGEX: Final[Pattern[str]] +ISO_DURATION: Final[Pattern[str]] def to_ISO8601(dt): ... def from_ISO8601(formatted_string): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/formulas.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/formulas.pyi index 8e49ec3adeaa..6d16169b1261 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/formulas.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/formulas.pyi @@ -1,3 +1,3 @@ -from _typeshed import Incomplete +from typing_extensions import Final -FORMULAE: Incomplete +FORMULAE: Final[frozenset[str]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/inference.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/inference.pyi index b8411c805517..85e0441c609e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/inference.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/inference.pyi @@ -1,8 +1,9 @@ -from _typeshed import Incomplete +from re import Pattern +from typing_extensions import Final -PERCENT_REGEX: Incomplete -TIME_REGEX: Incomplete -NUMBER_REGEX: Incomplete +PERCENT_REGEX: Final[Pattern[str]] +TIME_REGEX: Final[Pattern[str]] +NUMBER_REGEX: Final[Pattern[str]] def cast_numeric(value): ... def cast_percentage(value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/units.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/units.pyi index 8f9c3d1a5209..6264bc8263e8 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/units.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/utils/units.pyi @@ -1,11 +1,11 @@ -from _typeshed import Incomplete +from typing_extensions import Final -DEFAULT_ROW_HEIGHT: float -BASE_COL_WIDTH: int -DEFAULT_COLUMN_WIDTH: Incomplete -DEFAULT_LEFT_MARGIN: float -DEFAULT_TOP_MARGIN: float -DEFAULT_HEADER: float +DEFAULT_ROW_HEIGHT: Final[float] +BASE_COL_WIDTH: Final = 8 +DEFAULT_COLUMN_WIDTH: Final = 13 +DEFAULT_LEFT_MARGIN: Final[float] +DEFAULT_TOP_MARGIN: Final[float] +DEFAULT_HEADER: Final[float] def inch_to_dxa(value): ... def dxa_to_inch(value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/child.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/child.pyi index b74da8ee3cfb..fa39d2e42bba 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/child.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/child.pyi @@ -1,6 +1,8 @@ from _typeshed import Incomplete +from re import Pattern +from typing_extensions import Final -INVALID_TITLE_REGEX: Incomplete +INVALID_TITLE_REGEX: Final[Pattern[str]] def avoid_duplicate_name(names, value): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi index 9aa62c731970..7d3b95867fbd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/defined_name.pyi @@ -2,17 +2,18 @@ from _typeshed import Incomplete from collections import defaultdict from collections.abc import Generator from re import Pattern -from typing_extensions import Literal +from typing import ClassVar +from typing_extensions import Final, Literal from openpyxl.descriptors import Sequence from openpyxl.descriptors.base import Alias, Bool, Integer, String, _ConvertibleToBool, _ConvertibleToInt from openpyxl.descriptors.serialisable import Serialisable -RESERVED: frozenset[str] -RESERVED_REGEX: Pattern[str] +RESERVED: Final[frozenset[str]] +RESERVED_REGEX: Final[Pattern[str]] class DefinedName(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[False]] comment: String[Literal[True]] customMenu: String[Literal[True]] @@ -63,7 +64,7 @@ class DefinedNameDict(dict[str, DefinedName]): def add(self, value: DefinedName) -> None: ... class DefinedNameList(Serialisable): - tagname: str + tagname: ClassVar[str] definedName: Sequence def __init__(self, definedName=()) -> None: ... def by_sheet(self) -> defaultdict[int, DefinedNameDict]: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_link/external.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_link/external.pyi index 947ebe99288b..fcd66e68bdff 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_link/external.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_link/external.pyi @@ -3,6 +3,7 @@ from typing import ClassVar from typing_extensions import Literal, TypeAlias from openpyxl.descriptors.base import Bool, Integer, NoneSet, String, Typed, _ConvertibleToBool, _ConvertibleToInt +from openpyxl.descriptors.nested import NestedText from openpyxl.descriptors.serialisable import Serialisable from openpyxl.packaging.relationship import Relationship @@ -12,13 +13,9 @@ class ExternalCell(Serialisable): r: String[Literal[False]] t: NoneSet[_ExternalCellType] vm: Integer[Literal[True]] - v: Incomplete + v: NestedText[str, Literal[True]] def __init__( - self, - r: str, - t: _ExternalCellType | Literal["none"] | None = None, - vm: _ConvertibleToInt | None = None, - v: Incomplete | None = None, + self, r: str, t: _ExternalCellType | Literal["none"] | None = None, vm: _ConvertibleToInt | None = None, v: object = None ) -> None: ... class ExternalRow(Serialisable): @@ -45,14 +42,14 @@ class ExternalSheetNames(Serialisable): def __init__(self, sheetName=()) -> None: ... class ExternalDefinedName(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[False]] refersTo: String[Literal[True]] sheetId: Integer[Literal[True]] def __init__(self, name: str, refersTo: str | None = None, sheetId: _ConvertibleToInt | None = None) -> None: ... class ExternalBook(Serialisable): - tagname: str + tagname: ClassVar[str] sheetNames: Typed[ExternalSheetNames, Literal[True]] definedNames: Incomplete sheetDataSet: Typed[ExternalSheetDataSet, Literal[True]] @@ -67,7 +64,7 @@ class ExternalBook(Serialisable): ) -> None: ... class ExternalLink(Serialisable): - tagname: str + tagname: ClassVar[str] mime_type: str externalBook: Typed[ExternalBook, Literal[True]] file_link: Typed[Relationship, Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_reference.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_reference.pyi index 507b7acd6158..4b202d9ce5ee 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_reference.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/external_reference.pyi @@ -1,8 +1,9 @@ from _typeshed import Incomplete +from typing import ClassVar from openpyxl.descriptors.serialisable import Serialisable class ExternalReference(Serialisable): - tagname: str + tagname: ClassVar[str] id: Incomplete def __init__(self, id) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/function_group.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/function_group.pyi index 442a4c4b724a..61f19b6c672a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/function_group.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/function_group.pyi @@ -6,12 +6,12 @@ from openpyxl.descriptors.base import Integer, String, _ConvertibleToInt from openpyxl.descriptors.serialisable import Serialisable class FunctionGroup(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[False]] def __init__(self, name: str) -> None: ... class FunctionGroupList(Serialisable): - tagname: str + tagname: ClassVar[str] builtInGroupCount: Integer[Literal[True]] functionGroup: Incomplete __elements__: ClassVar[tuple[str, ...]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/properties.pyi index 0d2eebebae28..d06b589be4e4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/properties.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/properties.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from typing import ClassVar from typing_extensions import Literal, TypeAlias from openpyxl.descriptors.base import ( @@ -19,7 +20,7 @@ _CalcPropertiesCalcMode: TypeAlias = Literal["manual", "auto", "autoNoTable"] _CalcPropertiesRefMode: TypeAlias = Literal["A1", "R1C1"] class WorkbookProperties(Serialisable): - tagname: str + tagname: ClassVar[str] date1904: Bool[Literal[True]] dateCompatibility: Bool[Literal[True]] showObjects: NoneSet[_WorkbookPropertiesShowObjects] @@ -63,7 +64,7 @@ class WorkbookProperties(Serialisable): ) -> None: ... class CalcProperties(Serialisable): - tagname: str + tagname: ClassVar[str] calcId: Integer[Literal[False]] calcMode: NoneSet[_CalcPropertiesCalcMode] fullCalcOnLoad: Bool[Literal[True]] @@ -95,7 +96,7 @@ class CalcProperties(Serialisable): ) -> None: ... class FileVersion(Serialisable): - tagname: str + tagname: ClassVar[str] appName: String[Literal[True]] lastEdited: String[Literal[True]] lowestEdited: String[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/protection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/protection.pyi index 3e5bdb636cd2..1b4c732b18d3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/protection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/protection.pyi @@ -6,7 +6,7 @@ from openpyxl.descriptors.base import Alias, Bool, Integer, String, _Convertible from openpyxl.descriptors.serialisable import Serialisable class WorkbookProtection(Serialisable): - tagname: str + tagname: ClassVar[str] workbook_password: Alias workbookPasswordCharacterSet: String[Literal[True]] revision_password: Alias @@ -60,7 +60,7 @@ class WorkbookProtection(Serialisable): DocumentSecurity = WorkbookProtection class FileSharing(Serialisable): - tagname: str + tagname: ClassVar[str] readOnlyRecommended: Bool[Literal[True]] userName: String[Literal[True]] reservationPassword: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/smart_tags.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/smart_tags.pyi index 3c188b2c6bdd..bc7a95d7e7b0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/smart_tags.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/smart_tags.pyi @@ -8,20 +8,20 @@ from openpyxl.descriptors.serialisable import Serialisable _SmartTagPropertiesShow: TypeAlias = Literal["all", "noIndicator"] class SmartTag(Serialisable): - tagname: str + tagname: ClassVar[str] namespaceUri: String[Literal[True]] name: String[Literal[True]] url: String[Literal[True]] def __init__(self, namespaceUri: str | None = None, name: str | None = None, url: str | None = None) -> None: ... class SmartTagList(Serialisable): - tagname: str + tagname: ClassVar[str] smartTagType: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, smartTagType=()) -> None: ... class SmartTagProperties(Serialisable): - tagname: str + tagname: ClassVar[str] embed: Bool[Literal[True]] show: NoneSet[_SmartTagPropertiesShow] def __init__( diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/views.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/views.pyi index d9ecb97e6792..96263658b06d 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/views.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/views.pyi @@ -11,7 +11,7 @@ _CustomWorkbookViewShowComments: TypeAlias = Literal["commNone", "commIndicator" _CustomWorkbookViewShowObjects: TypeAlias = Literal["all", "placeholders"] class BookView(Serialisable): - tagname: str + tagname: ClassVar[str] visibility: NoneSet[_BookViewVilibility] minimized: Bool[Literal[True]] showHorizontalScroll: Bool[Literal[True]] @@ -46,7 +46,7 @@ class BookView(Serialisable): ) -> None: ... class CustomWorkbookView(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[False]] guid: Incomplete autoUpdate: Bool[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/web.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/web.pyi index 62bbf82c0609..a5c184bc4f4e 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/web.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/web.pyi @@ -20,7 +20,7 @@ _WebPublishingTargetScreenSize: TypeAlias = Literal[ ] class WebPublishObject(Serialisable): - tagname: str + tagname: ClassVar[str] id: Integer[Literal[False]] divId: String[Literal[False]] sourceObject: String[Literal[True]] @@ -50,7 +50,7 @@ class WebPublishObject(Serialisable): ) -> None: ... class WebPublishObjectList(Serialisable): - tagname: str + tagname: ClassVar[str] # Overwritten by property below # count: Integer webPublishObject: Incomplete @@ -60,7 +60,7 @@ class WebPublishObjectList(Serialisable): def count(self): ... class WebPublishing(Serialisable): - tagname: str + tagname: ClassVar[str] css: Bool[Literal[True]] thicket: Bool[Literal[True]] longFileNames: Bool[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/workbook.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/workbook.pyi index 3fc2bf03e9c6..c609d6b3e5d5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/workbook.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/workbook/workbook.pyi @@ -2,6 +2,7 @@ from _typeshed import Incomplete, StrPath from collections.abc import Iterator from datetime import datetime from typing import IO +from typing_extensions import Final from openpyxl.chartsheet.chartsheet import Chartsheet from openpyxl.styles.named_styles import NamedStyle @@ -9,7 +10,7 @@ from openpyxl.workbook.child import _WorkbookChild from openpyxl.worksheet._write_only import WriteOnlyWorksheet from openpyxl.worksheet.worksheet import Worksheet -INTEGER_TYPES: Incomplete +INTEGER_TYPES: Final[tuple[type[int]]] class Workbook: template: bool diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi index e976e94aced0..7814b5be237a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_read_only.pyi @@ -1,5 +1,7 @@ from _typeshed import Incomplete +from openpyxl.worksheet.worksheet import Worksheet + def read_dimension(source): ... class ReadOnlyWorksheet: @@ -9,8 +11,8 @@ class ReadOnlyWorksheet: def values(self): ... @property def rows(self): ... - __getitem__: Incomplete - __iter__: Incomplete + __getitem__ = Worksheet.__getitem__ + __iter__ = Worksheet.__iter__ parent: Incomplete title: Incomplete sheet_state: str diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi index fc1d7028f11a..840801abb717 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_reader.pyi @@ -1,40 +1,41 @@ import datetime from _typeshed import Incomplete from collections.abc import Container, Generator +from typing_extensions import Final from .hyperlink import HyperlinkList from .pagebreak import ColBreak, RowBreak from .protection import SheetProtection from .table import TablePartList -CELL_TAG: Incomplete -VALUE_TAG: Incomplete -FORMULA_TAG: Incomplete -MERGE_TAG: Incomplete -INLINE_STRING: Incomplete -COL_TAG: Incomplete -ROW_TAG: Incomplete -CF_TAG: Incomplete -LEGACY_TAG: Incomplete -PROT_TAG: Incomplete -EXT_TAG: Incomplete -HYPERLINK_TAG: Incomplete -TABLE_TAG: Incomplete -PRINT_TAG: Incomplete -MARGINS_TAG: Incomplete -PAGE_TAG: Incomplete -HEADER_TAG: Incomplete -FILTER_TAG: Incomplete -VALIDATION_TAG: Incomplete -PROPERTIES_TAG: Incomplete -VIEWS_TAG: Incomplete -FORMAT_TAG: Incomplete -ROW_BREAK_TAG: Incomplete -COL_BREAK_TAG: Incomplete -SCENARIOS_TAG: Incomplete -DATA_TAG: Incomplete -DIMENSION_TAG: Incomplete -CUSTOM_VIEWS_TAG: Incomplete +CELL_TAG: Final[str] +VALUE_TAG: Final[str] +FORMULA_TAG: Final[str] +MERGE_TAG: Final[str] +INLINE_STRING: Final[str] +COL_TAG: Final[str] +ROW_TAG: Final[str] +CF_TAG: Final[str] +LEGACY_TAG: Final[str] +PROT_TAG: Final[str] +EXT_TAG: Final[str] +HYPERLINK_TAG: Final[str] +TABLE_TAG: Final[str] +PRINT_TAG: Final[str] +MARGINS_TAG: Final[str] +PAGE_TAG: Final[str] +HEADER_TAG: Final[str] +FILTER_TAG: Final[str] +VALIDATION_TAG: Final[str] +PROPERTIES_TAG: Final[str] +VIEWS_TAG: Final[str] +FORMAT_TAG: Final[str] +ROW_BREAK_TAG: Final[str] +COL_BREAK_TAG: Final[str] +SCENARIOS_TAG: Final[str] +DATA_TAG: Final[str] +DIMENSION_TAG: Final[str] +CUSTOM_VIEWS_TAG: Final[str] class WorkSheetParser: min_row: Incomplete | None diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi index d22d6bb929d0..a76d960d62bc 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/_writer.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from collections.abc import Generator -ALL_TEMP_FILES: Incomplete +ALL_TEMP_FILES: list[str] def create_temporary_file(suffix: str = ""): ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_range.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_range.pyi index c244ba5e8182..1c6e0f61d1c3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_range.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_range.pyi @@ -50,17 +50,17 @@ class CellRange(Serialisable): def __ne__(self, other): ... def __eq__(self, other): ... def issubset(self, other): ... - __le__: Incomplete + __le__ = issubset def __lt__(self, other): ... def issuperset(self, other): ... - __ge__: Incomplete + __ge__ = issuperset def __contains__(self, coord): ... def __gt__(self, other): ... def isdisjoint(self, other): ... def intersection(self, other): ... - __and__: Incomplete + __and__ = intersection def union(self, other): ... - __or__: Incomplete + __or__ = union def __iter__(self): ... def expand(self, right: int = 0, down: int = 0, left: int = 0, up: int = 0) -> None: ... def shrink(self, right: int = 0, bottom: int = 0, left: int = 0, top: int = 0) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_watch.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_watch.pyi index e6e2e4c95a99..d6d3c26b92db 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_watch.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/cell_watch.pyi @@ -6,12 +6,12 @@ from openpyxl.descriptors.base import String from openpyxl.descriptors.serialisable import Serialisable class CellWatch(Serialisable): - tagname: str + tagname: ClassVar[str] r: String[Literal[True]] def __init__(self, r: str) -> None: ... class CellWatches(Serialisable): - tagname: str + tagname: ClassVar[str] cellWatch: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, cellWatch=()) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/controls.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/controls.pyi index 33139070e270..ad3ebff3de31 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/controls.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/controls.pyi @@ -7,7 +7,7 @@ from openpyxl.descriptors.serialisable import Serialisable from openpyxl.worksheet.ole import ObjectAnchor class ControlProperty(Serialisable): - tagname: str + tagname: ClassVar[str] anchor: Typed[ObjectAnchor, Literal[False]] locked: Bool[Literal[True]] defaultSize: Bool[Literal[True]] @@ -46,7 +46,7 @@ class ControlProperty(Serialisable): ) -> None: ... class Control(Serialisable): - tagname: str + tagname: ClassVar[str] controlPr: Typed[ControlProperty, Literal[True]] shapeId: Integer[Literal[False]] name: String[Literal[True]] @@ -59,7 +59,7 @@ class Control(Serialisable): def __init__(self, controlPr: ControlProperty | None, shapeId: _ConvertibleToInt, name: str | None = None) -> None: ... class Controls(Serialisable): - tagname: str + tagname: ClassVar[str] control: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, control=()) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/custom.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/custom.pyi index f091420115ea..e395773bcebd 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/custom.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/custom.pyi @@ -6,12 +6,12 @@ from openpyxl.descriptors.base import String from openpyxl.descriptors.serialisable import Serialisable class CustomProperty(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[False]] def __init__(self, name: str) -> None: ... class CustomProperties(Serialisable): - tagname: str + tagname: ClassVar[str] customPr: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, customPr=()) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/datavalidation.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/datavalidation.pyi index fca6efb4f383..157a3bad2633 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/datavalidation.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/datavalidation.pyi @@ -13,6 +13,7 @@ from openpyxl.descriptors.base import ( _ConvertibleToInt, _ConvertibleToMultiCellRange, ) +from openpyxl.descriptors.nested import NestedText from openpyxl.descriptors.serialisable import Serialisable from openpyxl.worksheet.cell_range import MultiCellRange @@ -39,7 +40,7 @@ def collapse_cell_addresses(cells, input_ranges=()): ... def expand_cell_ranges(range_string): ... class DataValidation(Serialisable): - tagname: str + tagname: ClassVar[str] sqref: Convertible[MultiCellRange, Literal[False]] cells: Alias ranges: Alias @@ -53,8 +54,8 @@ class DataValidation(Serialisable): error: String[Literal[True]] promptTitle: String[Literal[True]] prompt: String[Literal[True]] - formula1: Incomplete - formula2: Incomplete + formula1: NestedText[str, Literal[True]] + formula2: NestedText[str, Literal[True]] type: NoneSet[_DataValidationType] errorStyle: NoneSet[_DataValidationErrorStyle] imeMode: NoneSet[_DataValidationImeMode] @@ -63,8 +64,8 @@ class DataValidation(Serialisable): def __init__( self, type: _DataValidationType | Literal["none"] | None = None, - formula1: Incomplete | None = None, - formula2: Incomplete | None = None, + formula1: object = None, + formula2: object = None, showErrorMessage: _ConvertibleToBool | None = False, showInputMessage: _ConvertibleToBool | None = False, showDropDown: _ConvertibleToBool | None = False, @@ -83,7 +84,7 @@ class DataValidation(Serialisable): def __contains__(self, cell): ... class DataValidationList(Serialisable): - tagname: str + tagname: ClassVar[str] disablePrompts: Bool[Literal[True]] xWindow: Integer[Literal[True]] yWindow: Integer[Literal[True]] @@ -102,4 +103,4 @@ class DataValidationList(Serialisable): def count(self): ... def __len__(self) -> int: ... def append(self, dv) -> None: ... - def to_tree(self, tagname: Incomplete | None = None): ... # type: ignore[override] + def to_tree(self, tagname: str | None = None): ... # type: ignore[override] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/dimensions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/dimensions.pyi index 3d714605bdfc..290a1b926ce6 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/dimensions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/dimensions.pyi @@ -120,7 +120,7 @@ class DimensionHolder(BoundDictionary[str, _DimT], Generic[_DimT]): def to_tree(self) -> Element | None: ... class SheetFormatProperties(Serialisable): - tagname: str + tagname: ClassVar[str] baseColWidth: Integer[Literal[True]] defaultColWidth: Float[Literal[True]] defaultRowHeight: Float[Literal[False]] @@ -144,7 +144,7 @@ class SheetFormatProperties(Serialisable): ) -> None: ... class SheetDimension(Serialisable): - tagname: str + tagname: ClassVar[str] ref: String[Literal[False]] def __init__(self, ref: str) -> None: ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/drawing.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/drawing.pyi index d95fbd256a9b..39bd9a91f651 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/drawing.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/drawing.pyi @@ -1,8 +1,9 @@ from _typeshed import Incomplete +from typing import ClassVar from openpyxl.descriptors.serialisable import Serialisable class Drawing(Serialisable): - tagname: str + tagname: ClassVar[str] id: Incomplete def __init__(self, id: Incomplete | None = None) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/errors.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/errors.pyi index 7bc9248303a2..e5f790588203 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/errors.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/errors.pyi @@ -6,18 +6,18 @@ from openpyxl.descriptors.base import Bool, String, Typed, _ConvertibleToBool from openpyxl.descriptors.serialisable import Serialisable class Extension(Serialisable): - tagname: str + tagname: ClassVar[str] uri: String[Literal[True]] def __init__(self, uri: str | None = None) -> None: ... class ExtensionList(Serialisable): - tagname: str + tagname: ClassVar[str] ext: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, ext=()) -> None: ... class IgnoredError(Serialisable): - tagname: str + tagname: ClassVar[str] sqref: Incomplete evalError: Bool[Literal[True]] twoDigitTextYear: Bool[Literal[True]] @@ -43,7 +43,7 @@ class IgnoredError(Serialisable): ) -> None: ... class IgnoredErrors(Serialisable): - tagname: str + tagname: ClassVar[str] ignoredError: Incomplete extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/filters.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/filters.pyi index caff87dca02d..a53c503f127f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/filters.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/filters.pyi @@ -100,7 +100,7 @@ _DynamicFilterType: TypeAlias = Literal[ _DateGroupItemDateTimeGrouping: TypeAlias = Literal["year", "month", "day", "hour", "minute", "second"] class SortCondition(Serialisable): - tagname: str + tagname: ClassVar[str] descending: Bool[Literal[True]] sortBy: NoneSet[_SortConditionSortBy] ref: Incomplete @@ -120,7 +120,7 @@ class SortCondition(Serialisable): ) -> None: ... class SortState(Serialisable): - tagname: str + tagname: ClassVar[str] columnSort: Bool[Literal[True]] caseSensitive: Bool[Literal[True]] sortMethod: NoneSet[_SortStateSortMethod] @@ -140,19 +140,19 @@ class SortState(Serialisable): def __bool__(self) -> bool: ... class IconFilter(Serialisable): - tagname: str + tagname: ClassVar[str] iconSet: Set[_IconSet] iconId: Integer[Literal[True]] def __init__(self, iconSet: _IconSet, iconId: _ConvertibleToInt | None = None) -> None: ... class ColorFilter(Serialisable): - tagname: str + tagname: ClassVar[str] dxfId: Integer[Literal[True]] cellColor: Bool[Literal[True]] def __init__(self, dxfId: _ConvertibleToInt | None = None, cellColor: _ConvertibleToBool | None = None) -> None: ... class DynamicFilter(Serialisable): - tagname: str + tagname: ClassVar[str] type: Set[_DynamicFilterType] val: Float[Literal[True]] valIso: DateTime[Literal[True]] @@ -168,7 +168,7 @@ class DynamicFilter(Serialisable): ) -> None: ... class CustomFilter(Serialisable): - tagname: str + tagname: ClassVar[str] operator: NoneSet[_CustomFilterOperator] val: Incomplete def __init__( @@ -176,14 +176,14 @@ class CustomFilter(Serialisable): ) -> None: ... class CustomFilters(Serialisable): - tagname: str + tagname: ClassVar[str] _and: Bool[Literal[True]] # Not private. Avoids name clash customFilter: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, _and: _ConvertibleToBool | None = False, customFilter=()) -> None: ... class Top10(Serialisable): - tagname: str + tagname: ClassVar[str] top: Bool[Literal[True]] percent: Bool[Literal[True]] val: Float[Literal[False]] @@ -207,7 +207,7 @@ class Top10(Serialisable): ) -> None: ... class DateGroupItem(Serialisable): - tagname: str + tagname: ClassVar[str] year: Integer[Literal[False]] month: MinMax[float, Literal[True]] day: MinMax[float, Literal[True]] @@ -240,7 +240,7 @@ class DateGroupItem(Serialisable): ) -> None: ... class Filters(Serialisable): - tagname: str + tagname: ClassVar[str] blank: Bool[Literal[True]] calendarType: NoneSet[_FiltersCalendarType] filter: Incomplete @@ -255,7 +255,7 @@ class Filters(Serialisable): ) -> None: ... class FilterColumn(Serialisable): - tagname: str + tagname: ClassVar[str] colId: Integer[Literal[False]] col_id: Alias hiddenButton: Bool[Literal[True]] @@ -285,7 +285,7 @@ class FilterColumn(Serialisable): ) -> None: ... class AutoFilter(Serialisable): - tagname: str + tagname: ClassVar[str] ref: Incomplete filterColumn: Incomplete sortState: Typed[SortState, Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/header_footer.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/header_footer.pyi index 3128bf68432e..e8066e0231c4 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/header_footer.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/header_footer.pyi @@ -1,21 +1,21 @@ -from _typeshed import Incomplete +from re import Pattern from typing import ClassVar -from typing_extensions import Literal +from typing_extensions import Final, Literal from openpyxl.descriptors import Strict from openpyxl.descriptors.base import Alias, Bool, Integer, MatchPattern, String, Typed, _ConvertibleToBool, _ConvertibleToInt from openpyxl.descriptors.serialisable import Serialisable -FONT_PATTERN: str -COLOR_PATTERN: str -SIZE_REGEX: str -FORMAT_REGEX: Incomplete +FONT_PATTERN: Final = '&"(?P.+)"' +COLOR_PATTERN: Final = "&K(?P[A-F0-9]{6})" +SIZE_REGEX: Final = r"&(?P\d+\s?)" +FORMAT_REGEX: Final[Pattern[str]] class _HeaderFooterPart(Strict): text: String[Literal[True]] font: String[Literal[True]] size: Integer[Literal[True]] - RGB: str + RGB: ClassVar[str] color: MatchPattern[str, Literal[True]] def __init__( self, text: str | None = None, font: str | None = None, size: _ConvertibleToInt | None = None, color: str | None = None @@ -41,7 +41,7 @@ class HeaderFooterItem(Strict): def from_tree(cls, node): ... class HeaderFooter(Serialisable): - tagname: str + tagname: ClassVar[str] differentOddEven: Bool[Literal[True]] differentFirst: Bool[Literal[True]] scaleWithDoc: Bool[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/hyperlink.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/hyperlink.pyi index aaccd9a6d21b..7281d4cd4348 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/hyperlink.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/hyperlink.pyi @@ -6,7 +6,7 @@ from openpyxl.descriptors.base import String from openpyxl.descriptors.serialisable import Serialisable class Hyperlink(Serialisable): - tagname: str + tagname: ClassVar[str] ref: String[Literal[False]] location: String[Literal[True]] tooltip: String[Literal[True]] @@ -25,7 +25,7 @@ class Hyperlink(Serialisable): ) -> None: ... class HyperlinkList(Serialisable): - tagname: str + tagname: ClassVar[str] hyperlink: Incomplete def __init__(self, hyperlink=()) -> None: ... def __bool__(self) -> bool: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/merge.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/merge.pyi index 46f9f498e21c..7df3faaa56d7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/merge.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/merge.pyi @@ -6,7 +6,7 @@ from openpyxl.descriptors.serialisable import Serialisable from .cell_range import CellRange class MergeCell(CellRange): - tagname: str + tagname: ClassVar[str] @property def ref(self): ... __attrs__: ClassVar[tuple[str, ...]] @@ -14,7 +14,7 @@ class MergeCell(CellRange): def __copy__(self): ... class MergeCells(Serialisable): - tagname: str + tagname: ClassVar[str] # Overwritten by property below # count: Integer mergeCell: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/ole.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/ole.pyi index 21d3bbf3879d..49c84566600a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/ole.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/ole.pyi @@ -10,7 +10,7 @@ _OleObjectDvAspect: TypeAlias = Literal["DVASPECT_CONTENT", "DVASPECT_ICON"] _OleObjectOleUpdate: TypeAlias = Literal["OLEUPDATE_ALWAYS", "OLEUPDATE_ONCALL"] class ObjectAnchor(Serialisable): - tagname: str + tagname: ClassVar[str] _from: Typed[AnchorMarker, Literal[False]] # Not private. Avoids name clash to: Typed[AnchorMarker, Literal[False]] moveWithCells: Bool[Literal[True]] @@ -26,7 +26,7 @@ class ObjectAnchor(Serialisable): ) -> None: ... class ObjectPr(Serialisable): - tagname: str + tagname: ClassVar[str] anchor: Typed[ObjectAnchor, Literal[False]] locked: Bool[Literal[True]] defaultSize: Bool[Literal[True]] @@ -75,7 +75,7 @@ class ObjectPr(Serialisable): ) -> None: ... class OleObject(Serialisable): - tagname: str + tagname: ClassVar[str] objectPr: Typed[ObjectPr, Literal[True]] progId: String[Literal[True]] dvAspect: Set[_OleObjectDvAspect] @@ -109,7 +109,7 @@ class OleObject(Serialisable): ) -> None: ... class OleObjects(Serialisable): - tagname: str + tagname: ClassVar[str] oleObject: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, oleObject=()) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/page.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/page.pyi index 913c47be72a2..06a96e133408 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/page.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/page.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from typing import ClassVar from typing_extensions import Literal, TypeAlias from openpyxl.descriptors.base import Bool, Float, Integer, NoneSet, _ConvertibleToBool, _ConvertibleToFloat, _ConvertibleToInt @@ -10,7 +11,7 @@ _PrintPageSetupCellComments: TypeAlias = Literal["asDisplayed", "atEnd"] _PrintPageSetupErrors: TypeAlias = Literal["displayed", "blank", "dash", "NA"] class PrintPageSetup(Serialisable): - tagname: str + tagname: ClassVar[str] orientation: NoneSet[_PrintPageSetupOrientation] paperSize: Integer[Literal[True]] scale: Integer[Literal[True]] @@ -68,7 +69,7 @@ class PrintPageSetup(Serialisable): def from_tree(cls, node): ... class PrintOptions(Serialisable): - tagname: str + tagname: ClassVar[str] horizontalCentered: Bool[Literal[True]] verticalCentered: Bool[Literal[True]] headings: Bool[Literal[True]] @@ -85,7 +86,7 @@ class PrintOptions(Serialisable): def __bool__(self) -> bool: ... class PageMargins(Serialisable): - tagname: str + tagname: ClassVar[str] left: Float[Literal[False]] right: Float[Literal[False]] top: Float[Literal[False]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/pagebreak.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/pagebreak.pyi index 32f2d2b7e525..d995cabe5cb7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/pagebreak.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/pagebreak.pyi @@ -6,7 +6,7 @@ from openpyxl.descriptors.base import Bool, Integer, _ConvertibleToBool, _Conver from openpyxl.descriptors.serialisable import Serialisable class Break(Serialisable): - tagname: str + tagname: ClassVar[str] id: Integer[Literal[True]] min: Integer[Literal[True]] max: Integer[Literal[True]] @@ -22,7 +22,7 @@ class Break(Serialisable): ) -> None: ... class RowBreak(Serialisable): - tagname: str + tagname: ClassVar[str] # Overwritten by properties below # count: Integer # manualBreakCount: Integer @@ -41,7 +41,7 @@ class RowBreak(Serialisable): PageBreak = RowBreak class ColBreak(RowBreak): - tagname: str + tagname: ClassVar[str] @property def count(self): ... @property diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/picture.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/picture.pyi index 71b3f1340621..071947859eab 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/picture.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/picture.pyi @@ -1,4 +1,6 @@ +from typing import ClassVar + from openpyxl.descriptors.serialisable import Serialisable class SheetBackgroundPicture(Serialisable): - tagname: str + tagname: ClassVar[str] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/print_settings.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/print_settings.pyi index 37f39cdfae72..91aeee4361e7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/print_settings.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/print_settings.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete, Unused from re import Pattern from typing import overload -from typing_extensions import Literal, Self +from typing_extensions import Final, Literal, Self from openpyxl.descriptors import Integer, Strict, String from openpyxl.descriptors.base import Typed, _ConvertibleToInt @@ -9,12 +9,12 @@ from openpyxl.utils.cell import SHEETRANGE_RE as SHEETRANGE_RE from .cell_range import MultiCellRange -COL_RANGE: str -COL_RANGE_RE: Pattern[str] -ROW_RANGE: str -ROW_RANGE_RE: Pattern[str] -TITLES_REGEX: Pattern[str] -PRINT_AREA_RE: Pattern[str] +COL_RANGE: Final[str] +COL_RANGE_RE: Final[Pattern[str]] +ROW_RANGE: Final[str] +ROW_RANGE_RE: Final[Pattern[str]] +TITLES_REGEX: Final[Pattern[str]] +PRINT_AREA_RE: Final[Pattern[str]] class ColRange(Strict): min_col: String[Literal[False]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/properties.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/properties.pyi index 0c910c98ff37..dcc4fdef2b25 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/properties.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/properties.pyi @@ -6,7 +6,7 @@ from openpyxl.descriptors.base import Bool, String, Typed, _ConvertibleToBool from openpyxl.descriptors.serialisable import Serialisable class Outline(Serialisable): - tagname: str + tagname: ClassVar[str] applyStyles: Bool[Literal[True]] summaryBelow: Bool[Literal[True]] summaryRight: Bool[Literal[True]] @@ -20,13 +20,13 @@ class Outline(Serialisable): ) -> None: ... class PageSetupProperties(Serialisable): - tagname: str + tagname: ClassVar[str] autoPageBreaks: Bool[Literal[True]] fitToPage: Bool[Literal[True]] def __init__(self, autoPageBreaks: _ConvertibleToBool | None = None, fitToPage: _ConvertibleToBool | None = None) -> None: ... class WorksheetProperties(Serialisable): - tagname: str + tagname: ClassVar[str] codeName: String[Literal[True]] enableFormatConditionsCalculation: Bool[Literal[True]] filterMode: Bool[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/protection.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/protection.pyi index fa1e290043c2..90ddad654bc3 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/protection.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/protection.pyi @@ -13,7 +13,7 @@ class _Protected: def password(self, value) -> None: ... class SheetProtection(Serialisable, _Protected): - tagname: str + tagname: ClassVar[str] sheet: Bool[Literal[False]] enabled: Alias objects: Bool[Literal[False]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/scenario.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/scenario.pyi index 67ed74af75de..cb5c04e46bd5 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/scenario.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/scenario.pyi @@ -15,7 +15,7 @@ from openpyxl.descriptors.serialisable import Serialisable from openpyxl.worksheet.cell_range import MultiCellRange class InputCells(Serialisable): - tagname: str + tagname: ClassVar[str] r: String[Literal[False]] deleted: Bool[Literal[True]] undone: Bool[Literal[True]] @@ -43,7 +43,7 @@ class InputCells(Serialisable): ) -> None: ... class Scenario(Serialisable): - tagname: str + tagname: ClassVar[str] inputCells: Incomplete name: String[Literal[False]] locked: Bool[Literal[True]] @@ -79,7 +79,7 @@ class Scenario(Serialisable): def count(self): ... class ScenarioList(Serialisable): - tagname: str + tagname: ClassVar[str] scenario: Incomplete current: Integer[Literal[True]] show: Integer[Literal[True]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/smart_tag.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/smart_tag.pyi index f99140e1105b..14c20d35a9d1 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/smart_tag.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/smart_tag.pyi @@ -6,13 +6,13 @@ from openpyxl.descriptors.base import Bool, Integer, String, _ConvertibleToBool, from openpyxl.descriptors.serialisable import Serialisable class CellSmartTagPr(Serialisable): - tagname: str + tagname: ClassVar[str] key: String[Literal[False]] val: String[Literal[False]] def __init__(self, key: str, val: str) -> None: ... class CellSmartTag(Serialisable): - tagname: str + tagname: ClassVar[str] cellSmartTagPr: Incomplete type: Integer[Literal[False]] deleted: Bool[Literal[True]] @@ -37,14 +37,14 @@ class CellSmartTag(Serialisable): ) -> None: ... class CellSmartTags(Serialisable): - tagname: str + tagname: ClassVar[str] cellSmartTag: Incomplete r: String[Literal[False]] __elements__: ClassVar[tuple[str, ...]] def __init__(self, cellSmartTag, r: str) -> None: ... class SmartTags(Serialisable): - tagname: str + tagname: ClassVar[str] cellSmartTags: Incomplete __elements__: ClassVar[tuple[str, ...]] def __init__(self, cellSmartTags=()) -> None: ... diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/table.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/table.pyi index ac50fe04deb8..8b48b4a02215 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/table.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/table.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete, Unused from typing import ClassVar, overload -from typing_extensions import Literal, TypeAlias +from typing_extensions import Final, Literal, TypeAlias from openpyxl.descriptors import Strict, String from openpyxl.descriptors.base import Alias, Bool, Integer, NoneSet, Typed, _ConvertibleToBool, _ConvertibleToInt @@ -13,11 +13,11 @@ _TableColumnTotalsRowFunction: TypeAlias = Literal[ ] _TableTableType: TypeAlias = Literal["worksheet", "xml", "queryTable"] -TABLESTYLES: Incomplete -PIVOTSTYLES: Incomplete +TABLESTYLES: Final[tuple[str, ...]] +PIVOTSTYLES: Final[tuple[str, ...]] class TableStyleInfo(Serialisable): - tagname: str + tagname: ClassVar[str] name: String[Literal[True]] showFirstColumn: Bool[Literal[True]] showLastColumn: Bool[Literal[True]] @@ -33,7 +33,7 @@ class TableStyleInfo(Serialisable): ) -> None: ... class XMLColumnProps(Serialisable): - tagname: str + tagname: ClassVar[str] mapId: Integer[Literal[False]] xpath: String[Literal[False]] denormalized: Bool[Literal[True]] @@ -61,14 +61,14 @@ class XMLColumnProps(Serialisable): ) -> None: ... class TableFormula(Serialisable): - tagname: str + tagname: ClassVar[str] array: Bool[Literal[True]] attr_text: Incomplete text: Alias def __init__(self, array: _ConvertibleToBool | None = None, attr_text: Incomplete | None = None) -> None: ... class TableColumn(Serialisable): - tagname: str + tagname: ClassVar[str] id: Integer[Literal[False]] uniqueName: String[Literal[True]] name: String[Literal[False]] @@ -136,7 +136,7 @@ class TableNameDescriptor(String[Incomplete]): class Table(Serialisable): mime_type: str - tagname: str + tagname: ClassVar[str] id: Integer[Literal[False]] name: String[Literal[True]] displayName: Incomplete @@ -202,7 +202,7 @@ class Table(Serialisable): def column_names(self): ... class TablePartList(Serialisable): - tagname: str + tagname: ClassVar[str] # Overwritten by property below # count: Integer tablePart: Incomplete diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/views.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/views.pyi index 51c208c36a07..626415f3c73f 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/views.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/views.pyi @@ -50,7 +50,7 @@ class Selection(Serialisable): ) -> None: ... class SheetView(Serialisable): - tagname: str + tagname: ClassVar[str] windowProtection: Bool[Literal[True]] showFormulas: Bool[Literal[True]] showGridLines: Bool[Literal[True]] @@ -100,7 +100,7 @@ class SheetView(Serialisable): ) -> None: ... class SheetViewList(Serialisable): - tagname: str + tagname: ClassVar[str] sheetView: Incomplete extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi index 97e75b9eceb4..d59e9c424cd0 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/worksheet/worksheet.pyi @@ -23,25 +23,28 @@ from openpyxl.worksheet.views import SheetView, SheetViewList class Worksheet(_WorkbookChild): mime_type: str - BREAK_NONE: int - BREAK_ROW: int - BREAK_COLUMN: int + BREAK_NONE: Final = 0 + BREAK_ROW: Final = 1 + BREAK_COLUMN: Final = 2 + SHEETSTATE_VISIBLE: Final = "visible" SHEETSTATE_HIDDEN: Final = "hidden" SHEETSTATE_VERYHIDDEN: Final = "veryHidden" - PAPERSIZE_LETTER: str - PAPERSIZE_LETTER_SMALL: str - PAPERSIZE_TABLOID: str - PAPERSIZE_LEDGER: str - PAPERSIZE_LEGAL: str - PAPERSIZE_STATEMENT: str - PAPERSIZE_EXECUTIVE: str - PAPERSIZE_A3: str - PAPERSIZE_A4: str - PAPERSIZE_A4_SMALL: str - PAPERSIZE_A5: str - ORIENTATION_PORTRAIT: str - ORIENTATION_LANDSCAPE: str + + PAPERSIZE_LETTER: Final = "1" + PAPERSIZE_LETTER_SMALL: Final = "2" + PAPERSIZE_TABLOID: Final = "3" + PAPERSIZE_LEDGER: Final = "4" + PAPERSIZE_LEGAL: Final = "5" + PAPERSIZE_STATEMENT: Final = "6" + PAPERSIZE_EXECUTIVE: Final = "7" + PAPERSIZE_A3: Final = "8" + PAPERSIZE_A4: Final = "9" + PAPERSIZE_A4_SMALL: Final = "10" + PAPERSIZE_A5: Final = "11" + + ORIENTATION_PORTRAIT: Final = "portrait" + ORIENTATION_LANDSCAPE: Final = "landscape" row_dimensions: DimensionHolder[RowDimension] column_dimensions: DimensionHolder[ColumnDimension] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/__init__.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/__init__.pyi index 9c4670087b94..517f09dd441a 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/__init__.pyi @@ -1,11 +1,11 @@ -from _typeshed import Incomplete +from typing_extensions import Final def lxml_available(): ... def lxml_env_set(): ... -LXML: Incomplete +LXML: Final[bool] def defusedxml_available(): ... def defusedxml_env_set(): ... -DEFUSEDXML: Incomplete +DEFUSEDXML: Final[bool] diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/constants.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/constants.pyi index 63217f413253..0903b9c24f93 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/constants.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/constants.pyi @@ -1,74 +1,91 @@ -from _typeshed import Incomplete +from typing_extensions import Final -MIN_ROW: int -MIN_COLUMN: int -MAX_COLUMN: int -MAX_ROW: int -PACKAGE_PROPS: str -PACKAGE_XL: str -PACKAGE_RELS: str -PACKAGE_THEME: Incomplete -PACKAGE_WORKSHEETS: Incomplete -PACKAGE_CHARTSHEETS: Incomplete -PACKAGE_DRAWINGS: Incomplete -PACKAGE_CHARTS: Incomplete -PACKAGE_IMAGES: Incomplete -PACKAGE_WORKSHEET_RELS: Incomplete -PACKAGE_CHARTSHEETS_RELS: Incomplete -PACKAGE_PIVOT_TABLE: Incomplete -PACKAGE_PIVOT_CACHE: Incomplete -ARC_CONTENT_TYPES: str -ARC_ROOT_RELS: Incomplete -ARC_WORKBOOK_RELS: Incomplete -ARC_CORE: Incomplete -ARC_APP: Incomplete -ARC_WORKBOOK: Incomplete -ARC_STYLE: Incomplete -ARC_THEME: Incomplete -ARC_SHARED_STRINGS: Incomplete -ARC_CUSTOM_UI: str -XML_NS: str -DCORE_NS: str -DCTERMS_NS: str -DCTERMS_PREFIX: str -DOC_NS: str -REL_NS: Incomplete -COMMENTS_NS: Incomplete -IMAGE_NS: Incomplete -VML_NS: Incomplete -VTYPES_NS: Incomplete -XPROPS_NS: Incomplete -EXTERNAL_LINK_NS: Incomplete -PKG_NS: str -PKG_REL_NS: Incomplete -COREPROPS_NS: Incomplete -CONTYPES_NS: Incomplete -XSI_NS: str -SHEET_MAIN_NS: str -CHART_NS: str -DRAWING_NS: str -SHEET_DRAWING_NS: str -CHART_DRAWING_NS: str -CUSTOMUI_NS: str -NAMESPACES: Incomplete -WORKBOOK_MACRO: str -WORKBOOK: str -SPREADSHEET: str -SHARED_STRINGS: Incomplete -EXTERNAL_LINK: Incomplete -WORKSHEET_TYPE: Incomplete -COMMENTS_TYPE: Incomplete -STYLES_TYPE: Incomplete -CHARTSHEET_TYPE: Incomplete -DRAWING_TYPE: str -CHART_TYPE: str -CHARTSHAPE_TYPE: str -THEME_TYPE: str -XLTM: Incomplete -XLSM: Incomplete -XLTX: Incomplete -XLSX: Incomplete -EXT_TYPES: Incomplete -CTRL: str -ACTIVEX: str -VBA: str +MIN_ROW: Final = 0 +MIN_COLUMN: Final = 0 +MAX_COLUMN: Final = 16384 +MAX_ROW: Final = 1048576 + +PACKAGE_PROPS: Final = "docProps" +PACKAGE_XL: Final = "xl" +PACKAGE_RELS: Final = "_rels" +PACKAGE_THEME: Final = "xl/theme" +PACKAGE_WORKSHEETS: Final = "xl/worksheets" +PACKAGE_CHARTSHEETS: Final = "xl/chartsheets" +PACKAGE_DRAWINGS: Final = "xl/drawings" +PACKAGE_CHARTS: Final = "xl/charts" +PACKAGE_IMAGES: Final = "xl/media" +PACKAGE_WORKSHEET_RELS: Final = "xl/worksheets/_rels" +PACKAGE_CHARTSHEETS_RELS: Final = "xl/chartsheets/_rels" +PACKAGE_PIVOT_TABLE: Final = "xl/pivotTables" +PACKAGE_PIVOT_CACHE: Final = "xl/pivotCache" + +ARC_CONTENT_TYPES: Final = "[Content_Types].xml" +ARC_ROOT_RELS: Final = "_rels/.rels" +ARC_WORKBOOK_RELS: Final = "xl/_rels/workbook.xml.rels" +ARC_CORE: Final = "docProps/core.xml" +ARC_APP: Final = "docProps/app.xml" +ARC_CUSTOM: Final = "docProps/custom.xml" +ARC_WORKBOOK: Final = "xl/workbook.xml" +ARC_STYLE: Final = "xl/styles.xml" +ARC_THEME: Final = "xl/theme/theme1.xml" +ARC_SHARED_STRINGS: Final = "xl/sharedStrings.xml" +ARC_CUSTOM_UI: Final = "customUI/customUI.xml" + +DCORE_NS: Final = "http://purl.org/dc/elements/1.1/" +DCTERMS_NS: Final = "http://purl.org/dc/terms/" +DCTERMS_PREFIX: Final = "dcterms" + +DOC_NS: Final[str] +REL_NS: Final[str] +COMMENTS_NS: Final[str] +IMAGE_NS: Final[str] +VML_NS: Final[str] +VTYPES_NS: Final[str] +XPROPS_NS: Final[str] +CUSTPROPS_NS: Final[str] +EXTERNAL_LINK_NS: Final[str] + +CPROPS_FMTID: Final = "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" + +PKG_NS: Final = "http://schemas.openxmlformats.org/package/2006/" +PKG_REL_NS: Final[str] +COREPROPS_NS: Final[str] +CONTYPES_NS: Final[str] + +XSI_NS: Final = "http://www.w3.org/2001/XMLSchema-instance" +XML_NS: Final = "http://www.w3.org/XML/1998/namespace" +SHEET_MAIN_NS: Final[str] + +CHART_NS: Final[str] +DRAWING_NS: Final[str] +SHEET_DRAWING_NS: Final[str] +CHART_DRAWING_NS: Final[str] + +CUSTOMUI_NS: Final[str] + +NAMESPACES: Final[dict[str, str]] + +WORKBOOK_MACRO: Final = "application/vnd.ms-excel.%s.macroEnabled.main+xml" +WORKBOOK: Final[str] +SPREADSHEET: Final[str] +SHARED_STRINGS: Final[str] +EXTERNAL_LINK: Final[str] +WORKSHEET_TYPE: Final[str] +COMMENTS_TYPE: Final[str] +STYLES_TYPE: Final[str] +CHARTSHEET_TYPE: Final[str] +DRAWING_TYPE: Final[str] +CHART_TYPE: Final[str] +CHARTSHAPE_TYPE: Final[str] +THEME_TYPE: Final[str] +CPROPS_TYPE: Final[str] +XLTM: Final[str] +XLSM: Final[str] +XLTX: Final[str] +XLSX: Final[str] + +EXT_TYPES: Final[dict[str, str]] + +CTRL: Final = "application/vnd.ms-excel.controlproperties+xml" +ACTIVEX: Final = "application/vnd.ms-office.activeX+xml" +VBA: Final = "application/vnd.ms-office.vbaProject" diff --git a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/functions.pyi b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/functions.pyi index c9438a9e7a9f..6abacd8afe30 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/functions.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/openpyxl/openpyxl/xml/functions.pyi @@ -1,7 +1,8 @@ -from _typeshed import Incomplete +from re import Pattern +from typing_extensions import Final from xml.etree.ElementTree import Element as Element # possibly also imported from lxml -NS_REGEX: Incomplete +NS_REGEX: Final[Pattern[str]] def localname(node): ... def whitespace(node) -> 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 ba4d3b51047d..f989270ad5f7 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/__init__.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/__init__.pyi @@ -133,6 +133,13 @@ else: def sensors_battery(): ... +if sys.platform == "linux": + from ._pslinux import pio +elif sys.platform == "win32": + from ._pswindows import pio +else: + from ._common import pio + AF_LINK: int version_info: tuple[int, int, int] __version__: str @@ -184,7 +191,7 @@ class Process: def terminal(self) -> str: ... def num_fds(self) -> int: ... if sys.platform != "darwin": - def io_counters(self): ... + def io_counters(self) -> pio: ... def ionice(self, ioclass: int | None = None, value: int | None = None) -> pionice: ... def cpu_affinity(self, cpus: list[int] | None = None) -> list[int] | None: ... def memory_maps(self, grouped: bool = True): ... 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 ef3a03851bb4..fe5a54139577 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_psbsd.pyi @@ -12,6 +12,7 @@ from psutil._common import ( conn_tmap as conn_tmap, conn_to_ntuple as conn_to_ntuple, memoize as memoize, + pio, usage_percent as usage_percent, ) @@ -140,7 +141,7 @@ class Process: def nice_get(self): ... def nice_set(self, value): ... def status(self): ... - def io_counters(self): ... + def io_counters(self) -> pio: ... def cwd(self): ... class nt_mmap_grouped(NamedTuple): 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 b6502d083d41..dacd14206953 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pslinux.pyi @@ -199,7 +199,7 @@ class Process: def cmdline(self): ... def environ(self): ... def terminal(self): ... - def io_counters(self): ... + def io_counters(self) -> pio: ... def cpu_times(self): ... def cpu_num(self): ... def wait(self, timeout: Incomplete | None = ...): ... 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 7fc653304c75..da4b7f78f845 100644 --- a/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi +++ b/packages/pyright-internal/typeshed-fallback/stubs/psutil/psutil/_pswindows.pyi @@ -193,7 +193,7 @@ class Process: def nice_set(self, value): ... def ionice_get(self): ... def ionice_set(self, ioclass, value) -> None: ... - def io_counters(self): ... + def io_counters(self) -> pio: ... def status(self): ... def cpu_affinity_get(self): ... def cpu_affinity_set(self, value): ...