diff --git a/.meta/.readme.rst b/.meta/.readme.rst index 01a1bf91f..65ffb1818 100644 --- a/.meta/.readme.rst +++ b/.meta/.readme.rst @@ -757,7 +757,7 @@ custom callback take advantage of this, simply use the return value of class TqdmExt(std_tqdm): def update(self, n=1): - displayed = super(TqdmExt, self).update(n): + displayed = super(TqdmExt, self).update(n) if displayed: external_callback(**self.format_dict) return displayed diff --git a/README.rst b/README.rst index 0763e7c86..349837950 100644 --- a/README.rst +++ b/README.rst @@ -976,7 +976,7 @@ custom callback take advantage of this, simply use the return value of class TqdmExt(std_tqdm): def update(self, n=1): - displayed = super(TqdmExt, self).update(n): + displayed = super(TqdmExt, self).update(n) if displayed: external_callback(**self.format_dict) return displayed diff --git a/environment.yml b/environment.yml index cb009ac8f..d4580dc39 100644 --- a/environment.yml +++ b/environment.yml @@ -36,10 +36,10 @@ dependencies: - wheel # `setup.py bdist_wheel` # `cd docs && pymake` - mkdocs-material -- pydoc-markdown >=3.3.0 +- pydoc-markdown >=4.6.0 - pygments - pymdown-extensions - pip: - py-make >=0.1.0 # `setup.py make/pymake` - mkdocs-minify-plugin # `cd docs && pymake` - - git+git://github.com/tqdm/jsmin@python3-only#egg=jsmin # `cd docs && pymake` + - git+https://github.com/tqdm/jsmin@python3-only#egg=jsmin # `cd docs && pymake` diff --git a/tqdm/autonotebook.py b/tqdm/autonotebook.py index 1f2258146..a09f2ec4b 100644 --- a/tqdm/autonotebook.py +++ b/tqdm/autonotebook.py @@ -6,7 +6,6 @@ >>> for i in trange(10): ... ... """ -import os import sys from warnings import warn @@ -14,8 +13,6 @@ get_ipython = sys.modules['IPython'].get_ipython if 'IPKernelApp' not in get_ipython().config: # pragma: no cover raise ImportError("console") - if 'VSCODE_PID' in os.environ: # pragma: no cover - raise ImportError("vscode") from .notebook import WARN_NOIPYW, IProgress if IProgress is None: from .std import TqdmWarning diff --git a/tqdm/rich.py b/tqdm/rich.py index cf8e71432..69893ffdd 100644 --- a/tqdm/rich.py +++ b/tqdm/rich.py @@ -84,12 +84,15 @@ def __init__(self, *args, **kwargs): ---------- progress : tuple, optional arguments for `rich.progress.Progress()`. + options : dict, optional + keyword arguments for `rich.progress.Progress()`. """ kwargs = kwargs.copy() kwargs['gui'] = True # convert disable = None to False kwargs['disable'] = bool(kwargs.get('disable', False)) progress = kwargs.pop('progress', None) + options = kwargs.pop('options', {}).copy() super(tqdm_rich, self).__init__(*args, **kwargs) if self.disable: @@ -108,7 +111,8 @@ def __init__(self, *args, **kwargs): ",", RateColumn(unit=d['unit'], unit_scale=d['unit_scale'], unit_divisor=d['unit_divisor']), "]" ) - self._prog = Progress(*progress, transient=not self.leave) + options.setdefault('transient', not self.leave) + self._prog = Progress(*progress, **options) self._prog.__enter__() self._task_id = self._prog.add_task(self.desc or "", **d) diff --git a/tqdm/std.py b/tqdm/std.py index 9a687391b..5f9dccafe 100644 --- a/tqdm/std.py +++ b/tqdm/std.py @@ -672,7 +672,7 @@ def pandas(cls, **tqdm_kwargs): | groupby.(generic.)SeriesGroupBy ).progress_apply - A new instance will be create every time `progress_apply` is called, + A new instance will be created every time `progress_apply` is called, and each instance will automatically `close()` upon completion. Parameters