diff --git a/stubs/tqdm/@tests/stubtest_allowlist.txt b/stubs/tqdm/@tests/stubtest_allowlist.txt index 5405b8923..b142ecf1f 100644 --- a/stubs/tqdm/@tests/stubtest_allowlist.txt +++ b/stubs/tqdm/@tests/stubtest_allowlist.txt @@ -1,5 +1,4 @@ +# Cannot import in stubtest +tqdm.__main__ +# disco-py fails to install through pip and is an archived project tqdm.contrib.discord - -# Metaclass differs: -tqdm.rich.FractionColumn -tqdm.rich.RateColumn diff --git a/stubs/tqdm/METADATA.toml b/stubs/tqdm/METADATA.toml index 8b856db6e..c9febe7ea 100644 --- a/stubs/tqdm/METADATA.toml +++ b/stubs/tqdm/METADATA.toml @@ -1,4 +1,5 @@ version = "4.64.*" [tool.stubtest] +ignore_missing_stub = false extras = ["slack", "telegram"] diff --git a/stubs/tqdm/tqdm/rich.pyi b/stubs/tqdm/tqdm/rich.pyi index c06c63eeb..2a81cc21f 100644 --- a/stubs/tqdm/tqdm/rich.pyi +++ b/stubs/tqdm/tqdm/rich.pyi @@ -1,13 +1,20 @@ from _typeshed import Incomplete, SupportsWrite +from abc import ABC, abstractmethod from collections.abc import Iterable, Mapping -from typing import Any, Generic, NoReturn, TypeVar, overload -from typing_extensions import TypeAlias +from typing import Generic, NoReturn, TypeVar, overload from .std import tqdm as std_tqdm __all__ = ["tqdm_rich", "trrange", "tqdm", "trange"] -_ProgressColumn: TypeAlias = Any # Actually rich.progress.ProgressColumn +# Actually rich.progress.ProgressColumn +class _ProgressColumn(ABC): + max_refresh: float | None + def __init__(self, table_column: Incomplete | None = ...) -> None: ... + def get_table_column(self) -> Incomplete: ... + def __call__(self, task: Incomplete) -> Incomplete: ... + @abstractmethod + def render(self, task: Incomplete) -> Incomplete: ... class FractionColumn(_ProgressColumn): unit_scale: bool