diff --git a/stubs/tqdm/@tests/stubtest_allowlist.txt b/stubs/tqdm/@tests/stubtest_allowlist.txt index 6eb696d3f060..8887707780b2 100644 --- a/stubs/tqdm/@tests/stubtest_allowlist.txt +++ b/stubs/tqdm/@tests/stubtest_allowlist.txt @@ -1,10 +1,6 @@ # Cannot import in stubtest tqdm.__main__ -# TODO: Reenable when tensorflow supports Python 3.13 and is added to the -# stubtest dependencies in METADATA.toml. -tqdm.keras - # Fails to import as of v4.68.0 since it attempts to re-export functions that were # removed from 'tqdm.utils' (e.g. _screen_shape_linux). tqdm._utils diff --git a/stubs/tqdm/METADATA.toml b/stubs/tqdm/METADATA.toml index 34b93715c101..8b46cd5d48e9 100644 --- a/stubs/tqdm/METADATA.toml +++ b/stubs/tqdm/METADATA.toml @@ -1,10 +1,7 @@ version = "4.69.*" upstream-repository = "https://github.com/tqdm/tqdm" -optional-dependencies = ["types-requests"] +optional-dependencies = ["types-requests", "types-tensorflow"] [tool.stubtest] extras = ["slack", "telegram"] -# Add `"tensorflow"` to this list when there's a tensorflow release supporting -# Python 3.13: https://github.com/tensorflow/tensorflow/issues/78774. -# Also remove tqdm.keras from @tests/stubtest_allowlist.txt. -stubtest-dependencies = ["dask", "pandas", "rich"] +stubtest-dependencies = ["dask", "pandas", "rich", "tensorflow"] diff --git a/stubs/tqdm/tqdm/keras.pyi b/stubs/tqdm/tqdm/keras.pyi index 7548952fb794..b23ef91c7c95 100644 --- a/stubs/tqdm/tqdm/keras.pyi +++ b/stubs/tqdm/tqdm/keras.pyi @@ -1,33 +1,10 @@ from _typeshed import Incomplete -__all__ = ["TqdmCallback"] +from tensorflow import keras -# keras.callbacks.Callback -class _Callback: - validation_data: Incomplete | None - model: Incomplete | None - params: Incomplete - def __init__(self) -> None: ... - def set_params(self, params) -> None: ... - def set_model(self, model) -> None: ... - def on_batch_begin(self, batch, logs: Incomplete | None = ...) -> None: ... - def on_batch_end(self, batch, logs: Incomplete | None = ...) -> None: ... - def on_epoch_begin(self, epoch, logs: Incomplete | None = ...) -> None: ... - def on_epoch_end(self, epoch, logs: Incomplete | None = ...) -> None: ... - def on_train_batch_begin(self, batch, logs: Incomplete | None = ...) -> None: ... - def on_train_batch_end(self, batch, logs: Incomplete | None = ...) -> None: ... - def on_test_batch_begin(self, batch, logs: Incomplete | None = ...) -> None: ... - def on_test_batch_end(self, batch, logs: Incomplete | None = ...) -> None: ... - def on_predict_batch_begin(self, batch, logs: Incomplete | None = ...) -> None: ... - def on_predict_batch_end(self, batch, logs: Incomplete | None = ...) -> None: ... - def on_train_begin(self, logs: Incomplete | None = ...) -> None: ... - def on_train_end(self, logs: Incomplete | None = ...) -> None: ... - def on_test_begin(self, logs: Incomplete | None = ...) -> None: ... - def on_test_end(self, logs: Incomplete | None = ...) -> None: ... - def on_predict_begin(self, logs: Incomplete | None = ...) -> None: ... - def on_predict_end(self, logs: Incomplete | None = ...) -> None: ... +__all__ = ["TqdmCallback"] -class TqdmCallback(_Callback): +class TqdmCallback(keras.callbacks.Callback): @staticmethod def bar2callback(bar, pop=None, delta=...): ... tqdm_class: Incomplete