diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef697e5b..1eeb7f90 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -85,6 +85,7 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} finish: name: pytest cov continue-on-error: ${{ github.event_name != 'push' }} diff --git a/.meta/requirements-test.txt b/.meta/requirements-test.txt index 4fc41b89..9264a2ab 100644 --- a/.meta/requirements-test.txt +++ b/.meta/requirements-test.txt @@ -1,7 +1,7 @@ pre-commit pytest -pytest-asyncio +pytest-asyncio>=0.24 pytest-cov pytest-timeout -nbval +git+https://github.com/casperdcl/nbval.git@master#egg=nbval ipywidgets diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0eff5698..01ea5432 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: - numpy - pandas - pytest-timeout - - pytest-asyncio>0.21 + - pytest-asyncio>=0.24 - repo: https://github.com/PyCQA/flake8 rev: 7.1.1 hooks: diff --git a/environment.yml b/environment.yml index a8347fe7..89e0406c 100644 --- a/environment.yml +++ b/environment.yml @@ -20,8 +20,7 @@ dependencies: - pytest - pytest-cov - pytest-timeout -- pytest-asyncio -- nbval +- pytest-asyncio>=0.24 - coverage # extras - dask # dask @@ -35,12 +34,13 @@ dependencies: - rich # rich - argopt # `cd wiki && pymake` - twine # `pymake check pypi` -- build # `python -m build` +- python-build # `python -m build` # `cd docs && pymake` - mkdocs-material - pygments - pymdown-extensions - pip: + - git+https://github.com/casperdcl/nbval.git@master#egg=nbval # tests (native) - py-make >=0.1.0 # `make/pymake` - mkdocs-minify-plugin # `cd docs && pymake` - git+https://github.com/tqdm/jsmin@fix-pip#egg=jsmin # `cd docs && pymake` diff --git a/pyproject.toml b/pyproject.toml index 5651e88e..c31f86a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,7 +84,7 @@ classifiers = [ dependencies = ['colorama; platform_system == "Windows"'] [project.optional-dependencies] -dev = ["pytest>=6", "pytest-cov", "pytest-timeout", "pytest-xdist"] +dev = ["pytest>=6", "pytest-cov", "pytest-timeout", "pytest-asyncio>=0.24", "nbval"] discord = ["requests"] slack = ["slack-sdk"] telegram = ["requests"] diff --git a/tqdm/gui.py b/tqdm/gui.py index 1a806819..cb52fb91 100644 --- a/tqdm/gui.py +++ b/tqdm/gui.py @@ -122,6 +122,7 @@ class tqdm_gui(std_tqdm): # pragma: no cover ax = self.ax line1 = self.line1 line2 = self.line2 + hspan = getattr(self, 'hspan', None) # instantaneous rate y = delta_it / delta_t # overall rate @@ -148,18 +149,10 @@ class tqdm_gui(std_tqdm): # pragma: no cover if total: line1.set_data(xdata, ydata) line2.set_data(xdata, zdata) - try: - poly_lims = self.hspan.get_xy() - except AttributeError: - self.hspan = self.plt.axhspan(0, 0.001, xmin=0, xmax=0, color='g') - poly_lims = self.hspan.get_xy() - poly_lims[0, 1] = ymin - poly_lims[1, 1] = ymax - poly_lims[2] = [n / total, ymax] - poly_lims[3] = [poly_lims[2, 0], ymin] - if len(poly_lims) > 4: - poly_lims[4, 1] = ymin - self.hspan.set_xy(poly_lims) + if hspan: + hspan.set_xy((0, ymin)) + hspan.set_height(ymax - ymin) + hspan.set_width(n / total) else: t_ago = [cur_t - i for i in xdata] line1.set_data(t_ago, ydata)