From ea7070bfe32f5d89525649d83152f0399afa19b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 27 Sep 2023 13:38:18 +0200 Subject: [PATCH 01/18] Try 3.12 for core test --- .github/workflows/test.yaml | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 553bc72640..43bc34407c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -135,7 +135,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest'] - python-version: ['3.11'] + python-version: ['3.12'] timeout-minutes: 120 defaults: run: @@ -149,7 +149,7 @@ jobs: name: core_test_suite python-version: ${{ matrix.python-version }} channel-priority: strict - channels: pyviz/label/dev,conda-forge,nodefaults + channels: pyviz/label/dev,conda-forge,conda-forge/label/python_rc,nodefaults envs: "-o tests_core" cache: true conda-update: true diff --git a/setup.py b/setup.py index 42347d806a..292e2432e7 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,6 @@ 'bokeh', 'pillow', 'plotly >=4.0', - 'dash >=1.16', 'codecov', 'ipython >=5.4.0', ] @@ -58,6 +57,7 @@ 'selenium', 'spatialpandas', 'datashader >=0.11.1', + 'dash >=1.16', ] extras_require['tests_gpu'] = extras_require['tests'] + [ From d807fd76c2028558424d3f31bf4c570f7e6eb524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 27 Sep 2023 13:43:06 +0200 Subject: [PATCH 02/18] Update install branch --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 43bc34407c..61eb522e67 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -144,7 +144,7 @@ jobs: DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} core tests" PYTHON_VERSION: ${{ matrix.python-version }} steps: - - uses: holoviz-dev/holoviz_tasks/install@v0.1a17 + - uses: holoviz-dev/holoviz_tasks/install@remove_python with: name: core_test_suite python-version: ${{ matrix.python-version }} From eef893119b33d7b6bfb59a27aad7bd66b515ea72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 27 Sep 2023 14:26:51 +0200 Subject: [PATCH 03/18] Remove channel-priority: --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 61eb522e67..dfc8e62c9d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -148,7 +148,7 @@ jobs: with: name: core_test_suite python-version: ${{ matrix.python-version }} - channel-priority: strict + # channel-priority: strict channels: pyviz/label/dev,conda-forge,conda-forge/label/python_rc,nodefaults envs: "-o tests_core" cache: true From c0b656b59e49f189f7f499992dab32dd2be36ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 3 Oct 2023 14:24:03 +0200 Subject: [PATCH 04/18] Remove conda channel --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dfc8e62c9d..3086fcf558 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -149,7 +149,7 @@ jobs: name: core_test_suite python-version: ${{ matrix.python-version }} # channel-priority: strict - channels: pyviz/label/dev,conda-forge,conda-forge/label/python_rc,nodefaults + channels: pyviz/label/dev,conda-forge,nodefaults envs: "-o tests_core" cache: true conda-update: true From 5fc34eaf2367ceea1a063b6d1e70c2d7cfce98b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 11:46:15 +0200 Subject: [PATCH 05/18] Use pip to check for Python 3.12 --- .github/workflows/test.yaml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b5fecbaa6e..9c72d118ec 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -144,25 +144,31 @@ jobs: DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} core tests" PYTHON_VERSION: ${{ matrix.python-version }} steps: - - uses: holoviz-dev/holoviz_tasks/install@remove_python + # Add back when this works on Python 3.12 + # - uses: holoviz-dev/holoviz_tasks/install@v0.1a17 + # with: + # name: core_test_suite + # python-version: ${{ matrix.python-version }} + # # channel-priority: strict + # channels: pyviz/label/dev,conda-forge,nodefaults + # envs: "-o tests_core -o test_ci" + # cache: true + # conda-update: true + - uses: actions/setup-python@v4 with: - name: core_test_suite - python-version: ${{ matrix.python-version }} - # channel-priority: strict - channels: pyviz/label/dev,conda-forge,nodefaults - envs: "-o tests_core -o test_ci" - cache: true - conda-update: true - id: install + python-version: 3.12 + - run: | + python -m pip install 'holoviews["tests_core", "tests_ci"]' - name: bokeh sampledata run: | - conda activate test-environment + # conda activate test-environment bokeh sampledata - name: Check packages latest version run: | - conda activate test-environment + # conda activate test-environment python scripts/check_latest_packages.py - name: doit test_unit run: | - conda activate test-environment + # conda activate test-environment pytest holoviews + python --version From b491e65fcb708c4488d52e6f6a2db0ab6b3bb3c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 11:46:39 +0200 Subject: [PATCH 06/18] tests_ci for consistency --- .github/workflows/test.yaml | 6 +++--- setup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9c72d118ec..b0d45f385e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -63,7 +63,7 @@ jobs: python-version: ${{ matrix.python-version }} channel-priority: strict channels: pyviz/label/dev,conda-forge,nodefaults - envs: "-o flakes -o tests -o examples_tests -o test_ci" + envs: "-o flakes -o tests -o examples_tests -o tests_ci" cache: true conda-update: true id: install @@ -109,7 +109,7 @@ jobs: name: ui_test_suite python-version: ${{ matrix.python-version }} channels: pyviz/label/dev,bokeh,conda-forge,nodefaults - envs: "-o recommended -o tests -o build -o test_ci" + envs: "-o recommended -o tests -o build -o tests_ci" cache: true playwright: true id: install @@ -151,7 +151,7 @@ jobs: # python-version: ${{ matrix.python-version }} # # channel-priority: strict # channels: pyviz/label/dev,conda-forge,nodefaults - # envs: "-o tests_core -o test_ci" + # envs: "-o tests_core -o tests_ci" # cache: true # conda-update: true - uses: actions/setup-python@v4 diff --git a/setup.py b/setup.py index daeac0171d..4b39344984 100644 --- a/setup.py +++ b/setup.py @@ -59,7 +59,7 @@ 'dash >=1.16', ] -extras_require['test_ci'] = [ +extras_require['tests_ci'] = [ 'codecov', "pytest-github-actions-annotate-failures", ] From f2d212574ac491b9a39c5094bf7172a1e8301122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 11:49:22 +0200 Subject: [PATCH 07/18] Update install --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b0d45f385e..f41fcef25f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -158,7 +158,7 @@ jobs: with: python-version: 3.12 - run: | - python -m pip install 'holoviews["tests_core", "tests_ci"]' + python -m pip install '.["tests_core", "tests_ci"]' - name: bokeh sampledata run: | # conda activate test-environment From b85bdb5856e994cbe808bbeabdbbaa00a7b0fe49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 11:51:29 +0200 Subject: [PATCH 08/18] Add checkout --- .github/workflows/test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f41fcef25f..9318ad05a2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -154,6 +154,9 @@ jobs: # envs: "-o tests_core -o tests_ci" # cache: true # conda-update: true + - uses: actions/checkout@v3 + with: + fetch-depth: "100" - uses: actions/setup-python@v4 with: python-version: 3.12 From 2f6392c2a4f4a9e97a4f37fa1dcaa2ce18f977c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 11:54:16 +0200 Subject: [PATCH 09/18] Debug --- .github/workflows/test.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9318ad05a2..ed22fb678e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -157,11 +157,13 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: "100" + - name: Fetch unshallow + run: git fetch --prune --tags --unshallow -f - uses: actions/setup-python@v4 with: python-version: 3.12 - run: | - python -m pip install '.["tests_core", "tests_ci"]' + python -m pip install -ve '.[tests_core, tests_ci]' - name: bokeh sampledata run: | # conda activate test-environment @@ -174,4 +176,3 @@ jobs: run: | # conda activate test-environment pytest holoviews - python --version From 0b11813df7589398777bbae0dd3e3c76763aa31e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 12:19:06 +0200 Subject: [PATCH 10/18] Set mpl backend in conftest --- .github/workflows/test.yaml | 1 - holoviews/tests/conftest.py | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ed22fb678e..0c13a1ab31 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -18,7 +18,6 @@ env: SETUPTOOLS_ENABLE_FEATURES: "legacy-editable" DISPLAY: ":99.0" PYTHONIOENCODING: "utf-8" - MPLBACKEND: "Agg" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OMP_NUM_THREADS: 1 OPENBLAS_NUM_THREADS: 1 diff --git a/holoviews/tests/conftest.py b/holoviews/tests/conftest.py index 91b706a8cc..5cf5dfa645 100644 --- a/holoviews/tests/conftest.py +++ b/holoviews/tests/conftest.py @@ -1,3 +1,5 @@ +import contextlib + import pytest from panel.tests.conftest import server_cleanup, port, pytest_addoption, pytest_configure, optional_markers # noqa @@ -21,13 +23,16 @@ def pytest_collection_modifyitems(config, items): items[:] = selected -try: +with contextlib.suppress(ImportError): + import matplotlib as mpl + mpl.use('agg') + + +with contextlib.suppress(Exception): # From Dask 2023.7,1 they now automatic convert strings # https://docs.dask.org/en/stable/changelog.html#v2023-7-1 import dask dask.config.set({"dataframe.convert-string": False}) -except Exception: - pass @pytest.fixture From f1f8f966b92c42da41c873125114fb0d1feb6764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 12:40:40 +0200 Subject: [PATCH 11/18] Check for different heights --- holoviews/tests/plotting/matplotlib/test_renderer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/holoviews/tests/plotting/matplotlib/test_renderer.py b/holoviews/tests/plotting/matplotlib/test_renderer.py index 3ff266fc30..6017050914 100644 --- a/holoviews/tests/plotting/matplotlib/test_renderer.py +++ b/holoviews/tests/plotting/matplotlib/test_renderer.py @@ -56,13 +56,15 @@ def test_get_size_row_plot(self): with style.context("default"): plot = self.renderer.get_plot(self.image1 + self.image2) w, h = self.renderer.get_size(plot) - self.assertEqual((w, h), (576, 257)) + # Depending on the backend the height may be slightly different + assert (w, h) == (576, 257) or (w, h) == (576, 259) def test_get_size_column_plot(self): with style.context("default"): plot = self.renderer.get_plot((self.image1 + self.image2).cols(1)) w, h = self.renderer.get_size(plot) - self.assertEqual((w, h), (288, 509)) + # Depending on the backend the height may be slightly different + assert (w, h) == (288, 509) or (w, h) == (288, 511) def test_get_size_grid_plot(self): grid = GridSpace({(i, j): self.image1 for i in range(3) for j in range(3)}) From c99f07225f4fb913c3f4f58ec705e8abc04ad3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 12:45:41 +0200 Subject: [PATCH 12/18] Fix bitwise inversion '~' on bool deprecation warning --- holoviews/core/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/holoviews/core/util.py b/holoviews/core/util.py index cec51772db..6ec166a2ed 100644 --- a/holoviews/core/util.py +++ b/holoviews/core/util.py @@ -929,7 +929,10 @@ def isfinite(val): if pandas_version >= Version('1.0.0'): if finite is pd.NA: return False - return finite & (~pd.isna(val)) + if np.isscalar(val): + return finite and not pd.isna(val) + else: + return finite & ~pd.isna(val) return finite From e245aac3bd69893859060b3911cf4dff651ef7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 12:49:06 +0200 Subject: [PATCH 13/18] Ignore warnings outside our control --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index a375abd9b4..331ce9d97f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,9 @@ filterwarnings = [ "ignore:Deprecated call to `pkg_resources.+?'sphinxcontrib:DeprecationWarning", # 2023-09: See https://github.com/python-streamz/streamz/issues/460 "ignore: pkg_resources is deprecated as an API:DeprecationWarning:streamz.plugins", + # 2023-10: datetime.utctimestamp() is deprecated in Python 3.12 + "ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning:dateutil.tz.tz", + "ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning:bokeh.util.serialization", ] [tool.coverage] From 827b6f16fc672175fc8eac9d512a679f665daa12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 12:51:00 +0200 Subject: [PATCH 14/18] Add Python 3.12 in setup.py and tox.ini --- setup.py | 1 + tox.ini | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4b39344984..f41ae66d7b 100644 --- a/setup.py +++ b/setup.py @@ -184,6 +184,7 @@ def get_setup_version(reponame): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Intended Audience :: Science/Research", "Intended Audience :: Developers", diff --git a/tox.ini b/tox.ini index 1e1fde0f65..d1d7da90c7 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ [tox] # python version test group extra envs extra commands -envlist = {py38,py39,py310,py311}-{unit,ui,examples,all_recommended,simple}-{default}-{dev,pkg} +envlist = {py38,py39,py310,py311,py312}-{unit,ui,examples,all_recommended,simple}-{default}-{dev,pkg} [_simple] description = Install holoviews without any optional dependencies From 8ffe34e1455cef515867f77a90cf5a2e2a8fd355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 13:44:06 +0200 Subject: [PATCH 15/18] Handle pd.isna(None) and pd.isna((None, None)) --- holoviews/core/util.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/holoviews/core/util.py b/holoviews/core/util.py index 6ec166a2ed..a96e91dc2c 100644 --- a/holoviews/core/util.py +++ b/holoviews/core/util.py @@ -929,10 +929,7 @@ def isfinite(val): if pandas_version >= Version('1.0.0'): if finite is pd.NA: return False - if np.isscalar(val): - return finite and not pd.isna(val) - else: - return finite & ~pd.isna(val) + return finite & ~pd.isna(np.asarray(val)) return finite From 3355020d9ec527a5a5ac847a3f68687e2a813f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 13:44:28 +0200 Subject: [PATCH 16/18] Ignore all bokeh utc warnings --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 331ce9d97f..92f4f806f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ filterwarnings = [ "ignore: pkg_resources is deprecated as an API:DeprecationWarning:streamz.plugins", # 2023-10: datetime.utctimestamp() is deprecated in Python 3.12 "ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning:dateutil.tz.tz", - "ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning:bokeh.util.serialization", + "ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning:bokeh", # https://github.com/bokeh/bokeh/issues/13125 ] [tool.coverage] From 883f1cb90164354ac2b6c04ffdd1c96f884a7bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 14:36:33 +0200 Subject: [PATCH 17/18] Remove utcnow too --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 92f4f806f5..b00904c9a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,7 @@ filterwarnings = [ # 2023-10: datetime.utctimestamp() is deprecated in Python 3.12 "ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning:dateutil.tz.tz", "ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning:bokeh", # https://github.com/bokeh/bokeh/issues/13125 + "ignore:datetime.datetime.utcnow():DeprecationWarning:bokeh", # https://github.com/bokeh/bokeh/issues/13125 ] [tool.coverage] From 6098813633ecd4701ff399107b0d444201c817a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 10 Oct 2023 15:19:39 +0200 Subject: [PATCH 18/18] Add back deleted line [skip ci] --- .github/workflows/test.yaml | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0c13a1ab31..32e4531ba2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -153,6 +153,7 @@ jobs: # envs: "-o tests_core -o tests_ci" # cache: true # conda-update: true + # id: install - uses: actions/checkout@v3 with: fetch-depth: "100" diff --git a/pyproject.toml b/pyproject.toml index b00904c9a3..d1840d8561 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ filterwarnings = [ "ignore:Deprecated call to `pkg_resources.+?'sphinxcontrib:DeprecationWarning", # 2023-09: See https://github.com/python-streamz/streamz/issues/460 "ignore: pkg_resources is deprecated as an API:DeprecationWarning:streamz.plugins", - # 2023-10: datetime.utctimestamp() is deprecated in Python 3.12 + # 2023-10: Datetime's utctimestamp() and utcnow() is deprecated in Python 3.12 "ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning:dateutil.tz.tz", "ignore:datetime.datetime.utcfromtimestamp():DeprecationWarning:bokeh", # https://github.com/bokeh/bokeh/issues/13125 "ignore:datetime.datetime.utcnow():DeprecationWarning:bokeh", # https://github.com/bokeh/bokeh/issues/13125