From 8fb3d91f561e2a286a7fda13291eda16613dac39 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sat, 3 Sep 2022 10:09:37 +0100 Subject: [PATCH 1/2] fix ipywidgets>=8 display --- tests_notebook.ipynb | 11 +++++++---- tqdm/notebook.py | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests_notebook.ipynb b/tests_notebook.ipynb index fb8227d7d..1eec5cae6 100644 --- a/tests_notebook.ipynb +++ b/tests_notebook.ipynb @@ -312,15 +312,18 @@ ], "source": [ "# NBVAL_TEST_NAME: leave\n", - "assert (False, None) != (getattr(t.container, \"visible\", False), getattr(t.container, \"_ipython_display_\", None))\n", + "def is_hidden(widget):\n", + " return ('hidden', False, None) == (\n", + " getattr(getattr(widget, \"layout\", None), \"visibility\", 'visible'), # ipyw>=8\n", + " getattr(widget, \"visible\", False), getattr(widget, \"_ipython_display_\", None)) # ipyw<8\n", + "\n", + "assert not is_hidden(t.container)\n", "for total in (1, 9):\n", " with tqdm(total=total, leave=False) as t:\n", " print(t)\n", " t.update()\n", " print(t)\n", - " assert total != 1 or (False, None) == (\n", - " getattr(t.container, \"visible\", False), getattr(t.container, \"_ipython_display_\", None)\n", - " )" + " assert total != 1 or is_hidden(t.container)" ] }, { diff --git a/tqdm/notebook.py b/tqdm/notebook.py index 3565815ad..ffd094783 100644 --- a/tqdm/notebook.py +++ b/tqdm/notebook.py @@ -192,6 +192,7 @@ def display(self, msg=None, pos=None, self.container.close() except AttributeError: self.container.visible = False + self.container.layout.visibility = 'hidden' # IPYW>=8 if check_delay and self.delay > 0 and not self.displayed: display(self.container) From 754186291e6b4e28ea8b56c9493adc03bf14c404 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sat, 3 Sep 2022 10:55:31 +0100 Subject: [PATCH 2/2] tests: hotfix skip windows errors --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 68f27fa5b..89178eb05 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,7 @@ jobs: test: if: github.event_name != 'pull_request' || github.repository_owner != 'tqdm' name: py${{ matrix.python }}-${{ matrix.os }} + continue-on-error: ${{ matrix.os == 'windows' }} strategy: matrix: os: [ubuntu]