From c66458d9ac2ad096937406f79d105af891cee6e7 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Wed, 6 Nov 2024 16:30:22 +0000 Subject: [PATCH 1/5] gui: fix matplotlib --- tqdm/gui.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) 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) From 342b15ed68ae7c5ec1082cadb1b563c7dfde610f Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sat, 9 Nov 2024 15:13:51 +0000 Subject: [PATCH 2/5] tests: sync deps --- .meta/requirements-test.txt | 2 +- environment.yml | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.meta/requirements-test.txt b/.meta/requirements-test.txt index 4fc41b89..5206b9a7 100644 --- a/.meta/requirements-test.txt +++ b/.meta/requirements-test.txt @@ -3,5 +3,5 @@ pytest pytest-asyncio pytest-cov pytest-timeout -nbval +git+https://github.com/casperdcl/nbval.git@master#egg=nbval ipywidgets diff --git a/environment.yml b/environment.yml index a8347fe7..6a174005 100644 --- a/environment.yml +++ b/environment.yml @@ -21,7 +21,6 @@ dependencies: - pytest-cov - pytest-timeout - pytest-asyncio -- nbval - coverage # extras - dask # dask @@ -41,6 +40,7 @@ dependencies: - 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..30c4bce0 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", "nbval"] discord = ["requests"] slack = ["slack-sdk"] telegram = ["requests"] From 6338f6216996918fdc9c9a73bf095acac54ce0bb Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 12 Nov 2024 00:01:41 +0000 Subject: [PATCH 3/5] deps: fix pybuild --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 6a174005..7aa2a4c3 100644 --- a/environment.yml +++ b/environment.yml @@ -34,7 +34,7 @@ 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 From cac7150d7c8a650c7e76004cd7f8643990932c7f Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 12 Nov 2024 00:28:35 +0000 Subject: [PATCH 4/5] tests: bump pytest-asyncio - fixes #1630 --- .meta/requirements-test.txt | 2 +- .pre-commit-config.yaml | 2 +- environment.yml | 2 +- pyproject.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.meta/requirements-test.txt b/.meta/requirements-test.txt index 5206b9a7..9264a2ab 100644 --- a/.meta/requirements-test.txt +++ b/.meta/requirements-test.txt @@ -1,6 +1,6 @@ pre-commit pytest -pytest-asyncio +pytest-asyncio>=0.24 pytest-cov pytest-timeout git+https://github.com/casperdcl/nbval.git@master#egg=nbval 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 7aa2a4c3..89e0406c 100644 --- a/environment.yml +++ b/environment.yml @@ -20,7 +20,7 @@ dependencies: - pytest - pytest-cov - pytest-timeout -- pytest-asyncio +- pytest-asyncio>=0.24 - coverage # extras - dask # dask diff --git a/pyproject.toml b/pyproject.toml index 30c4bce0..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-asyncio", "nbval"] +dev = ["pytest>=6", "pytest-cov", "pytest-timeout", "pytest-asyncio>=0.24", "nbval"] discord = ["requests"] slack = ["slack-sdk"] telegram = ["requests"] From a2d5f1c9d1cbdbcf56f52dc4365ea4124e3e33f7 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 12 Nov 2024 00:35:27 +0000 Subject: [PATCH 5/5] tests: fix codecov rate limit --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) 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' }}