tqdm: Add __all__ to __init__.pyi and submodules (#8308)

Fixes #8307
This commit is contained in:
Alex Waygood
2022-07-15 17:39:45 +01:00
committed by GitHub
parent ed0b3a4412
commit 0764f9f31f
23 changed files with 73 additions and 0 deletions

View File

@@ -15,6 +15,27 @@ from .std import (
tqdm as tqdm,
trange as trange,
)
from .version import __version__ as __version__
__all__ = [
"tqdm",
"tqdm_gui",
"trange",
"tgrange",
"tqdm_pandas",
"tqdm_notebook",
"tnrange",
"main",
"TMonitor",
"TqdmTypeError",
"TqdmKeyError",
"TqdmWarning",
"TqdmDeprecationWarning",
"TqdmExperimentalWarning",
"TqdmMonitorWarning",
"TqdmSynchronisationWarning",
"__version__",
]
def tqdm_notebook(*args, **kwargs) -> tqdm_notebook_cls[Incomplete]: ...
def tnrange(*args, **kwargs) -> tqdm_notebook_cls[int]: ...

View File

@@ -1,6 +1,8 @@
from _typeshed import Incomplete
from threading import Thread
__all__ = ["TMonitor", "TqdmSynchronisationWarning"]
class TqdmSynchronisationWarning(RuntimeWarning): ...
class TMonitor(Thread):

View File

@@ -1 +1,3 @@
__all__ = ["tqdm_pandas"]
def tqdm_pandas(tclass, **tqdm_kwargs) -> None: ...

View File

@@ -4,6 +4,8 @@ from typing import Generic, NoReturn, TypeVar, overload
from .std import tqdm as std_tqdm
__all__ = ["tqdm_asyncio", "tarange", "tqdm", "trange"]
_T = TypeVar("_T")
class tqdm_asyncio(Generic[_T], std_tqdm[_T]):

View File

@@ -1 +1,3 @@
from .asyncio import tqdm as tqdm, trange as trange
__all__ = ["tqdm", "trange"]

View File

@@ -1 +1,3 @@
from .std import tqdm as tqdm, trange as trange
__all__ = ["tqdm", "trange"]

View File

@@ -1,3 +1,5 @@
from collections.abc import Sequence
__all__ = ["main"]
def main(fp=..., argv: Sequence[str] | None = ...) -> None: ...

View File

@@ -3,6 +3,8 @@ from collections.abc import Callable, Generator
from ..utils import ObjectWrapper
__all__ = ["tenumerate", "tzip", "tmap"]
class DummyTqdmFile(ObjectWrapper):
def __init__(self, wrapped) -> None: ...
def write(self, x, nolock: bool = ...) -> None: ...

View File

@@ -1 +1,3 @@
from ..auto import tqdm as tqdm, trange as trange
__all__ = ["tqdm", "trange"]

View File

@@ -1,2 +1,4 @@
__all__ = ["thread_map", "process_map"]
def thread_map(fn, *iterables, **tqdm_kwargs): ...
def process_map(fn, *iterables, **tqdm_kwargs): ...

View File

@@ -5,6 +5,8 @@ from typing import Generic, NoReturn, TypeVar, overload
from ..auto import tqdm as tqdm_auto
from .utils_worker import MonoWorker
__all__ = ["DiscordIO", "tqdm_discord", "tdrange", "tqdm", "trange"]
class DiscordIO(MonoWorker):
text: Incomplete
message: Incomplete

View File

@@ -1,4 +1,6 @@
from _typeshed import Incomplete
from collections.abc import Generator, Iterable
__all__ = ["product"]
def product(*iterables: Iterable[Incomplete], **tqdm_kwargs) -> Generator[Incomplete, None, None]: ...

View File

@@ -5,6 +5,8 @@ from typing import Generic, NoReturn, TypeVar, overload
from ..auto import tqdm as tqdm_auto
from .utils_worker import MonoWorker
__all__ = ["SlackIO", "tqdm_slack", "tsrange", "tqdm", "trange"]
class SlackIO(MonoWorker):
client: Incomplete
text: Incomplete

View File

@@ -5,6 +5,8 @@ from typing import Generic, NoReturn, TypeVar, overload
from ..auto import tqdm as tqdm_auto
from .utils_worker import MonoWorker
__all__ = ["TelegramIO", "tqdm_telegram", "ttgrange", "tqdm", "trange"]
class TelegramIO(MonoWorker):
API: str
token: Incomplete

View File

@@ -5,6 +5,8 @@ from concurrent.futures import Future, ThreadPoolExecutor
from typing import TypeVar
from typing_extensions import ParamSpec
__all__ = ["MonoWorker"]
_P = ParamSpec("_P")
_R = TypeVar("_R")

View File

@@ -2,6 +2,8 @@ from _typeshed import Incomplete
from typing import Any
from typing_extensions import TypeAlias
__all__ = ["TqdmCallback"]
_Callback: TypeAlias = Any # Actually dask.callbacks.Callback
class TqdmCallback(_Callback):

View File

@@ -4,6 +4,8 @@ from typing import Generic, NoReturn, TypeVar, overload
from .std import tqdm as std_tqdm
__all__ = ["tqdm_gui", "tgrange", "tqdm", "trange"]
_T = TypeVar("_T")
class tqdm_gui(Generic[_T], std_tqdm[_T]):

View File

@@ -2,6 +2,8 @@ from _typeshed import Incomplete
from typing import Any
from typing_extensions import TypeAlias
__all__ = ["TqdmCallback"]
_Callback: TypeAlias = Any # Actually tensorflow.keras.callbacks.Callback
class TqdmCallback(_Callback):

View File

@@ -4,6 +4,8 @@ from typing import Generic, NoReturn, TypeVar, overload
from .std import tqdm as std_tqdm, trange as trange
__all__ = ["tqdm_notebook", "tnrange", "tqdm", "trange"]
_T = TypeVar("_T")
class tqdm_notebook(Generic[_T], std_tqdm[_T]):

View File

@@ -5,6 +5,8 @@ from typing_extensions import TypeAlias
from .std import tqdm as std_tqdm
__all__ = ["tqdm_rich", "trrange", "tqdm", "trange"]
_ProgressColumn: TypeAlias = Any # Actually rich.progress.ProgressColumn
class FractionColumn(_ProgressColumn):

View File

@@ -6,6 +6,17 @@ from typing_extensions import Literal
from .utils import Comparable
__all__ = [
"tqdm",
"trange",
"TqdmTypeError",
"TqdmKeyError",
"TqdmWarning",
"TqdmExperimentalWarning",
"TqdmDeprecationWarning",
"TqdmMonitorWarning",
]
class TqdmTypeError(TypeError): ...
class TqdmKeyError(KeyError): ...

View File

@@ -4,6 +4,8 @@ from typing import Generic, NoReturn, TypeVar, overload
from .std import tqdm as std_tqdm
__all__ = ["tqdm_tk", "ttkrange", "tqdm", "trange"]
_T = TypeVar("_T")
class tqdm_tk(Generic[_T], std_tqdm[_T]):

View File

@@ -0,0 +1 @@
__version__: str