From 79b3794dac5e3d37414dc895b43bb03ea74cd011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 10 Apr 2024 15:47:08 +0200 Subject: [PATCH 01/92] Move deps to pyproject.toml --- pyproject.toml | 112 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 109 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4338a5e691..c96a17d4ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,114 @@ [build-system] -requires = [ +requires = ["setuptools >=30.3.0", "setuptools_scm >=7"] +build-backend = "setuptools.build_meta" + +[project] +name = "holoviews" +dynamic = ["version"] +description = "A high-level plotting API for the PyData ecosystem built on HoloViews." +readme = "README.md" +license = { text = "BSD" } +requires-python = ">=3.9" +authors = [ + { name = "Jean-Luc Stevens", email = "developers@holoviz.org" }, + { name = "Philipp Rudiger", email = "developers@holoviz.org" }, +] +maintainers = [ + { name = "HoloViz developers", email = "developers@holoviz.org" }, +] +classifiers = [ + "License :: OSI Approved :: BSD License", + "Development Status :: 5 - Production/Stable", + "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", + "Natural Language :: English", + "Framework :: Matplotlib", + "Topic :: Scientific/Engineering", + "Topic :: Software Development :: Libraries", +] +# urls = { +# Homepage = "https://holoviews.org", +# Source = "http://github.com/holoviz/holoviews", +# HoloViz = "https://holoviz.org/", +# } +# entry_points={console_scripts= ["holoviews = holoviews.util.command:main"]} +dependencies = [ "param >=1.12.0,<3.0", - "pyct >=0.4.4", - "setuptools >=30.3.0", + "numpy >=1.0", + "pyviz_comms >=2.1", + "panel >=1.0", + "colorcet", + "packaging", + "pandas >=0.20.0", +] + +[project.optional-dependencies] +recommended = ["ipython >=5.4.0", "notebook", "matplotlib >=3", "bokeh >=3.1"] +examples = [ + "holoviews[recommended]", + "networkx", + "pillow", + "xarray >=0.10.4", + "plotly >=4.0", + # "dash >=1.16", + "streamz >=0.5.0", + "ffmpeg", + "cftime", + "netcdf4", + "dask", + "scipy", + "shapely", + "scikit-image", + "pyarrow", + "pooch", + "datashader >=0.11.1", + "notebook >=7.0", +] +tests-core = [ + "pytest", + "pytest-cov", + "pytest-xdist", + "pytest-rerunfailures", + "matplotlib >=3", + # "nbconvert", + "bokeh >=3.1", + "pillow", + "plotly >=4.0", + "ipython >=5.4.0", + "contourpy", +] +tests = [ + "holoviews[tests-core]", + "dask", + "ibis-framework", # Mapped to ibis-sqlite in setup.cfg for conda + "xarray >=0.10.4", + "networkx", + "shapely", + "ffmpeg", + "cftime", + "scipy >=1.10", # Python 3.9 + Windows downloads 1.9 + "selenium", + "spatialpandas", + "datashader >=0.11.1", + # "dash >=1.16", + "tsdownsample", # not windows +] +tests-ci = ["codecov", "pytest-github-actions-annotate-failures"] +tests-ui = ["playwright", "pytest-playwright"] +tests-examples = ["holoviews[examples]", "holoviews[tests]"] +doc = [ + "holoviews[examples]", + "nbsite >=0.8.4,<0.9.0", + "myst-nb <1", + "graphviz", + "bokeh >=3.1", + "pooch", + "selenium", ] [tool.pytest.ini_options] From 2ec0c056adef033159ae999788ee9b1047e1b99d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 10 Apr 2024 15:54:21 +0200 Subject: [PATCH 02/92] Update other setup.py stuff --- pyproject.toml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c96a17d4ae..771fa603b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,11 +31,6 @@ classifiers = [ "Topic :: Scientific/Engineering", "Topic :: Software Development :: Libraries", ] -# urls = { -# Homepage = "https://holoviews.org", -# Source = "http://github.com/holoviz/holoviews", -# HoloViz = "https://holoviz.org/", -# } # entry_points={console_scripts= ["holoviews = holoviews.util.command:main"]} dependencies = [ "param >=1.12.0,<3.0", @@ -46,6 +41,10 @@ dependencies = [ "packaging", "pandas >=0.20.0", ] +[project.urls] +Homepage = "https://holoviews.org" +Source = "http://github.com/holoviz/holoviews" +HoloViz = "https://holoviz.org/" [project.optional-dependencies] recommended = ["ipython >=5.4.0", "notebook", "matplotlib >=3", "bokeh >=3.1"] @@ -111,6 +110,15 @@ doc = [ "selenium", ] +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +include = ["holoviews"] + +[tool.setuptools_scm] +version_file = "holoviews/_version.py" + [tool.pytest.ini_options] addopts = ["--strict-config", "--strict-markers", "--color=yes"] minversion = "7" From a7933b23477c206271ffdf0851846436fa2715bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 10 Apr 2024 18:42:32 +0200 Subject: [PATCH 03/92] Try to move stuff to pixi --- .gitignore | 1 + pyproject.toml | 179 ++++++++++++++++++++++++++++++++----------------- 2 files changed, 119 insertions(+), 61 deletions(-) diff --git a/.gitignore b/.gitignore index a75807cd77..2957709938 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ .ipynb_checkpoints .coverage .pytest_cache +.pixi /release /doc/Tutorials-WIP/*.ipynb diff --git a/pyproject.toml b/pyproject.toml index 771fa603b0..01880a29a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,67 +48,124 @@ HoloViz = "https://holoviz.org/" [project.optional-dependencies] recommended = ["ipython >=5.4.0", "notebook", "matplotlib >=3", "bokeh >=3.1"] -examples = [ - "holoviews[recommended]", - "networkx", - "pillow", - "xarray >=0.10.4", - "plotly >=4.0", - # "dash >=1.16", - "streamz >=0.5.0", - "ffmpeg", - "cftime", - "netcdf4", - "dask", - "scipy", - "shapely", - "scikit-image", - "pyarrow", - "pooch", - "datashader >=0.11.1", - "notebook >=7.0", -] -tests-core = [ - "pytest", - "pytest-cov", - "pytest-xdist", - "pytest-rerunfailures", - "matplotlib >=3", - # "nbconvert", - "bokeh >=3.1", - "pillow", - "plotly >=4.0", - "ipython >=5.4.0", - "contourpy", -] -tests = [ - "holoviews[tests-core]", - "dask", - "ibis-framework", # Mapped to ibis-sqlite in setup.cfg for conda - "xarray >=0.10.4", - "networkx", - "shapely", - "ffmpeg", - "cftime", - "scipy >=1.10", # Python 3.9 + Windows downloads 1.9 - "selenium", - "spatialpandas", - "datashader >=0.11.1", - # "dash >=1.16", - "tsdownsample", # not windows -] -tests-ci = ["codecov", "pytest-github-actions-annotate-failures"] -tests-ui = ["playwright", "pytest-playwright"] -tests-examples = ["holoviews[examples]", "holoviews[tests]"] -doc = [ - "holoviews[examples]", - "nbsite >=0.8.4,<0.9.0", - "myst-nb <1", - "graphviz", - "bokeh >=3.1", - "pooch", - "selenium", -] + +[tool.pixi.project] +name = "holoviews" +channels = ["conda-forge", "pyviz/label/dev"] +# platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] +platforms = ["linux-64", "osx-64", "win-64"] + +[tool.pixi.environments] +test-309 = ["py309", "test-core", "test", "examples"] +test-310 = ["py310", "test-core", "test", "examples"] +test-311 = ["py311", "test-core", "test", "examples"] +test-312 = ["py312", "test-core", "test", "examples"] +test-ui = ["py311", "test-core", "test", "test-ui"] +test-core = ["py312", "test-core"] +docs = ["py311", "examples", "doc"] + +[tool.pixi.dependencies] +python = ">=3.9" +param = ">=1.12.0,<3.0" +panel = ">=1.0" +pyviz_comms = ">=2.1" +colorcet = "*" +numpy = ">=1.0" +packaging = "*" +pandas = ">=0.20.0" +ipython = ">=5.4.0" +notebook = "*" +matplotlib = ">=3" +bokeh = ">=3.1" + +[tool.pixi.pypi-dependencies] +holoviews = { path = ".", editable = true } + +[tool.pixi.feature.py309.dependencies] +python = "3.9.*" + +[tool.pixi.feature.py310.dependencies] +python = "3.10.*" + +[tool.pixi.feature.py311.dependencies] +python = "3.11.*" + +[tool.pixi.feature.py312.dependencies] +python = "3.12.*" + +[tool.pixi.feature.test-core.dependencies] +pytest = "*" +pytest-cov = "*" +pytest-xdist = "*" +pytest-rerunfailures = "*" +matplotlib = ">=3" +nbconvert = "*" +bokeh = ">=3.1" +pillow = "*" +plotly = ">=4.0" +ipython = ">=5.4.0" +contourpy = "*" +codecov = "*" +pytest-github-actions-annotate-failures = "*" + +[tool.pixi.feature.test-core.tasks] +test = 'pytest holoviews --cov=./holoviews' + +[tool.pixi.feature.test.dependencies] +dask-core = "*" +ibis-sqlite = "*" +xarray = ">=0.10.4" +networkx = "*" +shapely = "*" +ffmpeg = "*" +cftime = "*" +scipy = ">=1.10" # Python 3.9 + Windows downloads 1.9 +selenium = "*" +spatialpandas = "*" +datashader = ">=0.11.1" +# dash >=1.16 +# tsdownsample = "*" # not windows + +[tool.pixi.feature.examples.dependencies] +networkx = "*" +pillow = "*" +xarray = ">=0.10.4" +plotly = ">=4.0" +# dash >=1.16 +streamz = ">=0.5.0" +ffmpeg = "*" +cftime = "*" +netcdf4 = "*" +dask = "*" +scipy = "*" +shapely = "*" +scikit-image = "*" +pyarrow = "*" +pooch = "*" +datashader = ">=0.11.1" +notebook = ">=7.0" + +[tool.pixi.feature.test-ui] +channels = ["conda-forge", "pyviz/label/dev", "microsoft"] +# dependencies = ["playwright", "pytest-playwright"] + +[tool.pixi.feature.test-ui.dependencies] +playwright = "*" +pytest-playwright = "*" + +[tool.pixi.feature.test-ui.tasks] +activate = 'playwright install chromium' +test-ui = 'pytest holoviews --cov=./holoviews --cov-report=xml --ui --browser chromium' +# test-ui = { +# cmd = ['pytest holoviews --cov=./holoviews --cov-report=xml --ui --browser chromium'], +# depends_on = ["activate"] +# } + +[tool.pixi.feature.doc.dependencies] +nbsite = ">=0.8.4,<0.9.0" +graphviz = "*" +pooch = "*" +selenium = "*" [tool.setuptools] include-package-data = true From d760350ed0967dbbdea5a6d2552437f039b434dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 10 Apr 2024 18:49:02 +0200 Subject: [PATCH 04/92] Try updating the ci test file --- .github/workflows/test.yaml | 202 ++++++++++++++++++------------------ 1 file changed, 99 insertions(+), 103 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 57e3226018..0f2c29ea4d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -91,7 +91,7 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest", "macos-latest", "windows-latest"], - "python-version": ["3.9", "3.12"] + "python-version": ["py309", "py312"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV - name: Set test matrix with 'full' option @@ -123,120 +123,116 @@ jobs: DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} unit tests" PYTHON_VERSION: ${{ matrix.python-version }} steps: - - uses: holoviz-dev/holoviz_tasks/install@v0 + - uses: actions/checkout@v4 if: needs.setup.outputs.code_change == 'true' with: - name: unit_test_suite - python-version: ${{ matrix.python-version }} - channel-priority: flexible - channels: pyviz/label/dev,conda-forge,nodefaults - envs: "-o flakes -o tests -o examples_tests -o tests_ci" - cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - conda-update: true + fetch-depth: "100" + - name: Fetch + if: needs.setup.outputs.code_change == 'true' + run: git fetch --prune --tags -f + - uses: prefix-dev/setup-pixi@v0.5.1 + if: needs.setup.outputs.code_change == 'true' id: install - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | - conda activate test-environment python scripts/check_latest_packages.py bokeh panel param datashader - name: Download data if: needs.setup.outputs.code_change == 'true' run: | - conda activate test-environment bash scripts/download_data.sh - name: doit test_unit if: needs.setup.outputs.code_change == 'true' run: | - conda activate test-environment - doit test_unit - - name: test examples - if: needs.setup.outputs.code_change == 'true' - run: | - conda activate test-environment - doit test_examples - - name: codecov - if: needs.setup.outputs.code_change == 'true' - run: | - conda activate test-environment - codecov - - ui_test_suite: - name: UI tests on Python ${{ matrix.python-version }}, ${{ matrix.os }} - needs: [pre_commit, setup] - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest"] - python-version: ["3.9"] - timeout-minutes: 60 - env: - DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} UI tests" - PANEL_LOG_LEVEL: info - # Without this env var `doit env_create ...` uses by default - # the `pyviz` channel, except that we don't want to configure - # it as one of the sources. - PYCTDEV_SELF_CHANNEL: "pyviz/label/dev" - steps: - - uses: holoviz-dev/holoviz_tasks/install@v0 - if: needs.setup.outputs.code_change == 'true' - with: - name: ui_test_suite - python-version: ${{ matrix.python-version }} - channels: pyviz/label/dev,conda-forge,nodefaults - envs: "-o recommended -o tests -o build -o tests_ci" - cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - playwright: true - id: install - - name: doit test_ui - if: needs.setup.outputs.code_change == 'true' - run: | - conda activate test-environment - doit test_ui - - name: Upload coverage to Codecov - if: needs.setup.outputs.code_change == 'true' - uses: codecov/codecov-action@v3 - with: - files: ./coverage.xml - flags: ui-tests - fail_ci_if_error: false # optional (default = false) + pixi run -e ${{ matrix.python-version }} test + # - name: test examples + # if: needs.setup.outputs.code_change == 'true' + # run: | + # conda activate test-environment + # doit test_examples + # - name: codecov + # if: needs.setup.outputs.code_change == 'true' + # run: | + # conda activate test-environment + # codecov - core_test_suite: - name: Core tests on Python ${{ matrix.python-version }}, ${{ matrix.os }} - needs: [pre_commit, setup] - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest"] - python-version: ["3.12"] - timeout-minutes: 120 - env: - DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} core tests" - PYTHON_VERSION: ${{ matrix.python-version }} - steps: - - uses: holoviz-dev/holoviz_tasks/install@v0 - if: needs.setup.outputs.code_change == 'true' - 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 tests_ci" - cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - id: install - - name: Download data - if: needs.setup.outputs.code_change == 'true' - run: | - conda activate test-environment - bash scripts/download_data.sh - - name: Check packages latest version - if: needs.setup.outputs.code_change == 'true' - run: | - conda activate test-environment - python scripts/check_latest_packages.py numpy pandas bokeh panel param - - name: doit test_unit - if: needs.setup.outputs.code_change == 'true' - run: | - conda activate test-environment - pytest holoviews + # ui_test_suite: + # name: UI tests on Python ${{ matrix.python-version }}, ${{ matrix.os }} + # needs: [pre_commit, setup] + # runs-on: ${{ matrix.os }} + # strategy: + # fail-fast: false + # matrix: + # os: ["ubuntu-latest"] + # python-version: ["3.9"] + # timeout-minutes: 60 + # env: + # DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} UI tests" + # PANEL_LOG_LEVEL: info + # # Without this env var `doit env_create ...` uses by default + # # the `pyviz` channel, except that we don't want to configure + # # it as one of the sources. + # PYCTDEV_SELF_CHANNEL: "pyviz/label/dev" + # steps: + # - uses: holoviz-dev/holoviz_tasks/install@v0 + # if: needs.setup.outputs.code_change == 'true' + # with: + # name: ui_test_suite + # python-version: ${{ matrix.python-version }} + # channels: pyviz/label/dev,conda-forge,nodefaults + # envs: "-o recommended -o tests -o build -o tests_ci" + # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} + # playwright: true + # id: install + # - name: doit test_ui + # if: needs.setup.outputs.code_change == 'true' + # run: | + # conda activate test-environment + # doit test_ui + # - name: Upload coverage to Codecov + # if: needs.setup.outputs.code_change == 'true' + # uses: codecov/codecov-action@v3 + # with: + # files: ./coverage.xml + # flags: ui-tests + # fail_ci_if_error: false # optional (default = false) + # + # core_test_suite: + # name: Core tests on Python ${{ matrix.python-version }}, ${{ matrix.os }} + # needs: [pre_commit, setup] + # runs-on: ${{ matrix.os }} + # strategy: + # fail-fast: false + # matrix: + # os: ["ubuntu-latest"] + # python-version: ["3.12"] + # timeout-minutes: 120 + # env: + # DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} core tests" + # PYTHON_VERSION: ${{ matrix.python-version }} + # steps: + # - uses: holoviz-dev/holoviz_tasks/install@v0 + # if: needs.setup.outputs.code_change == 'true' + # 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 tests_ci" + # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} + # id: install + # - name: Download data + # if: needs.setup.outputs.code_change == 'true' + # run: | + # conda activate test-environment + # bash scripts/download_data.sh + # - name: Check packages latest version + # if: needs.setup.outputs.code_change == 'true' + # run: | + # conda activate test-environment + # python scripts/check_latest_packages.py numpy pandas bokeh panel param + # - name: doit test_unit + # if: needs.setup.outputs.code_change == 'true' + # run: | + # conda activate test-environment + # pytest holoviews From ce6037b3f07c881e8f4e2ad3a5b94c1228205244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 10 Apr 2024 18:54:06 +0200 Subject: [PATCH 05/92] Small changes --- .github/workflows/test.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0f2c29ea4d..aaf1b6b99d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -33,7 +33,6 @@ defaults: shell: bash -el {0} env: - SETUPTOOLS_ENABLE_FEATURES: "legacy-editable" DISPLAY: ":99.0" PYTHONIOENCODING: "utf-8" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -91,7 +90,7 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest", "macos-latest", "windows-latest"], - "python-version": ["py309", "py312"] + "python-version": ["test-py309", "test-py312"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV - name: Set test matrix with 'full' option @@ -133,6 +132,10 @@ jobs: - uses: prefix-dev/setup-pixi@v0.5.1 if: needs.setup.outputs.code_change == 'true' id: install + with: + pixi-version: v0.19.0 + manifest-path: pyproject.toml + # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | From 726ed7e9022f4e7c1e7c1dbf78025df391ac05fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 10 Apr 2024 19:06:31 +0200 Subject: [PATCH 06/92] Remove setup.py --- setup.py | 222 ------------------------------------------------------- 1 file changed, 222 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index d25e1c47ef..0000000000 --- a/setup.py +++ /dev/null @@ -1,222 +0,0 @@ -#!/usr/bin/env python - -import json -import os -import shutil -import sys - -import pyct.build -from setuptools import find_packages, setup - -setup_args = {} -install_requires = [ - "param >=1.12.0,<3.0", - "numpy >=1.0", - "pyviz_comms >=2.1", - "panel >=1.0", - "colorcet", - "packaging", - "pandas >=0.20.0", -] - -extras_require = {} - -extras_require['lint'] = [ - 'ruff', - 'pre-commit', -] - -# Test requirements -extras_require['tests_core'] = [ - 'pytest', - 'pytest-cov', - 'pytest-xdist', - 'pytest-rerunfailures', - 'matplotlib >=3', - 'nbconvert', - 'bokeh >=3.1', - 'pillow', - 'plotly >=4.0', - 'ipython >=5.4.0', - 'contourpy', -] - -# Optional tests dependencies, i.e. one should be able -# to run and pass the test suite without installing any -# of those. -extras_require['tests'] = extras_require['tests_core'] + [ - 'dask', - 'ibis-framework', # Mapped to ibis-sqlite in setup.cfg for conda - 'xarray >=0.10.4', - 'networkx', - 'shapely', - 'ffmpeg', - 'cftime', - 'scipy >=1.10', # Python 3.9 + Windows downloads 1.9 - 'selenium', - 'spatialpandas', - 'datashader >=0.11.1', - 'dash >=1.16', -] - -if os.name != "nt": - # Currently not available on Windows on conda-forge - extras_require['tests'] += ['tsdownsample'] - -extras_require['tests_ci'] = [ - 'codecov', - "pytest-github-actions-annotate-failures", -] - -extras_require['tests_gpu'] = extras_require['tests'] + [ - 'cudf', -] - -extras_require['tests_nb'] = ['nbval'] -extras_require['ui'] = ['playwright', 'pytest-playwright'] - -# Notebook dependencies -extras_require["notebook"] = ["ipython >=5.4.0", "notebook"] - -# IPython Notebook + pandas + matplotlib + bokeh -extras_require["recommended"] = extras_require["notebook"] + [ - "matplotlib >=3", - "bokeh >=3.1", -] - -# Requirements to run all examples -extras_require["examples"] = extras_require["recommended"] + [ - "networkx", - "pillow", - "xarray >=0.10.4", - "plotly >=4.0", - 'dash >=1.16', - "streamz >=0.5.0", - "ffmpeg", - "cftime", - "netcdf4", - "dask", - "scipy", - "shapely", - "scikit-image", - "pyarrow", - "pooch", - "datashader >=0.11.1", - "notebook >=7.0", -] - - -extras_require["examples_tests"] = extras_require["examples"] + extras_require['tests_nb'] - -# Not used in tox.ini or elsewhere, kept for backwards compatibility. -extras_require["unit_tests"] = extras_require["examples"] + extras_require["tests"] + extras_require['lint'] - -extras_require['doc'] = extras_require['examples'] + [ - 'nbsite >=0.8.4,<0.9.0', - 'myst-nb <1', - 'graphviz', - 'bokeh >=3.1', - 'pooch', - 'selenium', -] - -extras_require['all'] = sorted(set(sum(extras_require.values(), []))) - -extras_require["build"] = [ - "param >=1.7.0", - "setuptools >=30.3.0", - "pyct >=0.4.4", -] - -def get_setup_version(reponame): - """ - Helper to get the current version from either git describe or the - .version file (if available). - """ - basepath = os.path.split(__file__)[0] - version_file_path = os.path.join(basepath, reponame, ".version") - try: - from param import version - except ImportError: - version = None - if version is not None: - return version.Version.setup_version( - basepath, reponame, archive_commit="$Format:%h$" - ) - else: - print( - "WARNING: param>=1.6.0 unavailable. If you are installing a package, this warning can safely be ignored. If you are creating a package or otherwise operating in a git repository, you should install param>=1.6.0." - ) - return json.load(open(version_file_path))["version_string"] - - -setup_args.update( - dict( - name="holoviews", - version=get_setup_version("holoviews"), - python_requires=">=3.9", - install_requires=install_requires, - extras_require=extras_require, - description="Stop plotting your data - annotate your data and let it visualize itself.", - long_description=open("README.md").read(), - long_description_content_type="text/markdown", - author="Jean-Luc Stevens and Philipp Rudiger", - author_email="holoviews@gmail.com", - maintainer="HoloViz Developers", - maintainer_email="developers@pyviz.org", - platforms=["Windows", "Mac OS X", "Linux"], - license="BSD", - url="https://www.holoviews.org", - project_urls={ - "Source": "https://github.com/holoviz/holoviews", - }, - entry_points={"console_scripts": ["holoviews = holoviews.util.command:main"]}, - packages=find_packages(), - include_package_data=True, - classifiers=[ - "License :: OSI Approved :: BSD License", - "Development Status :: 5 - Production/Stable", - "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", - "Natural Language :: English", - "Framework :: Matplotlib", - "Topic :: Scientific/Engineering", - "Topic :: Software Development :: Libraries", - ], - ) -) - - -if __name__ == "__main__": - example_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), "holoviews/examples" - ) - - if "develop" not in sys.argv and "egg_info" not in sys.argv: - pyct.build.examples(example_path, __file__, force=True) - - if "install" in sys.argv: - header = "HOLOVIEWS INSTALLATION INFORMATION" - bars = "=" * len(header) - - extras = "\n".join("holoviews[%s]" % e for e in setup_args["extras_require"]) - - print(f"{bars}\n{header}\n{bars}") - - print("\nHoloViews supports the following installation types:\n") - print("%s\n" % extras) - print("Users should consider using one of these options.\n") - print("By default only a core installation is performed and ") - print("only the minimal set of dependencies are fetched.\n\n") - print("For more information please visit http://holoviews.org/install.html\n") - print(bars + "\n") - - setup(**setup_args) - - if os.path.isdir(example_path): - shutil.rmtree(example_path) From 0062cb1bf2afe22241b4aa436ac454cb5a300d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 10 Apr 2024 19:19:31 +0200 Subject: [PATCH 07/92] Add global tasks --- .github/workflows/test.yaml | 4 ++-- pyproject.toml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index aaf1b6b99d..7b20f0fe51 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -139,11 +139,11 @@ jobs: - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | - python scripts/check_latest_packages.py bokeh panel param datashader + pixi run -e ${{ matrix.python-version }} check-latest-packages bokeh panel param datashader - name: Download data if: needs.setup.outputs.code_change == 'true' run: | - bash scripts/download_data.sh + pixi run -e ${{ matrix.python-version }} download-data - name: doit test_unit if: needs.setup.outputs.code_change == 'true' run: | diff --git a/pyproject.toml b/pyproject.toml index 01880a29a6..8612ed2b4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,6 +55,10 @@ channels = ["conda-forge", "pyviz/label/dev"] # platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] platforms = ["linux-64", "osx-64", "win-64"] +[tool.pixi.tasks] +check-latest-packages = 'python scripts/check_latest_packages.py' +download-data = 'bash scripts/download_data.sh' + [tool.pixi.environments] test-309 = ["py309", "test-core", "test", "examples"] test-310 = ["py310", "test-core", "test", "examples"] From 6a52141b4b995c3ff03fb71e5281059d146d60a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 10 Apr 2024 19:27:45 +0200 Subject: [PATCH 08/92] Add environment --- .github/workflows/test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7b20f0fe51..cc4b8efcc0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -90,7 +90,7 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest", "macos-latest", "windows-latest"], - "python-version": ["test-py309", "test-py312"] + "python-version": ["test-309", "test-312"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV - name: Set test matrix with 'full' option @@ -135,6 +135,7 @@ jobs: with: pixi-version: v0.19.0 manifest-path: pyproject.toml + environments: ${{ matrix.python-version }} # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' From e15620e9e748d407bc6688f1e7e5b1132865ff7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 10 Apr 2024 19:54:18 +0200 Subject: [PATCH 09/92] Add ui and core tests --- .github/workflows/test.yaml | 185 ++++++++++++++++++------------------ pyproject.toml | 4 +- 2 files changed, 96 insertions(+), 93 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cc4b8efcc0..49e7bf94d3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -145,98 +145,99 @@ jobs: if: needs.setup.outputs.code_change == 'true' run: | pixi run -e ${{ matrix.python-version }} download-data - - name: doit test_unit + - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} test - # - name: test examples - # if: needs.setup.outputs.code_change == 'true' - # run: | - # conda activate test-environment - # doit test_examples - # - name: codecov - # if: needs.setup.outputs.code_change == 'true' - # run: | - # conda activate test-environment - # codecov + pixi run -e ${{ matrix.python-version }} test-unit + - name: Test Examples + if: needs.setup.outputs.code_change == 'true' + run: | + pixi run -e ${{ matrix.python-version }} test-examples + - name: codecov + if: needs.setup.outputs.code_change == 'true' + run: | + pixi run -e ${{ matrix.python-version }} codecov + + ui_test_suite: + name: UI tests on Python ${{ matrix.python-version }}, ${{ matrix.os }} + needs: [pre_commit, setup] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest"] + python-version: ["ui-test"] + timeout-minutes: 60 + env: + DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} UI tests" + PANEL_LOG_LEVEL: info + steps: + - uses: actions/checkout@v4 + if: needs.setup.outputs.code_change == 'true' + with: + fetch-depth: "100" + - name: Fetch + if: needs.setup.outputs.code_change == 'true' + run: git fetch --prune --tags -f + - uses: prefix-dev/setup-pixi@v0.5.1 + if: needs.setup.outputs.code_change == 'true' + id: install + with: + pixi-version: v0.19.0 + manifest-path: pyproject.toml + environments: ${{ matrix.python-version }} + # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} + - name: Download data + if: needs.setup.outputs.code_change == 'true' + run: | + pixi run -e ${{ matrix.python-version }} download-data + - name: Test UI + if: needs.setup.outputs.code_change == 'true' + run: | + pixi run -e ${{ matrix.python-version }} test-ui + - name: codecov + if: needs.setup.outputs.code_change == 'true' + run: | + pixi run -e ${{ matrix.python-version }} codecov - # ui_test_suite: - # name: UI tests on Python ${{ matrix.python-version }}, ${{ matrix.os }} - # needs: [pre_commit, setup] - # runs-on: ${{ matrix.os }} - # strategy: - # fail-fast: false - # matrix: - # os: ["ubuntu-latest"] - # python-version: ["3.9"] - # timeout-minutes: 60 - # env: - # DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} UI tests" - # PANEL_LOG_LEVEL: info - # # Without this env var `doit env_create ...` uses by default - # # the `pyviz` channel, except that we don't want to configure - # # it as one of the sources. - # PYCTDEV_SELF_CHANNEL: "pyviz/label/dev" - # steps: - # - uses: holoviz-dev/holoviz_tasks/install@v0 - # if: needs.setup.outputs.code_change == 'true' - # with: - # name: ui_test_suite - # python-version: ${{ matrix.python-version }} - # channels: pyviz/label/dev,conda-forge,nodefaults - # envs: "-o recommended -o tests -o build -o tests_ci" - # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - # playwright: true - # id: install - # - name: doit test_ui - # if: needs.setup.outputs.code_change == 'true' - # run: | - # conda activate test-environment - # doit test_ui - # - name: Upload coverage to Codecov - # if: needs.setup.outputs.code_change == 'true' - # uses: codecov/codecov-action@v3 - # with: - # files: ./coverage.xml - # flags: ui-tests - # fail_ci_if_error: false # optional (default = false) - # - # core_test_suite: - # name: Core tests on Python ${{ matrix.python-version }}, ${{ matrix.os }} - # needs: [pre_commit, setup] - # runs-on: ${{ matrix.os }} - # strategy: - # fail-fast: false - # matrix: - # os: ["ubuntu-latest"] - # python-version: ["3.12"] - # timeout-minutes: 120 - # env: - # DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} core tests" - # PYTHON_VERSION: ${{ matrix.python-version }} - # steps: - # - uses: holoviz-dev/holoviz_tasks/install@v0 - # if: needs.setup.outputs.code_change == 'true' - # 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 tests_ci" - # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - # id: install - # - name: Download data - # if: needs.setup.outputs.code_change == 'true' - # run: | - # conda activate test-environment - # bash scripts/download_data.sh - # - name: Check packages latest version - # if: needs.setup.outputs.code_change == 'true' - # run: | - # conda activate test-environment - # python scripts/check_latest_packages.py numpy pandas bokeh panel param - # - name: doit test_unit - # if: needs.setup.outputs.code_change == 'true' - # run: | - # conda activate test-environment - # pytest holoviews + core_test_suite: + name: Core tests on Python ${{ matrix.python-version }}, ${{ matrix.os }} + needs: [pre_commit, setup] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest"] + python-version: ["test-core"] + timeout-minutes: 120 + env: + DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} core tests" + PYTHON_VERSION: ${{ matrix.python-version }} + steps: + - uses: actions/checkout@v4 + if: needs.setup.outputs.code_change == 'true' + with: + fetch-depth: "100" + - name: Fetch + if: needs.setup.outputs.code_change == 'true' + run: git fetch --prune --tags -f + - uses: prefix-dev/setup-pixi@v0.5.1 + if: needs.setup.outputs.code_change == 'true' + id: install + with: + pixi-version: v0.19.0 + manifest-path: pyproject.toml + environments: ${{ matrix.python-version }} + # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} + - name: Check packages latest version + if: needs.setup.outputs.code_change == 'true' + run: | + pixi run -e ${{ matrix.python-version }} check-latest-packages numpy pandas bokeh panel param + - name: Download data + if: needs.setup.outputs.code_change == 'true' + run: | + pixi run -e ${{ matrix.python-version }} download-data + - name: Test Unit + if: needs.setup.outputs.code_change == 'true' + run: | + pixi run -e ${{ matrix.python-version }} test-unit diff --git a/pyproject.toml b/pyproject.toml index 8612ed2b4e..6491d45b14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,7 +113,8 @@ codecov = "*" pytest-github-actions-annotate-failures = "*" [tool.pixi.feature.test-core.tasks] -test = 'pytest holoviews --cov=./holoviews' +test-unit = 'pytest holoviews --cov=./holoviews' +test-example = 'pytest -n auto --dist loadscope --nbval-lax examples' [tool.pixi.feature.test.dependencies] dask-core = "*" @@ -127,6 +128,7 @@ scipy = ">=1.10" # Python 3.9 + Windows downloads 1.9 selenium = "*" spatialpandas = "*" datashader = ">=0.11.1" +nbval = "*" # dash >=1.16 # tsdownsample = "*" # not windows From 93cec10472ee322ec860874ac4cb10c5a8cc5c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 10 Apr 2024 20:16:46 +0200 Subject: [PATCH 10/92] Updates --- .github/workflows/test.yaml | 4 ++-- pyproject.toml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 49e7bf94d3..991969f707 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -166,7 +166,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["ui-test"] + python-version: ["test-ui"] timeout-minutes: 60 env: DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} UI tests" @@ -240,4 +240,4 @@ jobs: - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} test-unit + pixi run -e ${{ matrix.python-version }} test-core diff --git a/pyproject.toml b/pyproject.toml index 6491d45b14..a025f3c089 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,6 +113,7 @@ codecov = "*" pytest-github-actions-annotate-failures = "*" [tool.pixi.feature.test-core.tasks] +test-core = 'pytest holoviews' test-unit = 'pytest holoviews --cov=./holoviews' test-example = 'pytest -n auto --dist loadscope --nbval-lax examples' From 6917525b9f43b77ae9f85df617470b72d8b6dae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 10 Apr 2024 20:19:28 +0200 Subject: [PATCH 11/92] Remove setup.cfg --- pyproject.toml | 2 +- setup.cfg | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index a025f3c089..56b146c260 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,7 +79,7 @@ packaging = "*" pandas = ">=0.20.0" ipython = ">=5.4.0" notebook = "*" -matplotlib = ">=3" +matplotlib-base = ">=3" bokeh = ">=3.1" [tool.pixi.pypi-dependencies] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index ee80d48e0f..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[metadata] -license_files = LICENSE.txt - -[tool:pyctdev.conda] -namespace_map = - ibis-framework=ibis-sqlite - dask=dask-core - geoviews=geoviews-core - matplotlib=matplotlib-base From c5b93ce173c4a8cba49d60b5e4560050c529d2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 09:06:46 +0200 Subject: [PATCH 12/92] Rename python-version to environment --- .github/workflows/test.yaml | 54 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 991969f707..1f2f86936e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -90,7 +90,7 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest", "macos-latest", "windows-latest"], - "python-version": ["test-309", "test-312"] + "environment": ["test-309", "test-312"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV - name: Set test matrix with 'full' option @@ -98,7 +98,7 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest", "macos-latest", "windows-latest"], - "python-version": ["3.9", "3.10", "3.11", "3.12"] + "environment": ["3.9", "3.10", "3.11", "3.12"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV - name: Set test matrix with 'downstream' option @@ -106,12 +106,12 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest"], - "python-version": ["3.11"] + "environment": ["3.11"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV unit_test_suite: - name: Unit tests on Python ${{ matrix.python-version }}, ${{ matrix.os }} + name: Unit tests on Python ${{ matrix.environment }}, ${{ matrix.os }} needs: [pre_commit, setup] runs-on: ${{ matrix.os }} strategy: @@ -119,8 +119,8 @@ jobs: matrix: ${{ fromJson(needs.setup.outputs.matrix) }} timeout-minutes: 120 env: - DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} unit tests" - PYTHON_VERSION: ${{ matrix.python-version }} + DESC: "Python ${{ matrix.environment }}, ${{ matrix.os }} unit tests" + PYTHON_VERSION: ${{ matrix.environment }} steps: - uses: actions/checkout@v4 if: needs.setup.outputs.code_change == 'true' @@ -135,41 +135,41 @@ jobs: with: pixi-version: v0.19.0 manifest-path: pyproject.toml - environments: ${{ matrix.python-version }} + environments: ${{ matrix.environment }} # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} check-latest-packages bokeh panel param datashader + pixi run -e ${{ matrix.environment }} check-latest-packages bokeh panel param datashader - name: Download data if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} download-data + pixi run -e ${{ matrix.environment }} download-data - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} test-unit + pixi run -e ${{ matrix.environment }} test-unit - name: Test Examples if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} test-examples + pixi run -e ${{ matrix.environment }} test-examples - name: codecov if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} codecov + pixi run -e ${{ matrix.environment }} codecov ui_test_suite: - name: UI tests on Python ${{ matrix.python-version }}, ${{ matrix.os }} + name: UI tests on Python ${{ matrix.environment }}, ${{ matrix.os }} needs: [pre_commit, setup] runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["test-ui"] + environment: ["test-ui"] timeout-minutes: 60 env: - DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} UI tests" + DESC: "Python ${{ matrix.environment }}, ${{ matrix.os }} UI tests" PANEL_LOG_LEVEL: info steps: - uses: actions/checkout@v4 @@ -185,34 +185,34 @@ jobs: with: pixi-version: v0.19.0 manifest-path: pyproject.toml - environments: ${{ matrix.python-version }} + environments: ${{ matrix.environment }} # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - name: Download data if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} download-data + pixi run -e ${{ matrix.environment }} download-data - name: Test UI if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} test-ui + pixi run -e ${{ matrix.environment }} test-ui - name: codecov if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} codecov + pixi run -e ${{ matrix.environment }} codecov core_test_suite: - name: Core tests on Python ${{ matrix.python-version }}, ${{ matrix.os }} + name: Core tests on Python ${{ matrix.environment }}, ${{ matrix.os }} needs: [pre_commit, setup] runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["test-core"] + environment: ["test-core"] timeout-minutes: 120 env: - DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} core tests" - PYTHON_VERSION: ${{ matrix.python-version }} + DESC: "Python ${{ matrix.environment }}, ${{ matrix.os }} core tests" + PYTHON_VERSION: ${{ matrix.environment }} steps: - uses: actions/checkout@v4 if: needs.setup.outputs.code_change == 'true' @@ -227,17 +227,17 @@ jobs: with: pixi-version: v0.19.0 manifest-path: pyproject.toml - environments: ${{ matrix.python-version }} + environments: ${{ matrix.environment }} # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} check-latest-packages numpy pandas bokeh panel param + pixi run -e ${{ matrix.environment }} check-latest-packages numpy pandas bokeh panel param - name: Download data if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} download-data + pixi run -e ${{ matrix.environment }} download-data - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.python-version }} test-core + pixi run -e ${{ matrix.environment }} test-core From a5b217200e5806f14655a00a13d8f5ab436c8e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 09:15:41 +0200 Subject: [PATCH 13/92] Add PIXI_ENVIRONMENT_NAME and install-ui --- .github/workflows/test.yaml | 28 +++++++++++++++------------- pyproject.toml | 11 +++++------ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1f2f86936e..75d3155994 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -120,7 +120,7 @@ jobs: timeout-minutes: 120 env: DESC: "Python ${{ matrix.environment }}, ${{ matrix.os }} unit tests" - PYTHON_VERSION: ${{ matrix.environment }} + PIXI_ENVIRONMENT_NAME: ${{ matrix.environment }} steps: - uses: actions/checkout@v4 if: needs.setup.outputs.code_change == 'true' @@ -140,23 +140,23 @@ jobs: - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} check-latest-packages bokeh panel param datashader + pixi run check-latest-packages bokeh panel param datashader - name: Download data if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} download-data + pixi run download-data - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} test-unit + pixi run test-unit --cov=./holoviews - name: Test Examples if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} test-examples + pixi run test-examples - name: codecov if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} codecov + pixi run codecov ui_test_suite: name: UI tests on Python ${{ matrix.environment }}, ${{ matrix.os }} @@ -171,6 +171,7 @@ jobs: env: DESC: "Python ${{ matrix.environment }}, ${{ matrix.os }} UI tests" PANEL_LOG_LEVEL: info + PIXI_ENVIRONMENT_NAME: ${{ matrix.environment }} steps: - uses: actions/checkout@v4 if: needs.setup.outputs.code_change == 'true' @@ -190,15 +191,16 @@ jobs: - name: Download data if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} download-data + pixi run download-data - name: Test UI if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} test-ui + pixi run install-ui + pixi run test-ui --cov=./holoviews --cov-report=xml - name: codecov if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} codecov + pixi run codecov core_test_suite: name: Core tests on Python ${{ matrix.environment }}, ${{ matrix.os }} @@ -212,7 +214,7 @@ jobs: timeout-minutes: 120 env: DESC: "Python ${{ matrix.environment }}, ${{ matrix.os }} core tests" - PYTHON_VERSION: ${{ matrix.environment }} + PIXI_ENVIRONMENT_NAME: ${{ matrix.environment }} steps: - uses: actions/checkout@v4 if: needs.setup.outputs.code_change == 'true' @@ -232,12 +234,12 @@ jobs: - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} check-latest-packages numpy pandas bokeh panel param + pixi run check-latest-packages numpy pandas bokeh panel param - name: Download data if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} download-data + pixi run download-data - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} test-core + pixi run test-unit diff --git a/pyproject.toml b/pyproject.toml index 56b146c260..d075eae6cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,19 +102,17 @@ pytest = "*" pytest-cov = "*" pytest-xdist = "*" pytest-rerunfailures = "*" -matplotlib = ">=3" +matplotlib-base = ">=3" nbconvert = "*" bokeh = ">=3.1" pillow = "*" plotly = ">=4.0" ipython = ">=5.4.0" contourpy = "*" -codecov = "*" pytest-github-actions-annotate-failures = "*" [tool.pixi.feature.test-core.tasks] -test-core = 'pytest holoviews' -test-unit = 'pytest holoviews --cov=./holoviews' +test-unit = 'pytest holoviews' test-example = 'pytest -n auto --dist loadscope --nbval-lax examples' [tool.pixi.feature.test.dependencies] @@ -130,6 +128,7 @@ selenium = "*" spatialpandas = "*" datashader = ">=0.11.1" nbval = "*" +codecov = "*" # dash >=1.16 # tsdownsample = "*" # not windows @@ -143,7 +142,7 @@ streamz = ">=0.5.0" ffmpeg = "*" cftime = "*" netcdf4 = "*" -dask = "*" +dask-core = "*" scipy = "*" shapely = "*" scikit-image = "*" @@ -161,7 +160,7 @@ playwright = "*" pytest-playwright = "*" [tool.pixi.feature.test-ui.tasks] -activate = 'playwright install chromium' +install-ui = 'playwright install chromium' test-ui = 'pytest holoviews --cov=./holoviews --cov-report=xml --ui --browser chromium' # test-ui = { # cmd = ['pytest holoviews --cov=./holoviews --cov-report=xml --ui --browser chromium'], From d179b11c3d248e3d040cedd48dee70da28bc442d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 09:33:04 +0200 Subject: [PATCH 14/92] Update environments --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index d075eae6cc..cede8cf9eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -118,6 +118,7 @@ test-example = 'pytest -n auto --dist loadscope --nbval-lax examples' [tool.pixi.feature.test.dependencies] dask-core = "*" ibis-sqlite = "*" +pyarrow = "14.*" xarray = ">=0.10.4" networkx = "*" shapely = "*" From da8b2c00a53752e91bac073d2bc26b2f383de9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 09:47:02 +0200 Subject: [PATCH 15/92] Revert PIXI_ENVIRONMENT_NAME --- .github/workflows/test.yaml | 27 ++++++++++++--------------- pyproject.toml | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 75d3155994..c91deb6157 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -120,7 +120,6 @@ jobs: timeout-minutes: 120 env: DESC: "Python ${{ matrix.environment }}, ${{ matrix.os }} unit tests" - PIXI_ENVIRONMENT_NAME: ${{ matrix.environment }} steps: - uses: actions/checkout@v4 if: needs.setup.outputs.code_change == 'true' @@ -140,23 +139,23 @@ jobs: - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | - pixi run check-latest-packages bokeh panel param datashader + pixi run -e ${{ matrix.environment }} check-latest-packages bokeh panel param datashader - name: Download data if: needs.setup.outputs.code_change == 'true' run: | - pixi run download-data + pixi run -e ${{ matrix.environment }} download-data - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | - pixi run test-unit --cov=./holoviews + pixi run -e ${{ matrix.environment }} test-unit --cov=./holoviews - name: Test Examples if: needs.setup.outputs.code_change == 'true' run: | - pixi run test-examples + pixi run -e ${{ matrix.environment }} test-examples - name: codecov if: needs.setup.outputs.code_change == 'true' run: | - pixi run codecov + pixi run -e ${{ matrix.environment }} codecov ui_test_suite: name: UI tests on Python ${{ matrix.environment }}, ${{ matrix.os }} @@ -171,7 +170,6 @@ jobs: env: DESC: "Python ${{ matrix.environment }}, ${{ matrix.os }} UI tests" PANEL_LOG_LEVEL: info - PIXI_ENVIRONMENT_NAME: ${{ matrix.environment }} steps: - uses: actions/checkout@v4 if: needs.setup.outputs.code_change == 'true' @@ -191,16 +189,16 @@ jobs: - name: Download data if: needs.setup.outputs.code_change == 'true' run: | - pixi run download-data + pixi run -e ${{ matrix.environment }} download-data - name: Test UI if: needs.setup.outputs.code_change == 'true' run: | - pixi run install-ui - pixi run test-ui --cov=./holoviews --cov-report=xml + pixi run -e ${{ matrix.environment }} install-ui + pixi run -e ${{ matrix.environment }} test-ui --cov=./holoviews --cov-report=xml - name: codecov if: needs.setup.outputs.code_change == 'true' run: | - pixi run codecov + pixi run -e ${{ matrix.environment }} codecov core_test_suite: name: Core tests on Python ${{ matrix.environment }}, ${{ matrix.os }} @@ -214,7 +212,6 @@ jobs: timeout-minutes: 120 env: DESC: "Python ${{ matrix.environment }}, ${{ matrix.os }} core tests" - PIXI_ENVIRONMENT_NAME: ${{ matrix.environment }} steps: - uses: actions/checkout@v4 if: needs.setup.outputs.code_change == 'true' @@ -234,12 +231,12 @@ jobs: - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | - pixi run check-latest-packages numpy pandas bokeh panel param + pixi run -e ${{ matrix.environment }} check-latest-packages numpy pandas bokeh panel param - name: Download data if: needs.setup.outputs.code_change == 'true' run: | - pixi run download-data + pixi run -e ${{ matrix.environment }} download-data - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | - pixi run test-unit + pixi run -e ${{ matrix.environment }} test-unit diff --git a/pyproject.toml b/pyproject.toml index cede8cf9eb..ab5ba8fa2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -162,7 +162,7 @@ pytest-playwright = "*" [tool.pixi.feature.test-ui.tasks] install-ui = 'playwright install chromium' -test-ui = 'pytest holoviews --cov=./holoviews --cov-report=xml --ui --browser chromium' +test-ui = 'pytest holoviews --ui --browser chromium' # test-ui = { # cmd = ['pytest holoviews --cov=./holoviews --cov-report=xml --ui --browser chromium'], # depends_on = ["activate"] From f492143cf42ad6463a650b212ac15fdb53724a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 10:07:40 +0200 Subject: [PATCH 16/92] Clean up --- .github/workflows/test.yaml | 2 +- holoviews/tests/util/test_utils.py | 4 +++- pyproject.toml | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c91deb6157..1729ebea28 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -190,10 +190,10 @@ jobs: if: needs.setup.outputs.code_change == 'true' run: | pixi run -e ${{ matrix.environment }} download-data + pixi run -e ${{ matrix.environment }} install-ui - name: Test UI if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} install-ui pixi run -e ${{ matrix.environment }} test-ui --cov=./holoviews --cov-report=xml - name: codecov if: needs.setup.outputs.code_change == 'true' diff --git a/holoviews/tests/util/test_utils.py b/holoviews/tests/util/test_utils.py index 9438f1856c..824031b131 100644 --- a/holoviews/tests/util/test_utils.py +++ b/holoviews/tests/util/test_utils.py @@ -5,7 +5,7 @@ from pyviz_comms import CommManager -from holoviews import Store, notebook_extension +from holoviews import Store from holoviews.core.options import OptionTree from holoviews.element.comparison import ComparisonTestCase from holoviews.plotting import bokeh, mpl @@ -26,6 +26,8 @@ class TestOutputUtil(ComparisonTestCase): def setUp(self): if notebook is None: raise SkipTest("Jupyter Notebook not available") + from holoviews.ipython import notebook_extension + notebook_extension(*BACKENDS) Store.current_backend = 'matplotlib' Store.renderers['matplotlib'] = mpl.MPLRenderer.instance() diff --git a/pyproject.toml b/pyproject.toml index ab5ba8fa2a..40a2a0794a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -118,7 +118,6 @@ test-example = 'pytest -n auto --dist loadscope --nbval-lax examples' [tool.pixi.feature.test.dependencies] dask-core = "*" ibis-sqlite = "*" -pyarrow = "14.*" xarray = ">=0.10.4" networkx = "*" shapely = "*" From fc62bd55c6bc6e4073f7a8bc7cf96aaa7035e950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 10:22:53 +0200 Subject: [PATCH 17/92] Add pixi.lock step --- .github/workflows/test.yaml | 45 ++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1729ebea28..497330f7f1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -110,9 +110,36 @@ jobs: }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV + pixi_lock: + name: Pixi lock + runs-on: ubuntu-latest + needs: [pre_commit, setup] + steps: + - uses: actions/checkout@v4 + if: needs.setup.outputs.code_change == 'true' + with: + fetch-depth: "100" + - name: Fetch + if: needs.setup.outputs.code_change == 'true' + run: git fetch --prune --tags -f + - uses: prefix-dev/setup-pixi@v0.5.1 + if: needs.setup.outputs.code_change == 'true' + id: install + with: + pixi-version: v0.19.0 + manifest-path: pyproject.toml + environments: ${{ matrix.environment }} + # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} + - uses: actions/upload-artifact@v4 + if: needs.setup.outputs.code_change == 'true' + with: + name: pixi-lock + path: pixi.lock + if-no-files-found: error + unit_test_suite: name: Unit tests on Python ${{ matrix.environment }}, ${{ matrix.os }} - needs: [pre_commit, setup] + needs: [pre_commit, setup, pixi_lock] runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -128,6 +155,10 @@ jobs: - name: Fetch if: needs.setup.outputs.code_change == 'true' run: git fetch --prune --tags -f + - uses: actions/download-artifact@v4 + with: + name: pixi-lock + path: . - uses: prefix-dev/setup-pixi@v0.5.1 if: needs.setup.outputs.code_change == 'true' id: install @@ -159,7 +190,7 @@ jobs: ui_test_suite: name: UI tests on Python ${{ matrix.environment }}, ${{ matrix.os }} - needs: [pre_commit, setup] + needs: [pre_commit, setup, pixi_lock] runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -178,6 +209,10 @@ jobs: - name: Fetch if: needs.setup.outputs.code_change == 'true' run: git fetch --prune --tags -f + - uses: actions/download-artifact@v4 + with: + name: pixi-lock + path: . - uses: prefix-dev/setup-pixi@v0.5.1 if: needs.setup.outputs.code_change == 'true' id: install @@ -202,7 +237,7 @@ jobs: core_test_suite: name: Core tests on Python ${{ matrix.environment }}, ${{ matrix.os }} - needs: [pre_commit, setup] + needs: [pre_commit, setup, pixi_lock] runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -220,6 +255,10 @@ jobs: - name: Fetch if: needs.setup.outputs.code_change == 'true' run: git fetch --prune --tags -f + - uses: actions/download-artifact@v4 + with: + name: pixi-lock + path: . - uses: prefix-dev/setup-pixi@v0.5.1 if: needs.setup.outputs.code_change == 'true' id: install From aba4511da01187168e6e6d277709275c7a665c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 10:53:20 +0200 Subject: [PATCH 18/92] examples -> example --- .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 497330f7f1..c270c942ad 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -182,7 +182,7 @@ jobs: - name: Test Examples if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} test-examples + pixi run -e ${{ matrix.environment }} test-example - name: codecov if: needs.setup.outputs.code_change == 'true' run: | From bb0eeb0ce04d5938bd77d11abaeb10a4d19d2b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 11:30:46 +0200 Subject: [PATCH 19/92] Disable dask_expr for now --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c270c942ad..94a8ab9590 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -43,6 +43,7 @@ env: NUMEXPR_NUM_THREADS: 1 NUMBA_NUM_THREADS: 1 PYDEVD_DISABLE_FILE_VALIDATION: 1 + DASK_DATAFRAME__QUERY_PLANNING: false jobs: pre_commit: From cfee98e8cf0ce91b89c2f4f2abdcc76dbbfe5d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 11:59:00 +0200 Subject: [PATCH 20/92] Update UI tests to work with osx-arm64 --- pyproject.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 40a2a0794a..9e59a3e93a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,8 +52,7 @@ recommended = ["ipython >=5.4.0", "notebook", "matplotlib >=3", "bokeh >=3.1"] [tool.pixi.project] name = "holoviews" channels = ["conda-forge", "pyviz/label/dev"] -# platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] -platforms = ["linux-64", "osx-64", "win-64"] +platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] [tool.pixi.tasks] check-latest-packages = 'python scripts/check_latest_packages.py' @@ -64,7 +63,7 @@ test-309 = ["py309", "test-core", "test", "examples"] test-310 = ["py310", "test-core", "test", "examples"] test-311 = ["py311", "test-core", "test", "examples"] test-312 = ["py312", "test-core", "test", "examples"] -test-ui = ["py311", "test-core", "test", "test-ui"] +test-ui = ["py312", "test-core", "test", "test-ui"] test-core = ["py312", "test-core"] docs = ["py311", "examples", "doc"] From 46a9a9a565bd261b5e6163f509dc0f0bf00ceaa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 12:05:42 +0200 Subject: [PATCH 21/92] Use depends on for test-ui --- .github/workflows/test.yaml | 1 - pyproject.toml | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 94a8ab9590..daeec822d8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -226,7 +226,6 @@ jobs: if: needs.setup.outputs.code_change == 'true' run: | pixi run -e ${{ matrix.environment }} download-data - pixi run -e ${{ matrix.environment }} install-ui - name: Test UI if: needs.setup.outputs.code_change == 'true' run: | diff --git a/pyproject.toml b/pyproject.toml index 9e59a3e93a..d2dd8ffbb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -152,7 +152,6 @@ notebook = ">=7.0" [tool.pixi.feature.test-ui] channels = ["conda-forge", "pyviz/label/dev", "microsoft"] -# dependencies = ["playwright", "pytest-playwright"] [tool.pixi.feature.test-ui.dependencies] playwright = "*" @@ -160,11 +159,10 @@ pytest-playwright = "*" [tool.pixi.feature.test-ui.tasks] install-ui = 'playwright install chromium' -test-ui = 'pytest holoviews --ui --browser chromium' -# test-ui = { -# cmd = ['pytest holoviews --cov=./holoviews --cov-report=xml --ui --browser chromium'], -# depends_on = ["activate"] -# } + +[tool.pixi.feature.test-ui.tasks.test-ui] +cmd = 'pytest holoviews --ui --browser chromium' +depends_on = ["install-ui"] [tool.pixi.feature.doc.dependencies] nbsite = ">=0.8.4,<0.9.0" From 40dd844c6fd5bf0967f9eb8230e2809733997ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 12:39:44 +0200 Subject: [PATCH 22/92] Add cache to pixi.lock file --- .github/workflows/test.yaml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index daeec822d8..2d346bd1f0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -114,17 +114,26 @@ jobs: pixi_lock: name: Pixi lock runs-on: ubuntu-latest - needs: [pre_commit, setup] + needs: [setup] steps: + - name: Set TODAY + run: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + - name: cache + if: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true' + id: cache + uses: actions/cache/restore@v4 + with: + path: pixi.lock + key: ${{ hashFiles('pyproject.toml') }}-${{ env.TODAY }} - uses: actions/checkout@v4 - if: needs.setup.outputs.code_change == 'true' + if: needs.setup.outputs.code_change == 'true' && steps.cache.outputs.cache-hit != 'true' with: fetch-depth: "100" - name: Fetch - if: needs.setup.outputs.code_change == 'true' + if: needs.setup.outputs.code_change == 'true' && steps.cache.outputs.cache-hit != 'true' run: git fetch --prune --tags -f - uses: prefix-dev/setup-pixi@v0.5.1 - if: needs.setup.outputs.code_change == 'true' + if: needs.setup.outputs.code_change == 'true' && steps.cache.outputs.cache-hit != 'true' id: install with: pixi-version: v0.19.0 @@ -137,6 +146,11 @@ jobs: name: pixi-lock path: pixi.lock if-no-files-found: error + - if: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true' && steps.cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: pixi.lock + key: ${{ hashFiles('pyproject.toml') }}-${{ env.TODAY }} unit_test_suite: name: Unit tests on Python ${{ matrix.environment }}, ${{ matrix.os }} From 7e6a1a3c41774a7acf8137308a77c5e8bf150db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 12:44:25 +0200 Subject: [PATCH 23/92] Init .git for pyproject cache --- .github/workflows/test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2d346bd1f0..f72f93f564 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -118,6 +118,10 @@ jobs: steps: - name: Set TODAY run: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + - uses: actions/checkout@v4 + if: needs.setup.outputs.code_change == 'true' + with: + fetch-depth: "100" - name: cache if: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true' id: cache @@ -125,10 +129,6 @@ jobs: with: path: pixi.lock key: ${{ hashFiles('pyproject.toml') }}-${{ env.TODAY }} - - uses: actions/checkout@v4 - if: needs.setup.outputs.code_change == 'true' && steps.cache.outputs.cache-hit != 'true' - with: - fetch-depth: "100" - name: Fetch if: needs.setup.outputs.code_change == 'true' && steps.cache.outputs.cache-hit != 'true' run: git fetch --prune --tags -f From 7e4e4372717ce827c2f802932dbcd7e0191c3b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 12:49:20 +0200 Subject: [PATCH 24/92] Clean up --- .github/workflows/test.yaml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f72f93f564..1f6b1024bf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -121,7 +121,7 @@ jobs: - uses: actions/checkout@v4 if: needs.setup.outputs.code_change == 'true' with: - fetch-depth: "100" + fetch-depth: "1" - name: cache if: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true' id: cache @@ -129,9 +129,6 @@ jobs: with: path: pixi.lock key: ${{ hashFiles('pyproject.toml') }}-${{ env.TODAY }} - - name: Fetch - if: needs.setup.outputs.code_change == 'true' && steps.cache.outputs.cache-hit != 'true' - run: git fetch --prune --tags -f - uses: prefix-dev/setup-pixi@v0.5.1 if: needs.setup.outputs.code_change == 'true' && steps.cache.outputs.cache-hit != 'true' id: install @@ -139,7 +136,6 @@ jobs: pixi-version: v0.19.0 manifest-path: pyproject.toml environments: ${{ matrix.environment }} - # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - uses: actions/upload-artifact@v4 if: needs.setup.outputs.code_change == 'true' with: @@ -181,7 +177,6 @@ jobs: pixi-version: v0.19.0 manifest-path: pyproject.toml environments: ${{ matrix.environment }} - # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | @@ -235,7 +230,6 @@ jobs: pixi-version: v0.19.0 manifest-path: pyproject.toml environments: ${{ matrix.environment }} - # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - name: Download data if: needs.setup.outputs.code_change == 'true' run: | @@ -280,7 +274,6 @@ jobs: pixi-version: v0.19.0 manifest-path: pyproject.toml environments: ${{ matrix.environment }} - # cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | From 87558f5bff1bc46b3b16100ceffdcee8b8097f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 13:06:39 +0200 Subject: [PATCH 25/92] Check test cache --- .github/workflows/test.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1f6b1024bf..62372fc01a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -142,7 +142,11 @@ jobs: name: pixi-lock path: pixi.lock if-no-files-found: error - - if: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true' && steps.cache.outputs.cache-hit != 'true' + - name: test + run: | + echo ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} + echo ${{ steps.cache.outputs.cache-hit }} + - if: (${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true') && (${{ steps.cache.outputs.cache-hit }} != 'true') uses: actions/cache/save@v4 with: path: pixi.lock From ebbc113e6c4513f085e53bcc86c7e31589d93c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 13:23:04 +0200 Subject: [PATCH 26/92] Clean up again --- .github/workflows/test.yaml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 62372fc01a..147012233e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -114,12 +114,10 @@ jobs: pixi_lock: name: Pixi lock runs-on: ubuntu-latest - needs: [setup] steps: - name: Set TODAY run: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - uses: actions/checkout@v4 - if: needs.setup.outputs.code_change == 'true' with: fetch-depth: "1" - name: cache @@ -130,23 +128,18 @@ jobs: path: pixi.lock key: ${{ hashFiles('pyproject.toml') }}-${{ env.TODAY }} - uses: prefix-dev/setup-pixi@v0.5.1 - if: needs.setup.outputs.code_change == 'true' && steps.cache.outputs.cache-hit != 'true' + if: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} != 'true' || steps.cache.outputs.cache-hit != 'true' id: install with: pixi-version: v0.19.0 manifest-path: pyproject.toml environments: ${{ matrix.environment }} - uses: actions/upload-artifact@v4 - if: needs.setup.outputs.code_change == 'true' with: name: pixi-lock path: pixi.lock if-no-files-found: error - - name: test - run: | - echo ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - echo ${{ steps.cache.outputs.cache-hit }} - - if: (${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true') && (${{ steps.cache.outputs.cache-hit }} != 'true') + - if: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true' && steps.cache.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: path: pixi.lock From c32f63d9d597d96b0699598babecff0875474d37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 14:08:46 +0200 Subject: [PATCH 27/92] Debug code --- .github/workflows/test.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 147012233e..b794c1fb56 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -127,8 +127,14 @@ jobs: with: path: pixi.lock key: ${{ hashFiles('pyproject.toml') }}-${{ env.TODAY }} + - name: test + run: | + echo ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} + echo ${{ github.event.inputs.cache }} + echo ${{ github.event.inputs.cache == '' }} + echo ${{ steps.cache.outputs.cache-hit }} - uses: prefix-dev/setup-pixi@v0.5.1 - if: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} != 'true' || steps.cache.outputs.cache-hit != 'true' + if: (${{ github.event.inputs.cache || github.event.inputs.cache == '' }} != 'true') || (steps.cache.outputs.cache-hit != 'true') id: install with: pixi-version: v0.19.0 @@ -139,7 +145,7 @@ jobs: name: pixi-lock path: pixi.lock if-no-files-found: error - - if: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true' && steps.cache.outputs.cache-hit != 'true' + - if: (${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true') && steps.cache.outputs.cache-hit != 'true') uses: actions/cache/save@v4 with: path: pixi.lock From 9e5a75949a2d199111bd0a0b7727148ad4dc2c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 14:16:49 +0200 Subject: [PATCH 28/92] Debug 2 --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b794c1fb56..cfb04ea1b0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -134,7 +134,7 @@ jobs: echo ${{ github.event.inputs.cache == '' }} echo ${{ steps.cache.outputs.cache-hit }} - uses: prefix-dev/setup-pixi@v0.5.1 - if: (${{ github.event.inputs.cache || github.event.inputs.cache == '' }} != 'true') || (steps.cache.outputs.cache-hit != 'true') + if: ((${{ github.event.inputs.cache || github.event.inputs.cache == '' }} != 'true') || (steps.cache.outputs.cache-hit != 'true')) id: install with: pixi-version: v0.19.0 @@ -145,7 +145,7 @@ jobs: name: pixi-lock path: pixi.lock if-no-files-found: error - - if: (${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true') && steps.cache.outputs.cache-hit != 'true') + - if: ((${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true') && steps.cache.outputs.cache-hit != 'true') uses: actions/cache/save@v4 with: path: pixi.lock From d4a214b436e4c20379649f11af0b7f3ee1458985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 14:28:37 +0200 Subject: [PATCH 29/92] Debug 3 --- .github/workflows/test.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cfb04ea1b0..3767989ffb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -133,8 +133,11 @@ jobs: echo ${{ github.event.inputs.cache }} echo ${{ github.event.inputs.cache == '' }} echo ${{ steps.cache.outputs.cache-hit }} + echo ${{ (github.event.inputs.cache || github.event.inputs.cache == '') != 'true' }} + echo ${{ steps.cache.outputs.cache-hit != 'true' }} - uses: prefix-dev/setup-pixi@v0.5.1 - if: ((${{ github.event.inputs.cache || github.event.inputs.cache == '' }} != 'true') || (steps.cache.outputs.cache-hit != 'true')) + # if: ((${{ github.event.inputs.cache || github.event.inputs.cache == '' }} != 'true') || (steps.cache.outputs.cache-hit != 'true')) + if: ${{ (github.event.inputs.cache || github.event.inputs.cache == '') != 'true' || (steps.cache.outputs.cache-hit != 'true') }} id: install with: pixi-version: v0.19.0 @@ -145,7 +148,8 @@ jobs: name: pixi-lock path: pixi.lock if-no-files-found: error - - if: ((${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true') && steps.cache.outputs.cache-hit != 'true') + # - if: ((${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true') && steps.cache.outputs.cache-hit != 'true') + - if: ${{ (github.event.inputs.cache || github.event.inputs.cache == '') && (steps.cache.outputs.cache-hit != 'true') }} uses: actions/cache/save@v4 with: path: pixi.lock From 934ff5e889ab507286c286d03018cfcdbcb35095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 14:38:20 +0200 Subject: [PATCH 30/92] Debug 4 --- .github/workflows/test.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3767989ffb..6524fa8a0a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -121,7 +121,7 @@ jobs: with: fetch-depth: "1" - name: cache - if: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true' + if: github.event.inputs.cache == 'true' || github.event.inputs.cache == '' id: cache uses: actions/cache/restore@v4 with: @@ -137,7 +137,7 @@ jobs: echo ${{ steps.cache.outputs.cache-hit != 'true' }} - uses: prefix-dev/setup-pixi@v0.5.1 # if: ((${{ github.event.inputs.cache || github.event.inputs.cache == '' }} != 'true') || (steps.cache.outputs.cache-hit != 'true')) - if: ${{ (github.event.inputs.cache || github.event.inputs.cache == '') != 'true' || (steps.cache.outputs.cache-hit != 'true') }} + if: steps.cache.outputs.cache-hit != 'true' id: install with: pixi-version: v0.19.0 @@ -149,7 +149,7 @@ jobs: path: pixi.lock if-no-files-found: error # - if: ((${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true') && steps.cache.outputs.cache-hit != 'true') - - if: ${{ (github.event.inputs.cache || github.event.inputs.cache == '') && (steps.cache.outputs.cache-hit != 'true') }} + - if: ${{ (github.event.inputs.cache == 'true' || github.event.inputs.cache == '') && (steps.cache.outputs.cache-hit != 'true') }} uses: actions/cache/save@v4 with: path: pixi.lock From bd4ce48fb8e5b484a96d6c179d47146404723d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 14:46:23 +0200 Subject: [PATCH 31/92] Clean up --- .github/workflows/test.yaml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6524fa8a0a..e202c90b12 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -127,16 +127,7 @@ jobs: with: path: pixi.lock key: ${{ hashFiles('pyproject.toml') }}-${{ env.TODAY }} - - name: test - run: | - echo ${{ github.event.inputs.cache || github.event.inputs.cache == '' }} - echo ${{ github.event.inputs.cache }} - echo ${{ github.event.inputs.cache == '' }} - echo ${{ steps.cache.outputs.cache-hit }} - echo ${{ (github.event.inputs.cache || github.event.inputs.cache == '') != 'true' }} - echo ${{ steps.cache.outputs.cache-hit != 'true' }} - uses: prefix-dev/setup-pixi@v0.5.1 - # if: ((${{ github.event.inputs.cache || github.event.inputs.cache == '' }} != 'true') || (steps.cache.outputs.cache-hit != 'true')) if: steps.cache.outputs.cache-hit != 'true' id: install with: @@ -148,8 +139,7 @@ jobs: name: pixi-lock path: pixi.lock if-no-files-found: error - # - if: ((${{ github.event.inputs.cache || github.event.inputs.cache == '' }} == 'true') && steps.cache.outputs.cache-hit != 'true') - - if: ${{ (github.event.inputs.cache == 'true' || github.event.inputs.cache == '') && (steps.cache.outputs.cache-hit != 'true') }} + - if: (github.event.inputs.cache == 'true' || github.event.inputs.cache == '') && (steps.cache.outputs.cache-hit != 'true') uses: actions/cache/save@v4 with: path: pixi.lock From 4c2d194acce313ab945d96589bffb380942213b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 14:48:01 +0200 Subject: [PATCH 32/92] Update key --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e202c90b12..1c012c26e8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -126,7 +126,7 @@ jobs: uses: actions/cache/restore@v4 with: path: pixi.lock - key: ${{ hashFiles('pyproject.toml') }}-${{ env.TODAY }} + key: pixi|${{ env.TODAY }}|${{ hashFiles('pyproject.toml') }} - uses: prefix-dev/setup-pixi@v0.5.1 if: steps.cache.outputs.cache-hit != 'true' id: install @@ -143,7 +143,7 @@ jobs: uses: actions/cache/save@v4 with: path: pixi.lock - key: ${{ hashFiles('pyproject.toml') }}-${{ env.TODAY }} + key: pixi|${{ env.TODAY }}|${{ hashFiles('pyproject.toml') }} unit_test_suite: name: Unit tests on Python ${{ matrix.environment }}, ${{ matrix.os }} From ea8fa828aad404567fcde50eff274f940fe0e6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 15:32:34 +0200 Subject: [PATCH 33/92] Update checkout --- .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 1c012c26e8..a377519992 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -61,7 +61,7 @@ jobs: code_change: ${{ steps.filter.outputs.code }} matrix: ${{ env.MATRIX }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 if: github.event_name != 'pull_request' - name: Check for code changes uses: dorny/paths-filter@v3 From cb418b31e1e92878806189b52e9304ff42761ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 16:39:59 +0200 Subject: [PATCH 34/92] Switch to pixi.toml --- .github/workflows/test.yaml | 15 +++-- pixi.toml | 120 +++++++++++++++++++++++++++++++++++ pyproject.toml | 121 ------------------------------------ 3 files changed, 127 insertions(+), 129 deletions(-) create mode 100644 pixi.toml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a377519992..8c8043cab5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -71,8 +71,7 @@ jobs: code: - 'holoviews/**' - 'examples/**' - - 'setup.py' - - 'pyproject.toml' + - 'pixi.toml' - '.github/workflows/test.yaml' - name: Set matrix option run: | @@ -126,13 +125,13 @@ jobs: uses: actions/cache/restore@v4 with: path: pixi.lock - key: pixi|${{ env.TODAY }}|${{ hashFiles('pyproject.toml') }} + key: pixi|${{ env.TODAY }}|${{ hashFiles('pixi.toml') }} - uses: prefix-dev/setup-pixi@v0.5.1 if: steps.cache.outputs.cache-hit != 'true' id: install with: pixi-version: v0.19.0 - manifest-path: pyproject.toml + manifest-path: pixi.toml environments: ${{ matrix.environment }} - uses: actions/upload-artifact@v4 with: @@ -143,7 +142,7 @@ jobs: uses: actions/cache/save@v4 with: path: pixi.lock - key: pixi|${{ env.TODAY }}|${{ hashFiles('pyproject.toml') }} + key: pixi|${{ env.TODAY }}|${{ hashFiles('pixi.toml') }} unit_test_suite: name: Unit tests on Python ${{ matrix.environment }}, ${{ matrix.os }} @@ -172,7 +171,7 @@ jobs: id: install with: pixi-version: v0.19.0 - manifest-path: pyproject.toml + manifest-path: pixi.toml environments: ${{ matrix.environment }} - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' @@ -225,7 +224,7 @@ jobs: id: install with: pixi-version: v0.19.0 - manifest-path: pyproject.toml + manifest-path: pixi.toml environments: ${{ matrix.environment }} - name: Download data if: needs.setup.outputs.code_change == 'true' @@ -269,7 +268,7 @@ jobs: id: install with: pixi-version: v0.19.0 - manifest-path: pyproject.toml + manifest-path: pixi.toml environments: ${{ matrix.environment }} - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' diff --git a/pixi.toml b/pixi.toml new file mode 100644 index 0000000000..7bf3d68dd5 --- /dev/null +++ b/pixi.toml @@ -0,0 +1,120 @@ +[project] +name = "holoviews" +channels = ["conda-forge", "pyviz/label/dev"] +platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] + +[tasks] +check-latest-packages = 'python scripts/check_latest_packages.py' +download-data = 'bash scripts/download_data.sh' + +[environments] +test-309 = ["py309", "test-core", "test", "examples"] +test-310 = ["py310", "test-core", "test", "examples"] +test-311 = ["py311", "test-core", "test", "examples"] +test-312 = ["py312", "test-core", "test", "examples"] +test-ui = ["py312", "test-core", "test", "test-ui"] +test-core = ["py312", "test-core"] +docs = ["py311", "examples", "doc"] + +[dependencies] +python = ">=3.9" +param = ">=1.12.0,<3.0" +panel = ">=1.0" +pyviz_comms = ">=2.1" +colorcet = "*" +numpy = ">=1.0" +packaging = "*" +pandas = ">=0.20.0" +ipython = ">=5.4.0" +notebook = "*" +matplotlib-base = ">=3" +bokeh = ">=3.1" + +[pypi-dependencies] +holoviews = { path = ".", editable = true } + +[feature.py309.dependencies] +python = "3.9.*" + +[feature.py310.dependencies] +python = "3.10.*" + +[feature.py311.dependencies] +python = "3.11.*" + +[feature.py312.dependencies] +python = "3.12.*" + +[feature.test-core.dependencies] +pytest = "*" +pytest-cov = "*" +pytest-xdist = "*" +pytest-rerunfailures = "*" +matplotlib-base = ">=3" +nbconvert = "*" +bokeh = ">=3.1" +pillow = "*" +plotly = ">=4.0" +ipython = ">=5.4.0" +contourpy = "*" +pytest-github-actions-annotate-failures = "*" + +[feature.test-core.tasks] +test-unit = 'pytest holoviews' +test-example = 'pytest -n auto --dist loadscope --nbval-lax examples' + +[feature.test.dependencies] +dask-core = "*" +ibis-sqlite = "*" +xarray = ">=0.10.4" +networkx = "*" +shapely = "*" +ffmpeg = "*" +cftime = "*" +scipy = ">=1.10" # Python 3.9 + Windows downloads 1.9 +selenium = "*" +spatialpandas = "*" +datashader = ">=0.11.1" +nbval = "*" +codecov = "*" +# dash >=1.16 +# tsdownsample = "*" # not windows + +[feature.examples.dependencies] +networkx = "*" +pillow = "*" +xarray = ">=0.10.4" +plotly = ">=4.0" +# dash >=1.16 +streamz = ">=0.5.0" +ffmpeg = "*" +cftime = "*" +netcdf4 = "*" +dask-core = "*" +scipy = "*" +shapely = "*" +scikit-image = "*" +pyarrow = "*" +pooch = "*" +datashader = ">=0.11.1" +notebook = ">=7.0" + +[feature.test-ui] +channels = ["conda-forge", "pyviz/label/dev", "microsoft"] + +[feature.test-ui.dependencies] +playwright = "*" +pytest-playwright = "*" + +[feature.test-ui.tasks] +install-ui = 'playwright install chromium' + +[feature.test-ui.tasks.test-ui] +cmd = 'pytest holoviews --ui --browser chromium' +depends_on = ["install-ui"] + +[feature.doc.dependencies] +nbsite = ">=0.8.4,<0.9.0" +graphviz = "*" +pooch = "*" +selenium = "*" diff --git a/pyproject.toml b/pyproject.toml index d2dd8ffbb0..78a8948acc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,127 +49,6 @@ HoloViz = "https://holoviz.org/" [project.optional-dependencies] recommended = ["ipython >=5.4.0", "notebook", "matplotlib >=3", "bokeh >=3.1"] -[tool.pixi.project] -name = "holoviews" -channels = ["conda-forge", "pyviz/label/dev"] -platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] - -[tool.pixi.tasks] -check-latest-packages = 'python scripts/check_latest_packages.py' -download-data = 'bash scripts/download_data.sh' - -[tool.pixi.environments] -test-309 = ["py309", "test-core", "test", "examples"] -test-310 = ["py310", "test-core", "test", "examples"] -test-311 = ["py311", "test-core", "test", "examples"] -test-312 = ["py312", "test-core", "test", "examples"] -test-ui = ["py312", "test-core", "test", "test-ui"] -test-core = ["py312", "test-core"] -docs = ["py311", "examples", "doc"] - -[tool.pixi.dependencies] -python = ">=3.9" -param = ">=1.12.0,<3.0" -panel = ">=1.0" -pyviz_comms = ">=2.1" -colorcet = "*" -numpy = ">=1.0" -packaging = "*" -pandas = ">=0.20.0" -ipython = ">=5.4.0" -notebook = "*" -matplotlib-base = ">=3" -bokeh = ">=3.1" - -[tool.pixi.pypi-dependencies] -holoviews = { path = ".", editable = true } - -[tool.pixi.feature.py309.dependencies] -python = "3.9.*" - -[tool.pixi.feature.py310.dependencies] -python = "3.10.*" - -[tool.pixi.feature.py311.dependencies] -python = "3.11.*" - -[tool.pixi.feature.py312.dependencies] -python = "3.12.*" - -[tool.pixi.feature.test-core.dependencies] -pytest = "*" -pytest-cov = "*" -pytest-xdist = "*" -pytest-rerunfailures = "*" -matplotlib-base = ">=3" -nbconvert = "*" -bokeh = ">=3.1" -pillow = "*" -plotly = ">=4.0" -ipython = ">=5.4.0" -contourpy = "*" -pytest-github-actions-annotate-failures = "*" - -[tool.pixi.feature.test-core.tasks] -test-unit = 'pytest holoviews' -test-example = 'pytest -n auto --dist loadscope --nbval-lax examples' - -[tool.pixi.feature.test.dependencies] -dask-core = "*" -ibis-sqlite = "*" -xarray = ">=0.10.4" -networkx = "*" -shapely = "*" -ffmpeg = "*" -cftime = "*" -scipy = ">=1.10" # Python 3.9 + Windows downloads 1.9 -selenium = "*" -spatialpandas = "*" -datashader = ">=0.11.1" -nbval = "*" -codecov = "*" -# dash >=1.16 -# tsdownsample = "*" # not windows - -[tool.pixi.feature.examples.dependencies] -networkx = "*" -pillow = "*" -xarray = ">=0.10.4" -plotly = ">=4.0" -# dash >=1.16 -streamz = ">=0.5.0" -ffmpeg = "*" -cftime = "*" -netcdf4 = "*" -dask-core = "*" -scipy = "*" -shapely = "*" -scikit-image = "*" -pyarrow = "*" -pooch = "*" -datashader = ">=0.11.1" -notebook = ">=7.0" - -[tool.pixi.feature.test-ui] -channels = ["conda-forge", "pyviz/label/dev", "microsoft"] - -[tool.pixi.feature.test-ui.dependencies] -playwright = "*" -pytest-playwright = "*" - -[tool.pixi.feature.test-ui.tasks] -install-ui = 'playwright install chromium' - -[tool.pixi.feature.test-ui.tasks.test-ui] -cmd = 'pytest holoviews --ui --browser chromium' -depends_on = ["install-ui"] - -[tool.pixi.feature.doc.dependencies] -nbsite = ">=0.8.4,<0.9.0" -graphviz = "*" -pooch = "*" -selenium = "*" - [tool.setuptools] include-package-data = true From 931aa01cb4a8f6301224d2433bfffd304fbd2a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 16:51:54 +0200 Subject: [PATCH 35/92] Clean up --- pixi.toml | 66 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/pixi.toml b/pixi.toml index 7bf3d68dd5..23df2b6426 100644 --- a/pixi.toml +++ b/pixi.toml @@ -8,13 +8,13 @@ check-latest-packages = 'python scripts/check_latest_packages.py' download-data = 'bash scripts/download_data.sh' [environments] -test-309 = ["py309", "test-core", "test", "examples"] -test-310 = ["py310", "test-core", "test", "examples"] -test-311 = ["py311", "test-core", "test", "examples"] -test-312 = ["py312", "test-core", "test", "examples"] +test-309 = ["py309", "test-core", "test", "example", "test-example"] +test-310 = ["py310", "test-core", "test", "example", "test-example"] +test-311 = ["py311", "test-core", "test", "example", "test-example"] +test-312 = ["py312", "test-core", "test", "example", "test-example"] test-ui = ["py312", "test-core", "test", "test-ui"] test-core = ["py312", "test-core"] -docs = ["py311", "examples", "doc"] +docs = ["py311", "example", "doc"] [dependencies] python = ">=3.9" @@ -25,6 +25,7 @@ colorcet = "*" numpy = ">=1.0" packaging = "*" pandas = ">=0.20.0" +# Recommended ipython = ">=5.4.0" notebook = "*" matplotlib-base = ">=3" @@ -45,23 +46,40 @@ python = "3.11.*" [feature.py312.dependencies] python = "3.12.*" +[feature.example.dependencies] +networkx = "*" +pillow = "*" +xarray = ">=0.10.4" +plotly = ">=4.0" +# dash >=1.16 +streamz = ">=0.5.0" +ffmpeg = "*" +cftime = "*" +netcdf4 = "*" +dask-core = "*" +scipy = "*" +shapely = "*" +scikit-image = "*" +pyarrow = "*" +pooch = "*" +datashader = ">=0.11.1" +notebook = ">=7.0" + +# ============================================= +# =================== TESTS =================== +# ============================================= [feature.test-core.dependencies] pytest = "*" pytest-cov = "*" -pytest-xdist = "*" pytest-rerunfailures = "*" -matplotlib-base = ">=3" nbconvert = "*" -bokeh = ">=3.1" pillow = "*" plotly = ">=4.0" -ipython = ">=5.4.0" contourpy = "*" pytest-github-actions-annotate-failures = "*" [feature.test-core.tasks] test-unit = 'pytest holoviews' -test-example = 'pytest -n auto --dist loadscope --nbval-lax examples' [feature.test.dependencies] dask-core = "*" @@ -75,29 +93,16 @@ scipy = ">=1.10" # Python 3.9 + Windows downloads 1.9 selenium = "*" spatialpandas = "*" datashader = ">=0.11.1" -nbval = "*" codecov = "*" # dash >=1.16 # tsdownsample = "*" # not windows -[feature.examples.dependencies] -networkx = "*" -pillow = "*" -xarray = ">=0.10.4" -plotly = ">=4.0" -# dash >=1.16 -streamz = ">=0.5.0" -ffmpeg = "*" -cftime = "*" -netcdf4 = "*" -dask-core = "*" -scipy = "*" -shapely = "*" -scikit-image = "*" -pyarrow = "*" -pooch = "*" -datashader = ">=0.11.1" -notebook = ">=7.0" +[feature.test-example.tasks] +test-example = 'pytest -n auto --dist loadscope --nbval-lax examples' + +[feature.test-example.dependencies] +nbval = "*" +pytest-xdist = "*" [feature.test-ui] channels = ["conda-forge", "pyviz/label/dev", "microsoft"] @@ -113,6 +118,9 @@ install-ui = 'playwright install chromium' cmd = 'pytest holoviews --ui --browser chromium' depends_on = ["install-ui"] +# ============================================= +# =================== DOCS ==================== +# ============================================= [feature.doc.dependencies] nbsite = ">=0.8.4,<0.9.0" graphviz = "*" From 94eb02df92a87dbc6aeb3a66aebb02bb0acd207a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 17:54:21 +0200 Subject: [PATCH 36/92] Try without cache --- .github/workflows/test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8c8043cab5..45b20c97d1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -173,6 +173,7 @@ jobs: pixi-version: v0.19.0 manifest-path: pixi.toml environments: ${{ matrix.environment }} + cache: false - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | @@ -226,6 +227,7 @@ jobs: pixi-version: v0.19.0 manifest-path: pixi.toml environments: ${{ matrix.environment }} + cache: false - name: Download data if: needs.setup.outputs.code_change == 'true' run: | @@ -270,6 +272,7 @@ jobs: pixi-version: v0.19.0 manifest-path: pixi.toml environments: ${{ matrix.environment }} + cache: false - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | From ed4d4ab5b1da1058e0c2b4dba77262610c5c41f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 18:14:27 +0200 Subject: [PATCH 37/92] Remove editable --- pixi.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixi.toml b/pixi.toml index 23df2b6426..969eb69d4d 100644 --- a/pixi.toml +++ b/pixi.toml @@ -32,7 +32,7 @@ matplotlib-base = ">=3" bokeh = ">=3.1" [pypi-dependencies] -holoviews = { path = ".", editable = true } +holoviews = { path = "."} [feature.py309.dependencies] python = "3.9.*" From dd2ca4013abd1d75cd71c65018fed1e181e31c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 18:15:09 +0200 Subject: [PATCH 38/92] Add version file to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2957709938..6781085cdb 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ .coverage .pytest_cache .pixi +holoviews/_version.py /release /doc/Tutorials-WIP/*.ipynb From 956bc95737e32e1e36ffdbcbfc4509de5f6d88ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 18:18:57 +0200 Subject: [PATCH 39/92] Reduce collection of test --- pixi.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixi.toml b/pixi.toml index 969eb69d4d..80c4e33cbb 100644 --- a/pixi.toml +++ b/pixi.toml @@ -115,7 +115,7 @@ pytest-playwright = "*" install-ui = 'playwright install chromium' [feature.test-ui.tasks.test-ui] -cmd = 'pytest holoviews --ui --browser chromium' +cmd = 'pytest holoviews/tests/ui --ui --browser chromium' depends_on = ["install-ui"] # ============================================= From 1daccd3920a4cf622c7fd6c8c913381bf87f8300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 18:20:36 +0200 Subject: [PATCH 40/92] Formatting --- .github/workflows/pixi_lock.yaml | 44 ++++++++++++++++++++++++++++++++ .github/workflows/test.yaml | 30 ++-------------------- pixi.toml | 4 +-- 3 files changed, 48 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/pixi_lock.yaml diff --git a/.github/workflows/pixi_lock.yaml b/.github/workflows/pixi_lock.yaml new file mode 100644 index 0000000000..7a4197b408 --- /dev/null +++ b/.github/workflows/pixi_lock.yaml @@ -0,0 +1,44 @@ +name: Pixi lock +description: Get or create the pixi.lock +inputs: + cache: + description: Whether to enable caching of the lock-file + required: true + default: "true" + +runs: + using: "composite" + steps: + - name: Set TODAY + run: | + echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + - uses: actions/checkout@v4 + with: + fetch-depth: "1" + - uses: actions/checkout@v4 + with: + fetch-depth: "1" + - name: cache + - if: inputs.cache == 'true' + id: cache + uses: actions/cache/restore@v4 + with: + path: pixi.lock + key: pixi|${{ env.TODAY }}|${{ hashFiles('pixi.toml') }} + - uses: prefix-dev/setup-pixi@v0.5.1 + if: steps.cache.outputs.cache-hit != 'true' + id: install + with: + pixi-version: v0.19.0 + manifest-path: pixi.toml + environments: ${{ matrix.environment }} + - uses: actions/upload-artifact@v4 + with: + name: pixi-lock + path: pixi.lock + if-no-files-found: error + - if: inputs.cache == 'true' && steps.cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: pixi.lock + key: pixi|${{ env.TODAY }}|${{ hashFiles('pixi.toml') }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 45b20c97d1..b91a808962 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -114,35 +114,9 @@ jobs: name: Pixi lock runs-on: ubuntu-latest steps: - - name: Set TODAY - run: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - - uses: actions/checkout@v4 - with: - fetch-depth: "1" - - name: cache - if: github.event.inputs.cache == 'true' || github.event.inputs.cache == '' - id: cache - uses: actions/cache/restore@v4 - with: - path: pixi.lock - key: pixi|${{ env.TODAY }}|${{ hashFiles('pixi.toml') }} - - uses: prefix-dev/setup-pixi@v0.5.1 - if: steps.cache.outputs.cache-hit != 'true' - id: install - with: - pixi-version: v0.19.0 - manifest-path: pixi.toml - environments: ${{ matrix.environment }} - - uses: actions/upload-artifact@v4 - with: - name: pixi-lock - path: pixi.lock - if-no-files-found: error - - if: (github.event.inputs.cache == 'true' || github.event.inputs.cache == '') && (steps.cache.outputs.cache-hit != 'true') - uses: actions/cache/save@v4 + - uses: ./pixi_lock@pixi_play with: - path: pixi.lock - key: pixi|${{ env.TODAY }}|${{ hashFiles('pixi.toml') }} + cache: ${{ github.event.inputs.cache == 'true' || github.event.inputs.cache == '' }} unit_test_suite: name: Unit tests on Python ${{ matrix.environment }}, ${{ matrix.os }} diff --git a/pixi.toml b/pixi.toml index 80c4e33cbb..87067dd6e1 100644 --- a/pixi.toml +++ b/pixi.toml @@ -32,7 +32,7 @@ matplotlib-base = ">=3" bokeh = ">=3.1" [pypi-dependencies] -holoviews = { path = "."} +holoviews = { path = "." } [feature.py309.dependencies] python = "3.9.*" @@ -89,7 +89,7 @@ networkx = "*" shapely = "*" ffmpeg = "*" cftime = "*" -scipy = ">=1.10" # Python 3.9 + Windows downloads 1.9 +scipy = ">=1.10" # Python 3.9 + Windows downloads 1.9 selenium = "*" spatialpandas = "*" datashader = ">=0.11.1" From 93b7486c7cc9609fc3d675f30e5036a780606150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 19:01:14 +0200 Subject: [PATCH 41/92] Move to install task --- .github/workflows/pixi_lock.yaml | 44 -------------------------------- .github/workflows/test.yaml | 2 +- 2 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 .github/workflows/pixi_lock.yaml diff --git a/.github/workflows/pixi_lock.yaml b/.github/workflows/pixi_lock.yaml deleted file mode 100644 index 7a4197b408..0000000000 --- a/.github/workflows/pixi_lock.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: Pixi lock -description: Get or create the pixi.lock -inputs: - cache: - description: Whether to enable caching of the lock-file - required: true - default: "true" - -runs: - using: "composite" - steps: - - name: Set TODAY - run: | - echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - - uses: actions/checkout@v4 - with: - fetch-depth: "1" - - uses: actions/checkout@v4 - with: - fetch-depth: "1" - - name: cache - - if: inputs.cache == 'true' - id: cache - uses: actions/cache/restore@v4 - with: - path: pixi.lock - key: pixi|${{ env.TODAY }}|${{ hashFiles('pixi.toml') }} - - uses: prefix-dev/setup-pixi@v0.5.1 - if: steps.cache.outputs.cache-hit != 'true' - id: install - with: - pixi-version: v0.19.0 - manifest-path: pixi.toml - environments: ${{ matrix.environment }} - - uses: actions/upload-artifact@v4 - with: - name: pixi-lock - path: pixi.lock - if-no-files-found: error - - if: inputs.cache == 'true' && steps.cache.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: pixi.lock - key: pixi|${{ env.TODAY }}|${{ hashFiles('pixi.toml') }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b91a808962..5a5a2c6dae 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -114,7 +114,7 @@ jobs: name: Pixi lock runs-on: ubuntu-latest steps: - - uses: ./pixi_lock@pixi_play + - uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi with: cache: ${{ github.event.inputs.cache == 'true' || github.event.inputs.cache == '' }} From 59c76937cf5d88f5078fea60c526ca0c041cef18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 19:14:34 +0200 Subject: [PATCH 42/92] Add back pyproject.toml --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5a5a2c6dae..3ad0ef6663 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -72,6 +72,7 @@ jobs: - 'holoviews/**' - 'examples/**' - 'pixi.toml' + - 'pyproject.toml' - '.github/workflows/test.yaml' - name: Set matrix option run: | From 5028622a17727684f9b7a2f6dea41eea135fce95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 19:25:22 +0200 Subject: [PATCH 43/92] Add pixi_install composite --- .github/workflows/test.yaml | 56 ++----------------------------------- 1 file changed, 3 insertions(+), 53 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3ad0ef6663..8850bb8d35 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -127,28 +127,11 @@ jobs: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.matrix) }} timeout-minutes: 120 - env: - DESC: "Python ${{ matrix.environment }}, ${{ matrix.os }} unit tests" steps: - - uses: actions/checkout@v4 + - uses: holoviz-dev/holoviz_tasks/pixi_install@pixi if: needs.setup.outputs.code_change == 'true' with: - fetch-depth: "100" - - name: Fetch - if: needs.setup.outputs.code_change == 'true' - run: git fetch --prune --tags -f - - uses: actions/download-artifact@v4 - with: - name: pixi-lock - path: . - - uses: prefix-dev/setup-pixi@v0.5.1 - if: needs.setup.outputs.code_change == 'true' - id: install - with: - pixi-version: v0.19.0 - manifest-path: pixi.toml environments: ${{ matrix.environment }} - cache: false - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | @@ -181,28 +164,12 @@ jobs: environment: ["test-ui"] timeout-minutes: 60 env: - DESC: "Python ${{ matrix.environment }}, ${{ matrix.os }} UI tests" PANEL_LOG_LEVEL: info steps: - - uses: actions/checkout@v4 - if: needs.setup.outputs.code_change == 'true' - with: - fetch-depth: "100" - - name: Fetch + - uses: holoviz-dev/holoviz_tasks/pixi_install@pixi if: needs.setup.outputs.code_change == 'true' - run: git fetch --prune --tags -f - - uses: actions/download-artifact@v4 with: - name: pixi-lock - path: . - - uses: prefix-dev/setup-pixi@v0.5.1 - if: needs.setup.outputs.code_change == 'true' - id: install - with: - pixi-version: v0.19.0 - manifest-path: pixi.toml environments: ${{ matrix.environment }} - cache: false - name: Download data if: needs.setup.outputs.code_change == 'true' run: | @@ -226,28 +193,11 @@ jobs: os: ["ubuntu-latest"] environment: ["test-core"] timeout-minutes: 120 - env: - DESC: "Python ${{ matrix.environment }}, ${{ matrix.os }} core tests" steps: - - uses: actions/checkout@v4 - if: needs.setup.outputs.code_change == 'true' - with: - fetch-depth: "100" - - name: Fetch - if: needs.setup.outputs.code_change == 'true' - run: git fetch --prune --tags -f - - uses: actions/download-artifact@v4 - with: - name: pixi-lock - path: . - - uses: prefix-dev/setup-pixi@v0.5.1 + - uses: holoviz-dev/holoviz_tasks/pixi_install@pixi if: needs.setup.outputs.code_change == 'true' - id: install with: - pixi-version: v0.19.0 - manifest-path: pixi.toml environments: ${{ matrix.environment }} - cache: false - name: Check packages latest version if: needs.setup.outputs.code_change == 'true' run: | From 6333061e6909f1e5eec391bef3d0313a75d82062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 19:43:38 +0200 Subject: [PATCH 44/92] Try docs --- .github/workflows/docs.yaml | 28 +++++----------------------- pixi.toml | 8 ++++++++ 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 578df685c2..89584ff8f4 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -40,34 +40,16 @@ jobs: PANEL_EMBED_JSON: "true" PANEL_EMBED_JSON_PREFIX: "json" steps: - - uses: holoviz-dev/holoviz_tasks/install@v0 + - uses: holoviz-dev/holoviz_tasks/pixi_install@pixi with: - name: Documentation - python-version: "3.10" - channel-priority: flexible - channels: pyviz/label/dev,conda-forge,nodefaults - envs: "-o doc" - cache: true - conda-update: true + environments: docs - name: Set output id: vars run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Download data - run: | - conda activate test-environment - bash scripts/download_data.sh - - name: generate rst - run: | - conda activate test-environment - nbsite generate-rst --org holoviz --project-name holoviews - - name: refmanual - run: | - conda activate test-environment - python ./doc/generate_modules.py holoviews -d ./doc/reference_manual -n holoviews -e tests - - name: build docs - run: | - conda activate test-environment - nbsite build --what=html --output=builtdocs --org holoviz --project-name holoviews + run: pixi run -e docs download-data + - name: Build documentation + run: pixi run -e docs build - name: upload dev if: | (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'dev') || diff --git a/pixi.toml b/pixi.toml index 87067dd6e1..e0ffa5b19b 100644 --- a/pixi.toml +++ b/pixi.toml @@ -126,3 +126,11 @@ nbsite = ">=0.8.4,<0.9.0" graphviz = "*" pooch = "*" selenium = "*" + +[feature.doc.tasks] +generate-rst = 'nbsite generate-rst --org holoviz --project-name holoviews' +refmanual = 'python ./doc/generate_modules.py holoviews -d ./doc/reference_manual -n holoviews -e tests' +build-docs = 'nbsite build --what=html --output=builtdocs --org holoviz --project-name holoviews' + +[feature.doc.tasks.build] +depends_on = ['generate-rst', 'refmanual', 'build-docs'] From ff09ac9bee8682128330317007ccc02bead5f1c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 19:47:03 +0200 Subject: [PATCH 45/92] Add pixi lock step --- .github/workflows/docs.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 89584ff8f4..89858336ff 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -21,8 +21,15 @@ on: - cron: "0 14 * * SUN" jobs: + pixi_lock: + name: Pixi lock + runs-on: ubuntu-latest + steps: + - uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi + build_docs: name: Documentation + needs: [pixi_lock] runs-on: "ubuntu-latest" timeout-minutes: 120 defaults: From b6bf7c1ea225c1dccd7d4493801c59148e2d5826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 11 Apr 2024 20:04:08 +0200 Subject: [PATCH 46/92] Move download-data step to install task --- .github/workflows/docs.yaml | 2 -- .github/workflows/test.yaml | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 89858336ff..7216abd29f 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -53,8 +53,6 @@ jobs: - name: Set output id: vars run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - - name: Download data - run: pixi run -e docs download-data - name: Build documentation run: pixi run -e docs build - name: upload dev diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8850bb8d35..96714af2d9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -136,10 +136,6 @@ jobs: if: needs.setup.outputs.code_change == 'true' run: | pixi run -e ${{ matrix.environment }} check-latest-packages bokeh panel param datashader - - name: Download data - if: needs.setup.outputs.code_change == 'true' - run: | - pixi run -e ${{ matrix.environment }} download-data - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | @@ -170,10 +166,6 @@ jobs: if: needs.setup.outputs.code_change == 'true' with: environments: ${{ matrix.environment }} - - name: Download data - if: needs.setup.outputs.code_change == 'true' - run: | - pixi run -e ${{ matrix.environment }} download-data - name: Test UI if: needs.setup.outputs.code_change == 'true' run: | @@ -202,10 +194,6 @@ jobs: if: needs.setup.outputs.code_change == 'true' run: | pixi run -e ${{ matrix.environment }} check-latest-packages numpy pandas bokeh panel param - - name: Download data - if: needs.setup.outputs.code_change == 'true' - run: | - pixi run -e ${{ matrix.environment }} download-data - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | From 03c963cbcc60c690c1962356e51120a7962fc50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 09:54:59 +0200 Subject: [PATCH 47/92] Make download data a python file --- pixi.toml | 2 +- scripts/download_data.py | 13 +++++++++++++ scripts/download_data.sh | 17 ----------------- 3 files changed, 14 insertions(+), 18 deletions(-) create mode 100644 scripts/download_data.py delete mode 100755 scripts/download_data.sh diff --git a/pixi.toml b/pixi.toml index e0ffa5b19b..b6fabbd48f 100644 --- a/pixi.toml +++ b/pixi.toml @@ -5,7 +5,7 @@ platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] [tasks] check-latest-packages = 'python scripts/check_latest_packages.py' -download-data = 'bash scripts/download_data.sh' +download-data = 'python scripts/download_data.py' [environments] test-309 = ["py309", "test-core", "test", "example", "test-example"] diff --git a/scripts/download_data.py b/scripts/download_data.py new file mode 100644 index 0000000000..291c50ab83 --- /dev/null +++ b/scripts/download_data.py @@ -0,0 +1,13 @@ +import bokeh.sampledata + +bokeh.sampledata.download() + +try: + import pooch # noqa: F401 + import scipy # noqa: F401 + import xarray as xr +except ImportError: + pass +else: + xr.tutorial.open_dataset("air_temperature") + xr.tutorial.open_dataset("rasm") diff --git a/scripts/download_data.sh b/scripts/download_data.sh deleted file mode 100755 index 16754fee73..0000000000 --- a/scripts/download_data.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -set -euxo pipefail - -bokeh sampledata - -python -c " -try: - import pooch - import scipy - import xarray as xr -except ImportError: - pass -else: - xr.tutorial.open_dataset('air_temperature') - xr.tutorial.open_dataset('rasm') -" From d3853558d8c5d54cc6b0f1297cb7996c71ea332a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 11:52:50 +0200 Subject: [PATCH 48/92] Update conda build --- conda.recipe/meta.yaml | 46 ------------------ scripts/{build_conda.sh => conda/build.sh} | 3 +- .../conda/recipe}/README.md | 0 scripts/conda/recipe/meta.yaml | 47 +++++++++++++++++++ 4 files changed, 48 insertions(+), 48 deletions(-) delete mode 100644 conda.recipe/meta.yaml rename scripts/{build_conda.sh => conda/build.sh} (62%) rename {conda.recipe => scripts/conda/recipe}/README.md (100%) create mode 100644 scripts/conda/recipe/meta.yaml diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml deleted file mode 100644 index 087efe849e..0000000000 --- a/conda.recipe/meta.yaml +++ /dev/null @@ -1,46 +0,0 @@ -{% set sdata = load_setup_py_data(setup_file="../setup.py", from_recipe_dir=True) %} - -package: - name: {{ sdata['name'] }} - version: {{ VERSION }} - -source: - url: ../dist/{{ sdata['name'] }}-{{ VERSION }}-py3-none-any.whl - -build: - noarch: python - script: {{ PYTHON }} -m pip install -vv {{ sdata['name'] }}-{{ VERSION }}-py3-none-any.whl - entry_points: - {% for group,epoints in sdata.get("entry_points",{}).items() %} - {% for entry_point in epoints %} - - {{ entry_point }} - {% endfor %} - {% endfor %} - -requirements: - build: - - python {{ sdata['python_requires'] }} - {% for dep in sdata['extras_require']['build'] %} - - {{ dep }} - {% endfor %} - run: - - python {{ sdata['python_requires'] }} - {% for dep in sdata.get('install_requires',{}) %} - - {{ dep }} - {% endfor %} - {% for dep in sdata['extras_require']['recommended'] %} - - {{ dep }} - {% endfor %} - -test: - imports: - - {{ sdata['name'] }} - commands: - - pip check - requires: - - pip - -about: - home: https://holoviews.org - summary: Stop plotting your data - annotate your data and let it visualize itself. - license: BSD 3-Clause diff --git a/scripts/build_conda.sh b/scripts/conda/build.sh similarity index 62% rename from scripts/build_conda.sh rename to scripts/conda/build.sh index 4b47650355..b4680b5916 100755 --- a/scripts/build_conda.sh +++ b/scripts/conda/build.sh @@ -4,11 +4,10 @@ set -euxo pipefail git status -export SETUPTOOLS_ENABLE_FEATURES="legacy-editable" python -m build -w . git diff --exit-code VERSION=$(find dist -name "*.whl" -exec basename {} \; | cut -d- -f2) export VERSION -conda build conda.recipe/ --no-anaconda-upload --no-verify +conda build scripts/conda/recipe --no-anaconda-upload --no-verify diff --git a/conda.recipe/README.md b/scripts/conda/recipe/README.md similarity index 100% rename from conda.recipe/README.md rename to scripts/conda/recipe/README.md diff --git a/scripts/conda/recipe/meta.yaml b/scripts/conda/recipe/meta.yaml new file mode 100644 index 0000000000..ba2b721aae --- /dev/null +++ b/scripts/conda/recipe/meta.yaml @@ -0,0 +1,47 @@ +{% set pyproject = load_file_data('../../../pyproject.toml', from_recipe_dir=True) %} +{% set project = pyproject['project'] %} + +package: + name: {{ project["name"] }} + version: {{ VERSION }} + +source: + url: ../../../dist/{{ project["name"] }}-{{ VERSION }}-py3-none-any.whl + +build: + noarch: python + script: {{ PYTHON }} -m pip install -vv {{ project["name"] }}-{{ VERSION }}-py3-none-any.whl + entry_points: + {% for group,epoints in project.get("entry_points",{}).items() %} + {% for entry_point in epoints %} + - {{ entry_point }} + {% endfor %} + {% endfor %} + +requirements: + build: + - python {{ project['requires-python'] }} + {% for dep in pyproject['build-system']['requires'] %} + - {{ dep }} + {% endfor %} + run: + - python {{ project['requires-python'] }} + {% for dep in project['dependencies'] %} + - {{ dep }} + {% endfor %} + {% for dep in project['optional-dependencies']['recommended'] %} + - {{ dep }} + {% endfor %} + +test: + imports: + - {{ project["name"] }} + commands: + - pip check + requires: + - pip + +about: + home: https://holoviews.org + summary: Stop plotting your data - annotate your data and let it visualize itself. + license: BSD 3-Clause From 4b3b8814e60ee028d17288264dbfe326b8174ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 12:20:35 +0200 Subject: [PATCH 49/92] Update build workflow --- .github/workflows/build.yaml | 40 +++++++++++++++--------------------- pixi.toml | 12 +++++++++++ 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 519e489f61..1609b6b941 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,7 +15,6 @@ defaults: shell: bash -el {0} env: - SETUPTOOLS_ENABLE_FEATURES: "legacy-editable" PYTHON_VERSION: "3.11" PACKAGE: "holoviews" @@ -30,25 +29,25 @@ jobs: steps: - run: echo "All builds have finished, have been approved, and ready to publish" + pixi_lock: + name: Pixi lock + runs-on: ubuntu-latest + steps: + - uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi + conda_build: name: Build Conda + needs: [pixi_lock] runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v4 + - uses: holoviz-dev/holoviz_tasks/pixi_install@pixi with: - fetch-depth: "100" - - name: Fetch unshallow - run: git fetch --prune --tags --unshallow -f - - uses: conda-incubator/setup-miniconda@v3 - with: - miniconda-version: "latest" - - name: conda setup - run: | - # pyct is for running setup.py - conda install -y conda-build build pyct -c pyviz/label/dev + environments: "build" - name: conda build + run: pixi run -e build conda + - name: Save filename run: | - source ./scripts/build_conda.sh + VERSION=$(find dist -name "*.whl" -exec basename {} \; | cut -d- -f2) echo "CONDA_FILE="$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2"" >> $GITHUB_ENV - uses: actions/upload-artifact@v4 if: always() @@ -88,21 +87,14 @@ jobs: pip_build: name: Build PyPI + needs: [pixi_lock] runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v4 - with: - fetch-depth: "100" - - name: Fetch unshallow - run: git fetch --prune --tags --unshallow -f - - uses: actions/setup-python@v5 + - uses: holoviz-dev/holoviz_tasks/pixi_install@pixi with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Install build - run: | - python -m pip install build + environments: "build" - name: Build package - run: python -m build . + run: pixi run -e build pip - uses: actions/upload-artifact@v4 if: always() with: diff --git a/pixi.toml b/pixi.toml index b6fabbd48f..e2fb0f9915 100644 --- a/pixi.toml +++ b/pixi.toml @@ -15,6 +15,7 @@ test-312 = ["py312", "test-core", "test", "example", "test-example"] test-ui = ["py312", "test-core", "test", "test-ui"] test-core = ["py312", "test-core"] docs = ["py311", "example", "doc"] +build = ["py311", "build"] [dependencies] python = ">=3.9" @@ -134,3 +135,14 @@ build-docs = 'nbsite build --what=html --output=builtdocs --org holoviz --projec [feature.doc.tasks.build] depends_on = ['generate-rst', 'refmanual', 'build-docs'] + +# ============================================= +# ================== BUILD ==================== +# ============================================= +[feature.build.dependencies] +build = "*" +conda-build = "*" + +[feature.build.tasks] +conda = 'bash scripts/build_conda.sh' +pip = 'python -m build .' From f0acd4af9bae5c3a8c0e37e536fcb307f0bc24b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 12:29:16 +0200 Subject: [PATCH 50/92] Fix script path --- pixi.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixi.toml b/pixi.toml index e2fb0f9915..6ce0c14f0f 100644 --- a/pixi.toml +++ b/pixi.toml @@ -144,5 +144,5 @@ build = "*" conda-build = "*" [feature.build.tasks] -conda = 'bash scripts/build_conda.sh' +conda = 'bash scripts/conda/build.sh' pip = 'python -m build .' From e9c99b1242f92cd6c3cb10db87056e6daa21eea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 12:33:21 +0200 Subject: [PATCH 51/92] Add nightly lock workflow --- .github/workflows/nightly_lock.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/nightly_lock.yaml diff --git a/.github/workflows/nightly_lock.yaml b/.github/workflows/nightly_lock.yaml new file mode 100644 index 0000000000..9d3379af2b --- /dev/null +++ b/.github/workflows/nightly_lock.yaml @@ -0,0 +1,14 @@ +name: nightly_lock +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + +jobs: + pixi_lock: + name: Pixi lock + runs-on: ubuntu-latest + steps: + - uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi + + # TODO: Upload the lock-file From 6ddcfb541be817989e99280aaae1f477bfb7d7b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 12:38:29 +0200 Subject: [PATCH 52/92] Don't download data --- .github/workflows/build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1609b6b941..dddb3377a4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -43,6 +43,7 @@ jobs: - uses: holoviz-dev/holoviz_tasks/pixi_install@pixi with: environments: "build" + download-data: false - name: conda build run: pixi run -e build conda - name: Save filename @@ -93,6 +94,7 @@ jobs: - uses: holoviz-dev/holoviz_tasks/pixi_install@pixi with: environments: "build" + download-data: false - name: Build package run: pixi run -e build pip - uses: actions/upload-artifact@v4 From 5bd117794582588bdd61cb032275e34885f25dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 12:44:01 +0200 Subject: [PATCH 53/92] Add pixi env path --- .github/workflows/build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index dddb3377a4..8c1017718c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -48,8 +48,9 @@ jobs: run: pixi run -e build conda - name: Save filename run: | + ENV_PATH=$(pixi run -e build 'echo $CONDA_PREFIX') VERSION=$(find dist -name "*.whl" -exec basename {} \; | cut -d- -f2) - echo "CONDA_FILE="$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2"" >> $GITHUB_ENV + echo "CONDA_FILE="$ENV_PATH/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2"" >> $GITHUB_ENV - uses: actions/upload-artifact@v4 if: always() with: From 322cd21e2ccdf5894dd2e2c5d0a81ba445936b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 12:54:08 +0200 Subject: [PATCH 54/92] Update test.yaml and try macos ARm64 build --- .github/workflows/test.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 96714af2d9..72795bb311 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -90,7 +90,7 @@ jobs: if: env.MATRIX_OPTION == 'default' run: | MATRIX=$(jq -nsc '{ - "os": ["ubuntu-latest", "macos-latest", "windows-latest"], + "os": ["ubuntu-latest", "macos-latest", "macos-14", "windows-latest"], "environment": ["test-309", "test-312"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV @@ -98,8 +98,8 @@ jobs: if: env.MATRIX_OPTION == 'full' run: | MATRIX=$(jq -nsc '{ - "os": ["ubuntu-latest", "macos-latest", "windows-latest"], - "environment": ["3.9", "3.10", "3.11", "3.12"] + "os": ["ubuntu-latest", "macos-latest", "macos-14", "windows-latest"], + "environment": ["test-309", "test-310", "test311", "test312"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV - name: Set test matrix with 'downstream' option @@ -107,7 +107,7 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest"], - "environment": ["3.11"] + "environment": ["test3.11"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV @@ -120,7 +120,7 @@ jobs: cache: ${{ github.event.inputs.cache == 'true' || github.event.inputs.cache == '' }} unit_test_suite: - name: Unit tests on Python ${{ matrix.environment }}, ${{ matrix.os }} + name: unit:${{ matrix.environment }}:${{ matrix.os }} needs: [pre_commit, setup, pixi_lock] runs-on: ${{ matrix.os }} strategy: @@ -150,7 +150,7 @@ jobs: pixi run -e ${{ matrix.environment }} codecov ui_test_suite: - name: UI tests on Python ${{ matrix.environment }}, ${{ matrix.os }} + name: ui:${{ matrix.environment }}:${{ matrix.os }} needs: [pre_commit, setup, pixi_lock] runs-on: ${{ matrix.os }} strategy: @@ -176,7 +176,7 @@ jobs: pixi run -e ${{ matrix.environment }} codecov core_test_suite: - name: Core tests on Python ${{ matrix.environment }}, ${{ matrix.os }} + name: core:${{ matrix.environment }}:${{ matrix.os }} needs: [pre_commit, setup, pixi_lock] runs-on: ${{ matrix.os }} strategy: From b34712969e5cb7864a24acfdbadf280ac6028483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 13:04:39 +0200 Subject: [PATCH 55/92] Remove files --- dodo.py | 15 -------- scripts/conda/recipe/README.md | 14 ------- tox.ini | 67 ---------------------------------- 3 files changed, 96 deletions(-) delete mode 100644 dodo.py delete mode 100644 scripts/conda/recipe/README.md delete mode 100644 tox.ini diff --git a/dodo.py b/dodo.py deleted file mode 100644 index b68ffd1e3a..0000000000 --- a/dodo.py +++ /dev/null @@ -1,15 +0,0 @@ -import os -if "PYCTDEV_ECOSYSTEM" not in os.environ: - os.environ["PYCTDEV_ECOSYSTEM"] = "conda" - -from pyctdev import * # noqa: api - - -def task_pip_on_conda(): - """Experimental: provide pip build env via conda""" - return {'actions':[ - # some ecosystem=pip build tools must be installed with conda when using conda... - 'conda install -y pip twine wheel rfc3986 keyring', - # ..and some are only available via conda-forge - 'conda install -y -c conda-forge tox virtualenv', - ]} diff --git a/scripts/conda/recipe/README.md b/scripts/conda/recipe/README.md deleted file mode 100644 index 35638017b0..0000000000 --- a/scripts/conda/recipe/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## Release Procedure - -- Ensure all tests pass. - -- Tag commit a PEP440 style tag (starting with the prefix 'v') and push to github - -```bash -git tag -a vx.x.x -m 'Version x.x.x' -git push --tags -``` - -Example tags might include v1.9.3 v1.10.0a1 or v1.11.3b3 - -- Build conda packages diff --git a/tox.ini b/tox.ini deleted file mode 100644 index b5a5876ed0..0000000000 --- a/tox.ini +++ /dev/null @@ -1,67 +0,0 @@ -# For use with pyct (https://github.com/pyviz/pyct), but just standard -# tox config (works with tox alone). - -[tox] -# python version test group extra envs extra commands -envlist = {py39,py310,py311,py312}-{unit,ui,examples,all_recommended,simple}-{default}-{dev,pkg} - -[_simple] -description = Install holoviews without any optional dependencies -deps = . -commands = python -c "import holoviews as hv; print(hv.__version__)" - -[_unit_core] -description = Run unit tests with coverage but no optional test dependency -deps = .[tests_core] -commands = pytest holoviews --cov=./holoviews - -[_unit] -description = Run unit tests with coverage and all the optional test dependencies -deps = .[tests] -commands = pytest holoviews --cov=./holoviews - -[_unit_gpu] -description = Run unit tests with coverage and all the optional test dependencies -deps = .[tests_gpu] -commands = pytest holoviews --cov=./holoviews - -[_ui] -description = Run UI tests -deps = .[tests, ui] -commands = pytest holoviews --cov=./holoviews --cov-report=xml --ui --browser chromium - -[_examples] -description = Test that default examples run -deps = .[examples_tests] -commands = pytest -n auto --dist loadscope --nbval-lax examples - -[_all_recommended] -description = Run all recommended tests -deps = .[tests, examples_tests] -commands = {[_unit]commands} - {[_examples]commands} - -[_pkg] -commands = holoviews --install-examples - -[testenv] -sitepackages = True -install_command = pip install --no-deps {opts} pytest {packages} - -changedir = {envtmpdir} - -commands = examples-pkg: {[_pkg]commands} - unit: {[_unit]commands} - unit_core: {[_unit_core]commands} - unit_gpu: {[_unit_gpu]commands} - ui: {[_ui]commands} - simple: {[_simple]commands} - examples: {[_examples]commands} - all_recommended: {[_all_recommended]commands} - -deps = unit: {[_unit]deps} - unit_core: {[_unit_core]deps} - unit_gpu: {[_unit_gpu]deps} - ui: {[_ui]commands} - examples: {[_examples]deps} - all_recommended: {[_all_recommended]deps} From 9a56b1246972f396e3ffc22b759b4b3fd9f713b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 15:56:55 +0200 Subject: [PATCH 56/92] More descriptive task name --- .github/workflows/build.yaml | 4 ++-- .github/workflows/docs.yaml | 2 +- pixi.toml | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8c1017718c..5e6ce88b13 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -45,7 +45,7 @@ jobs: environments: "build" download-data: false - name: conda build - run: pixi run -e build conda + run: pixi run -e build build-conda - name: Save filename run: | ENV_PATH=$(pixi run -e build 'echo $CONDA_PREFIX') @@ -97,7 +97,7 @@ jobs: environments: "build" download-data: false - name: Build package - run: pixi run -e build pip + run: pixi run -e build build-pip - uses: actions/upload-artifact@v4 if: always() with: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 7216abd29f..77eb16eba5 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -54,7 +54,7 @@ jobs: id: vars run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Build documentation - run: pixi run -e docs build + run: pixi run -e docs docs-build - name: upload dev if: | (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'dev') || diff --git a/pixi.toml b/pixi.toml index 6ce0c14f0f..b38b96277c 100644 --- a/pixi.toml +++ b/pixi.toml @@ -129,12 +129,12 @@ pooch = "*" selenium = "*" [feature.doc.tasks] -generate-rst = 'nbsite generate-rst --org holoviz --project-name holoviews' -refmanual = 'python ./doc/generate_modules.py holoviews -d ./doc/reference_manual -n holoviews -e tests' -build-docs = 'nbsite build --what=html --output=builtdocs --org holoviz --project-name holoviews' +docs-generate-rst = 'nbsite generate-rst --org holoviz --project-name holoviews' +docs-refmanual = 'python ./doc/generate_modules.py holoviews -d ./doc/reference_manual -n holoviews -e tests' +docs-generate = 'nbsite build --what=html --output=builtdocs --org holoviz --project-name holoviews' -[feature.doc.tasks.build] -depends_on = ['generate-rst', 'refmanual', 'build-docs'] +[feature.doc.tasks.docs-builddocs] +depends_on = ['docs-generate-rst', 'docs-refmanual', 'docs-generate'] # ============================================= # ================== BUILD ==================== @@ -144,5 +144,5 @@ build = "*" conda-build = "*" [feature.build.tasks] -conda = 'bash scripts/conda/build.sh' -pip = 'python -m build .' +build-conda = 'bash scripts/conda/build.sh' +build-pip = 'python -m build .' From 8b93da350d4bf06116d4eabd3908b8c7c58f870d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 16:07:18 +0200 Subject: [PATCH 57/92] Only run on macOS-arm64 --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 72795bb311..8f1ef405c0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -90,7 +90,7 @@ jobs: if: env.MATRIX_OPTION == 'default' run: | MATRIX=$(jq -nsc '{ - "os": ["ubuntu-latest", "macos-latest", "macos-14", "windows-latest"], + "os": ["ubuntu-latest", "macos-14", "windows-latest"], "environment": ["test-309", "test-312"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV @@ -98,7 +98,7 @@ jobs: if: env.MATRIX_OPTION == 'full' run: | MATRIX=$(jq -nsc '{ - "os": ["ubuntu-latest", "macos-latest", "macos-14", "windows-latest"], + "os": ["ubuntu-latest", "macos-14", "windows-latest"], "environment": ["test-309", "test-310", "test311", "test312"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV From 52d82a421751240b929981fcfd545c5d6e1699b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 16:18:19 +0200 Subject: [PATCH 58/92] Fix extra docs --- pixi.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixi.toml b/pixi.toml index b38b96277c..b6c51b6fc7 100644 --- a/pixi.toml +++ b/pixi.toml @@ -133,7 +133,7 @@ docs-generate-rst = 'nbsite generate-rst --org holoviz --project-name holoviews' docs-refmanual = 'python ./doc/generate_modules.py holoviews -d ./doc/reference_manual -n holoviews -e tests' docs-generate = 'nbsite build --what=html --output=builtdocs --org holoviz --project-name holoviews' -[feature.doc.tasks.docs-builddocs] +[feature.doc.tasks.docs-build] depends_on = ['docs-generate-rst', 'docs-refmanual', 'docs-generate'] # ============================================= From d104fd76d7d0a4ca8b0012c6cc85832a59ad202a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 19:40:09 +0200 Subject: [PATCH 59/92] Switch to hatchling and remove manifest.in --- .gitignore | 1 - MANIFEST.in | 13 ------------- pyproject.toml | 19 ++++++++++++++----- 3 files changed, 14 insertions(+), 19 deletions(-) delete mode 100644 MANIFEST.in diff --git a/.gitignore b/.gitignore index 6781085cdb..ae3111fef6 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,6 @@ holoviews/_version.py .idea .vscode holoviews.rc -/examples/assets/ ghostdriver.log holoviews/.version .dir-locals.el diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 00ee15d10f..0000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,13 +0,0 @@ -include README.rst -include LICENSE.txt -include CHANGELOG.md -include holoviews/.version -include holoviews/ipython/*.html -include holoviews/plotting/mpl/*.mplstyle -include holoviews/tests/ipython/notebooks/*.ipynb -global-exclude *.py[co] -global-exclude __pycache__ -global-exclude *~ -global-exclude *.ipynb_checkpoints/* -graft examples -graft holoviews/examples diff --git a/pyproject.toml b/pyproject.toml index 78a8948acc..958fba916c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["setuptools >=30.3.0", "setuptools_scm >=7"] -build-backend = "setuptools.build_meta" +requires = ["hatchling", "hatch-vcs"] +build-backend = "hatchling.build" [project] name = "holoviews" @@ -49,12 +49,21 @@ HoloViz = "https://holoviz.org/" [project.optional-dependencies] recommended = ["ipython >=5.4.0", "notebook", "matplotlib >=3", "bokeh >=3.1"] -[tool.setuptools] -include-package-data = true +[tool.hatch.version] +source = "vcs" -[tool.setuptools.packages.find] +[tool.hatch.build.targets.wheel] include = ["holoviews"] +[tool.hatch.build.targets.wheel.force-include] +examples = "holoviews/examples" + +[tool.hatch.build.targets.sdist] +include = ["holoviews", "examples"] + +[tool.hatch.build.hooks.vcs] +version-file = "holoviews/_version.py" + [tool.setuptools_scm] version_file = "holoviews/_version.py" From a51e99335c66dcc43ea84dc225175a19b0d5737f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 19:52:43 +0200 Subject: [PATCH 60/92] Add entry-points --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 958fba916c..9c70449c45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,6 @@ classifiers = [ "Topic :: Scientific/Engineering", "Topic :: Software Development :: Libraries", ] -# entry_points={console_scripts= ["holoviews = holoviews.util.command:main"]} dependencies = [ "param >=1.12.0,<3.0", "numpy >=1.0", @@ -41,6 +40,7 @@ dependencies = [ "packaging", "pandas >=0.20.0", ] + [project.urls] Homepage = "https://holoviews.org" Source = "http://github.com/holoviz/holoviews" @@ -49,6 +49,9 @@ HoloViz = "https://holoviz.org/" [project.optional-dependencies] recommended = ["ipython >=5.4.0", "notebook", "matplotlib >=3", "bokeh >=3.1"] +[project.entry-points.console-scripts] +holoviews = "holoviews.util.command:main" + [tool.hatch.version] source = "vcs" From 401758ad99c2da0b100d227223c5cad646478e62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 12 Apr 2024 20:52:36 +0200 Subject: [PATCH 61/92] Add build_script --- pyproject.toml | 4 +-- scripts/hatch_build.py | 72 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 scripts/hatch_build.py diff --git a/pyproject.toml b/pyproject.toml index 9c70449c45..657a5161b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,8 +67,8 @@ include = ["holoviews", "examples"] [tool.hatch.build.hooks.vcs] version-file = "holoviews/_version.py" -[tool.setuptools_scm] -version_file = "holoviews/_version.py" +[tool.hatch.build.hooks.custom] +path = "scripts/hatch_build.py" [tool.pytest.ini_options] addopts = ["--strict-config", "--strict-markers", "--color=yes"] diff --git a/scripts/hatch_build.py b/scripts/hatch_build.py new file mode 100644 index 0000000000..af9af60af5 --- /dev/null +++ b/scripts/hatch_build.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +import sys +import typing as t +from pathlib import Path + +from hatchling.builders.hooks.plugin.interface import BuildHookInterface + + +def install_pre_commit_hook() -> None: + """Install a pre-commit hook.""" + data = f"""#!/usr/bin/env bash +INSTALL_PYTHON={sys.executable} +ARGS=(hook-impl --config=.pre-commit-config.yaml --hook-type=pre-commit) +HERE="$(cd "$(dirname "$0")" && pwd)" +ARGS+=(--hook-dir "$HERE" -- "$@") +exec "$INSTALL_PYTHON" -m pre_commit "${{ARGS[@]}}" +""" + if not Path(".git").exists(): + return + + path = Path(".git/hooks/pre-commit") + if not path.exists(): + with path.open("w") as fid: + fid.write(data) + + mode = path.stat().st_mode + mode |= (mode & 0o444) >> 2 # copy R bits to X + path.chmod(mode) + + +def install_pre_push_hook(): + data = """#!/usr/bin/env bash +set -euo pipefail + +BRANCH=`git branch --show-current` + +if [[ "$BRANCH" =~ ^(master|main)$ ]]; then + echo + echo "Prevented pushing to $BRANCH. Use --no-verify to bypass this pre-push hook." + echo + exit 1 +fi + +exit 0 +""" + if not Path(".git").exists(): + return + + path = Path(".git/hooks/pre-push") + if not path.exists(): + with path.open("w") as fid: + fid.write(data) + + mode = path.stat().st_mode + mode |= (mode & 0o444) >> 2 # copy R bits to X + path.chmod(mode) + + +class HoloviewsBuildHook(BuildHookInterface): + """The hatch jupyter builder build hook.""" + + PLUGIN_NAME = "install" + + def initialize(self, version: str, _: dict[str, t.Any]) -> None: + """Initialize the plugin.""" + if self.target_name not in ["wheel", "sdist"]: + return + + if version == "editable": + install_pre_commit_hook() + install_pre_push_hook() From 72053338ce189e5dd84543db3383c65c76b230ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 13 Apr 2024 09:45:05 +0200 Subject: [PATCH 62/92] Update build to match with previous implementation --- pyproject.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 657a5161b0..91b15672a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,17 +58,17 @@ source = "vcs" [tool.hatch.build.targets.wheel] include = ["holoviews"] -[tool.hatch.build.targets.wheel.force-include] -examples = "holoviews/examples" - [tool.hatch.build.targets.sdist] -include = ["holoviews", "examples"] +include = ["holoviews"] + +[tool.hatch.build.targets.sdist.force-include] +examples = "holoviews/examples" [tool.hatch.build.hooks.vcs] version-file = "holoviews/_version.py" -[tool.hatch.build.hooks.custom] -path = "scripts/hatch_build.py" +# [tool.hatch.build.hooks.custom] +# path = "scripts/hatch_build.py" [tool.pytest.ini_options] addopts = ["--strict-config", "--strict-markers", "--color=yes"] From df15a75e77760bc1ffaf9587fd728bdd98ce29a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 13 Apr 2024 09:57:40 +0200 Subject: [PATCH 63/92] Add version boilerplate --- holoviews/__init__.py | 58 ++++++++++++++++++++++++------------------ holoviews/__version.py | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 25 deletions(-) create mode 100644 holoviews/__version.py diff --git a/holoviews/__init__.py b/holoviews/__init__.py index e3231dece9..1ca017cdf6 100644 --- a/holoviews/__init__.py +++ b/holoviews/__init__.py @@ -75,39 +75,47 @@ """ import os import sys +import warnings import param -__version__ = str(param.version.Version(fpath=__file__, archive_commit="$Format:%h$", - reponame="holoviews")) - -from . import util # noqa (API import) -from .core import archive, config # noqa (API import) -from .core.boundingregion import BoundingBox # noqa (API import) -from .core.dimension import Dimension # noqa (API import) -from .core.element import Element, Collator # noqa (API import) -from .core.layout import (Layout, NdLayout, Empty, # noqa (API import) - AdjointLayout) -from .core.ndmapping import NdMapping # noqa (API import) -from .core.options import (Options, Store, Cycle, # noqa (API import) - Palette, StoreOptions) -from .core.overlay import Overlay, NdOverlay # noqa (API import) -from .core.spaces import (HoloMap, Callable, DynamicMap, # noqa (API import) - GridSpace, GridMatrix) - -from .operation import Operation # noqa (API import) +from . import util # noqa (API import) +from .__version import __version__ +from .core import archive, config # noqa (API import) +from .core.boundingregion import BoundingBox # noqa (API import) +from .core.dimension import Dimension # noqa (API import) +from .core.element import Collator, Element # noqa (API import) +from .core.layout import AdjointLayout, Empty, Layout, NdLayout # noqa (API import) +from .core.ndmapping import NdMapping # noqa (API import) +from .core.options import ( # noqa (API import) + Cycle, + Options, + Palette, + Store, + StoreOptions, +) +from .core.overlay import NdOverlay, Overlay # noqa (API import) +from .core.spaces import ( # noqa (API import) + Callable, + DynamicMap, + GridMatrix, + GridSpace, + HoloMap, +) from .element import * from .element import __all__ as elements_list -from .selection import link_selections # noqa (API import) -from .util import (extension, renderer, output, opts, # noqa (API import) - render, save) -from .util.transform import dim # noqa (API import) -from .util.warnings import HoloviewsDeprecationWarning, HoloviewsUserWarning # noqa: F401 +from .operation import Operation # noqa (API import) +from .selection import link_selections # noqa (API import) +from .util import extension, opts, output, render, renderer, save # noqa (API import) from .util._versions import show_versions # noqa: F401 +from .util.transform import dim # noqa (API import) +from .util.warnings import ( # noqa: F401 + HoloviewsDeprecationWarning, + HoloviewsUserWarning, +) # Suppress warnings generated by NumPy in matplotlib # Expected to be fixed in next matplotlib release -import warnings warnings.filterwarnings("ignore", message="elementwise comparison failed; returning scalar instead") @@ -173,7 +181,7 @@ def help(obj, visualization=True, ansi=True, backend=None, pydoc.help(obj) -del os, rcfile, warnings +del os, sys, rcfile, warnings def __getattr__(name): if name == "annotate": diff --git a/holoviews/__version.py b/holoviews/__version.py new file mode 100644 index 0000000000..8751f57638 --- /dev/null +++ b/holoviews/__version.py @@ -0,0 +1,44 @@ +"""Define the package version. + +Called __version.py as setuptools_scm will create a _version.py +""" + +import os.path + +NAME = "holoviews" + +try: + # For performance reasons on imports, avoid importing setuptools_scm + # if not in a .git folder + if os.path.exists(os.path.join(os.path.dirname(__file__), "..", ".git")): + # If setuptools_scm is installed (e.g. in a development environment with + # an editable install), then use it to determine the version dynamically. + from setuptools_scm import get_version + + # This will fail with LookupError if the package is not installed in + # editable mode or if Git is not installed. + __version__ = get_version(root="..", relative_to=__file__) + else: + raise FileNotFoundError +except (ImportError, LookupError, FileNotFoundError): + # As a fallback, use the version that is hard-coded in the file. + try: + # __version__ was added in _version in setuptools-scm 7.0.0, we rely on + # the hopefully stable version variable. + from ._version import version as __version__ + except (ModuleNotFoundError, ImportError): + # Either _version doesn't exist (ModuleNotFoundError) or version isn't + # in _version (ImportError). ModuleNotFoundError is a subclass of + # ImportError, let's be explicit anyway. + + # Try something else: + from importlib.metadata import PackageNotFoundError, version + + try: + __version__ = version(NAME) + except PackageNotFoundError: + # The user is probably trying to run this without having installed + # the package. + __version__ = "0.0.0+unknown" + +__all__ = ("__version__",) From 629ae8b8039e66267ffd6866473ccf47ea7d106d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 13 Apr 2024 10:16:24 +0200 Subject: [PATCH 64/92] Simplify build-conda --- .github/workflows/build.yaml | 7 +------ scripts/conda/build.sh | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5e6ce88b13..198370ab10 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -46,16 +46,11 @@ jobs: download-data: false - name: conda build run: pixi run -e build build-conda - - name: Save filename - run: | - ENV_PATH=$(pixi run -e build 'echo $CONDA_PREFIX') - VERSION=$(find dist -name "*.whl" -exec basename {} \; | cut -d- -f2) - echo "CONDA_FILE="$ENV_PATH/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2"" >> $GITHUB_ENV - uses: actions/upload-artifact@v4 if: always() with: name: conda - path: ${{ env.CONDA_FILE }} + path: dist/ if-no-files-found: error conda_publish: diff --git a/scripts/conda/build.sh b/scripts/conda/build.sh index b4680b5916..6d8354a4f1 100755 --- a/scripts/conda/build.sh +++ b/scripts/conda/build.sh @@ -2,12 +2,22 @@ set -euxo pipefail -git status +PACKAGE="holoviews" -python -m build -w . +for file in dist/*.whl dist/*.tar.bz2; do + if [ -e "$file" ]; then + echo "dist folder already contains $(basename "$file"). Please delete it before running this script." + exit 1 + fi +done +git diff --exit-code +python -m build -w . git diff --exit-code VERSION=$(find dist -name "*.whl" -exec basename {} \; | cut -d- -f2) export VERSION conda build scripts/conda/recipe --no-anaconda-upload --no-verify + +mkdir -p dist +mv "$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2" dist From 20175e59dd9b24f84c88f83892dbe12dd35e1471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 13 Apr 2024 10:59:50 +0200 Subject: [PATCH 65/92] Also build sdist for conda packages As it seems to not have the examples folder with only a wheel. Also only upload the tar.bz2 file --- .github/workflows/build.yaml | 2 +- scripts/conda/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 198370ab10..2e7770ca24 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -50,7 +50,7 @@ jobs: if: always() with: name: conda - path: dist/ + path: dist/*tar.bz2 if-no-files-found: error conda_publish: diff --git a/scripts/conda/build.sh b/scripts/conda/build.sh index 6d8354a4f1..b97e707ca2 100755 --- a/scripts/conda/build.sh +++ b/scripts/conda/build.sh @@ -12,7 +12,7 @@ for file in dist/*.whl dist/*.tar.bz2; do done git diff --exit-code -python -m build -w . +python -m build . git diff --exit-code VERSION=$(find dist -name "*.whl" -exec basename {} \; | cut -d- -f2) From 38902eeb18b2b1d896dc2817cdbe9419793fb1d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 13 Apr 2024 11:17:17 +0200 Subject: [PATCH 66/92] Rename NAME to PACKAGE --- holoviews/__version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/holoviews/__version.py b/holoviews/__version.py index 8751f57638..f01259f510 100644 --- a/holoviews/__version.py +++ b/holoviews/__version.py @@ -5,7 +5,7 @@ import os.path -NAME = "holoviews" +PACKAGE = "holoviews" try: # For performance reasons on imports, avoid importing setuptools_scm @@ -35,7 +35,7 @@ from importlib.metadata import PackageNotFoundError, version try: - __version__ = version(NAME) + __version__ = version(PACKAGE) except PackageNotFoundError: # The user is probably trying to run this without having installed # the package. From ac88724534e9fb3e4ecc0b7ee9456f5a4534991e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 13 Apr 2024 11:21:14 +0200 Subject: [PATCH 67/92] Small fixes, looking at Github diff view --- .github/workflows/test.yaml | 2 +- scripts/conda/recipe/meta.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8f1ef405c0..ea0c098c26 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -107,7 +107,7 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest"], - "environment": ["test3.11"] + "environment": ["test-311"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV diff --git a/scripts/conda/recipe/meta.yaml b/scripts/conda/recipe/meta.yaml index ba2b721aae..ea83e2fd10 100644 --- a/scripts/conda/recipe/meta.yaml +++ b/scripts/conda/recipe/meta.yaml @@ -26,7 +26,7 @@ requirements: {% endfor %} run: - python {{ project['requires-python'] }} - {% for dep in project['dependencies'] %} + {% for dep in project.get('dependencies', []) %} - {{ dep }} {% endfor %} {% for dep in project['optional-dependencies']['recommended'] %} From 2736057301f77c06b4b4b39b3590868521ead458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 13 Apr 2024 12:04:30 +0200 Subject: [PATCH 68/92] Rename to project.scripts --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 91b15672a1..521d590c38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ HoloViz = "https://holoviz.org/" [project.optional-dependencies] recommended = ["ipython >=5.4.0", "notebook", "matplotlib >=3", "bokeh >=3.1"] -[project.entry-points.console-scripts] +[project.scripts] holoviews = "holoviews.util.command:main" [tool.hatch.version] From a22a51c4c1def88ba76ae22edcea11132ed9d10a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 13 Apr 2024 12:15:11 +0200 Subject: [PATCH 69/92] Rename test-309 to test-39 --- .github/workflows/test.yaml | 4 ++-- pixi.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ea0c098c26..e7c93a307c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -91,7 +91,7 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest", "macos-14", "windows-latest"], - "environment": ["test-309", "test-312"] + "environment": ["test-39", "test-312"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV - name: Set test matrix with 'full' option @@ -99,7 +99,7 @@ jobs: run: | MATRIX=$(jq -nsc '{ "os": ["ubuntu-latest", "macos-14", "windows-latest"], - "environment": ["test-309", "test-310", "test311", "test312"] + "environment": ["test-39", "test-310", "test311", "test312"] }') echo "MATRIX=$MATRIX" >> $GITHUB_ENV - name: Set test matrix with 'downstream' option diff --git a/pixi.toml b/pixi.toml index b6c51b6fc7..058f40d2ab 100644 --- a/pixi.toml +++ b/pixi.toml @@ -8,7 +8,7 @@ check-latest-packages = 'python scripts/check_latest_packages.py' download-data = 'python scripts/download_data.py' [environments] -test-309 = ["py309", "test-core", "test", "example", "test-example"] +test-39 = ["py39", "test-core", "test", "example", "test-example"] test-310 = ["py310", "test-core", "test", "example", "test-example"] test-311 = ["py311", "test-core", "test", "example", "test-example"] test-312 = ["py312", "test-core", "test", "example", "test-example"] @@ -35,7 +35,7 @@ bokeh = ">=3.1" [pypi-dependencies] holoviews = { path = "." } -[feature.py309.dependencies] +[feature.py39.dependencies] python = "3.9.*" [feature.py310.dependencies] From 821fd40f3274bc2ec26ce7a4179add0a9aef53b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Sat, 13 Apr 2024 16:46:42 +0200 Subject: [PATCH 70/92] Small changes --- pyproject.toml | 2 +- scripts/conda/build.sh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 521d590c38..1c950cfa20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ source = "vcs" include = ["holoviews"] [tool.hatch.build.targets.sdist] -include = ["holoviews"] +include = ["holoviews", "CHANGELOG.md"] [tool.hatch.build.targets.sdist.force-include] examples = "holoviews/examples" diff --git a/scripts/conda/build.sh b/scripts/conda/build.sh index b97e707ca2..98570c16b0 100755 --- a/scripts/conda/build.sh +++ b/scripts/conda/build.sh @@ -13,11 +13,9 @@ done git diff --exit-code python -m build . -git diff --exit-code VERSION=$(find dist -name "*.whl" -exec basename {} \; | cut -d- -f2) export VERSION conda build scripts/conda/recipe --no-anaconda-upload --no-verify -mkdir -p dist mv "$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2" dist From fc43b6c2984c5310d488f65612fb8327587f415a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Mon, 15 Apr 2024 09:39:54 +0200 Subject: [PATCH 71/92] Add tsdownsample to unix systems --- pixi.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pixi.toml b/pixi.toml index 058f40d2ab..97d7a7ac3d 100644 --- a/pixi.toml +++ b/pixi.toml @@ -96,7 +96,9 @@ spatialpandas = "*" datashader = ">=0.11.1" codecov = "*" # dash >=1.16 -# tsdownsample = "*" # not windows + +[feature.test.target.unix.dependencies] +tsdownsample = "*" # currently not available on Windows [feature.test-example.tasks] test-example = 'pytest -n auto --dist loadscope --nbval-lax examples' From bc6870ffdb3bfeab2282eb4f2205bea9a10951b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Mon, 15 Apr 2024 09:40:14 +0200 Subject: [PATCH 72/92] Add comment to conda build script --- scripts/conda/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/conda/build.sh b/scripts/conda/build.sh index 98570c16b0..277ca7196b 100755 --- a/scripts/conda/build.sh +++ b/scripts/conda/build.sh @@ -12,7 +12,7 @@ for file in dist/*.whl dist/*.tar.bz2; do done git diff --exit-code -python -m build . +python -m build . # Can add -w when this is solved: https://github.com/pypa/hatch/issues/1305 VERSION=$(find dist -name "*.whl" -exec basename {} \; | cut -d- -f2) export VERSION From e9f597464cbb2969db78245d2b19aaf7c191fa84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Mon, 15 Apr 2024 10:51:47 +0200 Subject: [PATCH 73/92] Move to github action for codecov --- .github/workflows/test.yaml | 14 ++++++++------ pixi.toml | 1 - 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e7c93a307c..0b4870911d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -144,10 +144,11 @@ jobs: if: needs.setup.outputs.code_change == 'true' run: | pixi run -e ${{ matrix.environment }} test-example - - name: codecov + - uses: codecov/codecov-action@v4 if: needs.setup.outputs.code_change == 'true' - run: | - pixi run -e ${{ matrix.environment }} codecov + with: + # fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} ui_test_suite: name: ui:${{ matrix.environment }}:${{ matrix.os }} @@ -170,10 +171,11 @@ jobs: if: needs.setup.outputs.code_change == 'true' run: | pixi run -e ${{ matrix.environment }} test-ui --cov=./holoviews --cov-report=xml - - name: codecov + - uses: codecov/codecov-action@v4 if: needs.setup.outputs.code_change == 'true' - run: | - pixi run -e ${{ matrix.environment }} codecov + with: + # fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} core_test_suite: name: core:${{ matrix.environment }}:${{ matrix.os }} diff --git a/pixi.toml b/pixi.toml index 97d7a7ac3d..07fa20dd5f 100644 --- a/pixi.toml +++ b/pixi.toml @@ -94,7 +94,6 @@ scipy = ">=1.10" # Python 3.9 + Windows downloads 1.9 selenium = "*" spatialpandas = "*" datashader = ">=0.11.1" -codecov = "*" # dash >=1.16 [feature.test.target.unix.dependencies] From a429d3cfd0bc09d1007a5aa1c3e51fd248208c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Mon, 15 Apr 2024 11:33:55 +0200 Subject: [PATCH 74/92] Remove pypi-dependecies (for now) --- pixi.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pixi.toml b/pixi.toml index 07fa20dd5f..6463a088c8 100644 --- a/pixi.toml +++ b/pixi.toml @@ -6,6 +6,7 @@ platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] [tasks] check-latest-packages = 'python scripts/check_latest_packages.py' download-data = 'python scripts/download_data.py' +install = 'python -m pip install --no-deps --disable-pip-version-check .' [environments] test-39 = ["py39", "test-core", "test", "example", "test-example"] @@ -19,6 +20,7 @@ build = ["py311", "build"] [dependencies] python = ">=3.9" +pip= "*" param = ">=1.12.0,<3.0" panel = ">=1.0" pyviz_comms = ">=2.1" @@ -32,9 +34,6 @@ notebook = "*" matplotlib-base = ">=3" bokeh = ">=3.1" -[pypi-dependencies] -holoviews = { path = "." } - [feature.py39.dependencies] python = "3.9.*" From ab8e6ea8d78e7a676172ce364916fbf6f8ff124b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Mon, 15 Apr 2024 16:08:49 +0200 Subject: [PATCH 75/92] Update .github/workflows/test.yaml --- .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 0b4870911d..3ffb3cda40 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -139,7 +139,7 @@ jobs: - name: Test Unit if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} test-unit --cov=./holoviews + pixi run -e ${{ matrix.environment }} test-unit --cov=./holoviews --cov-report=xml - name: Test Examples if: needs.setup.outputs.code_change == 'true' run: | From f8c84c043ed219dffff15b254a91adad03b6c9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 16 Apr 2024 14:18:01 +0200 Subject: [PATCH 76/92] Make install editable --- pixi.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixi.toml b/pixi.toml index 6463a088c8..a9682fd13a 100644 --- a/pixi.toml +++ b/pixi.toml @@ -6,7 +6,7 @@ platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] [tasks] check-latest-packages = 'python scripts/check_latest_packages.py' download-data = 'python scripts/download_data.py' -install = 'python -m pip install --no-deps --disable-pip-version-check .' +install = 'python -m pip install --no-deps --disable-pip-version-check -e .' [environments] test-39 = ["py39", "test-core", "test", "example", "test-example"] From ea77fe4ab4269246d10d691c2e5868639a296198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 16 Apr 2024 14:23:49 +0200 Subject: [PATCH 77/92] Add xyzservices --- pixi.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pixi.toml b/pixi.toml index a9682fd13a..6889632a36 100644 --- a/pixi.toml +++ b/pixi.toml @@ -71,12 +71,12 @@ notebook = ">=7.0" [feature.test-core.dependencies] pytest = "*" pytest-cov = "*" +pytest-github-actions-annotate-failures = "*" pytest-rerunfailures = "*" nbconvert = "*" pillow = "*" plotly = ">=4.0" contourpy = "*" -pytest-github-actions-annotate-failures = "*" [feature.test-core.tasks] test-unit = 'pytest holoviews' @@ -93,6 +93,7 @@ scipy = ">=1.10" # Python 3.9 + Windows downloads 1.9 selenium = "*" spatialpandas = "*" datashader = ">=0.11.1" +xyzservices = "*" # dash >=1.16 [feature.test.target.unix.dependencies] From 37ccc9bad2842e8c76bd686f31ff43498c513081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 08:56:24 +0200 Subject: [PATCH 78/92] Adding coverage to examples --- .github/workflows/test.yaml | 4 +--- pyproject.toml | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3ffb3cda40..4314a36145 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -143,11 +143,10 @@ jobs: - name: Test Examples if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} test-example + pixi run -e ${{ matrix.environment }} test-example --cov=./holoviews --cov-report=xml --cov-append - uses: codecov/codecov-action@v4 if: needs.setup.outputs.code_change == 'true' with: - # fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} ui_test_suite: @@ -174,7 +173,6 @@ jobs: - uses: codecov/codecov-action@v4 if: needs.setup.outputs.code_change == 'true' with: - # fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} core_test_suite: diff --git a/pyproject.toml b/pyproject.toml index 1c950cfa20..9aeeecbc81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,6 +116,8 @@ filterwarnings = [ "ignore:Passing a (SingleBlockManager|BlockManager) to (Series|GeoSeries|DataFrame|GeoDataFrame) is deprecated:DeprecationWarning", # https://github.com/holoviz/spatialpandas/issues/137 # 2024-02 "ignore:The current Dask DataFrame implementation is deprecated:DeprecationWarning", # https://github.com/dask/dask/issues/10917 + # 2024-04 + "ignore:No data was collected:coverage.exceptions.CoverageWarning", # https://github.com/pytest-dev/pytest-cov/issues/627 ] [tool.coverage] From 3a7a6acf6079fb98e1c4573a59fb313cafb1626e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 09:29:52 +0200 Subject: [PATCH 79/92] Remove hatchling setupscript --- pyproject.toml | 3 -- scripts/hatch_build.py | 72 ------------------------------------------ 2 files changed, 75 deletions(-) delete mode 100644 scripts/hatch_build.py diff --git a/pyproject.toml b/pyproject.toml index 9aeeecbc81..26e5cc7324 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,9 +67,6 @@ examples = "holoviews/examples" [tool.hatch.build.hooks.vcs] version-file = "holoviews/_version.py" -# [tool.hatch.build.hooks.custom] -# path = "scripts/hatch_build.py" - [tool.pytest.ini_options] addopts = ["--strict-config", "--strict-markers", "--color=yes"] minversion = "7" diff --git a/scripts/hatch_build.py b/scripts/hatch_build.py deleted file mode 100644 index af9af60af5..0000000000 --- a/scripts/hatch_build.py +++ /dev/null @@ -1,72 +0,0 @@ -from __future__ import annotations - -import sys -import typing as t -from pathlib import Path - -from hatchling.builders.hooks.plugin.interface import BuildHookInterface - - -def install_pre_commit_hook() -> None: - """Install a pre-commit hook.""" - data = f"""#!/usr/bin/env bash -INSTALL_PYTHON={sys.executable} -ARGS=(hook-impl --config=.pre-commit-config.yaml --hook-type=pre-commit) -HERE="$(cd "$(dirname "$0")" && pwd)" -ARGS+=(--hook-dir "$HERE" -- "$@") -exec "$INSTALL_PYTHON" -m pre_commit "${{ARGS[@]}}" -""" - if not Path(".git").exists(): - return - - path = Path(".git/hooks/pre-commit") - if not path.exists(): - with path.open("w") as fid: - fid.write(data) - - mode = path.stat().st_mode - mode |= (mode & 0o444) >> 2 # copy R bits to X - path.chmod(mode) - - -def install_pre_push_hook(): - data = """#!/usr/bin/env bash -set -euo pipefail - -BRANCH=`git branch --show-current` - -if [[ "$BRANCH" =~ ^(master|main)$ ]]; then - echo - echo "Prevented pushing to $BRANCH. Use --no-verify to bypass this pre-push hook." - echo - exit 1 -fi - -exit 0 -""" - if not Path(".git").exists(): - return - - path = Path(".git/hooks/pre-push") - if not path.exists(): - with path.open("w") as fid: - fid.write(data) - - mode = path.stat().st_mode - mode |= (mode & 0o444) >> 2 # copy R bits to X - path.chmod(mode) - - -class HoloviewsBuildHook(BuildHookInterface): - """The hatch jupyter builder build hook.""" - - PLUGIN_NAME = "install" - - def initialize(self, version: str, _: dict[str, t.Any]) -> None: - """Initialize the plugin.""" - if self.target_name not in ["wheel", "sdist"]: - return - - if version == "editable": - install_pre_commit_hook() - install_pre_push_hook() From 308eb5114b03c0dd875c6180576e813fad609fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 09:32:51 +0200 Subject: [PATCH 80/92] Ignore __version.py file from coverage --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 26e5cc7324..763a7d993d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -119,6 +119,7 @@ filterwarnings = [ [tool.coverage] run.concurrency = ["greenlet"] +omit = ["holoviews/__version.py"] [tool.ruff] fix = true From 5a2145c7dcfd647e351b2585fae8b33353bacaf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 10:45:34 +0200 Subject: [PATCH 81/92] Add lint environment --- pixi.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pixi.toml b/pixi.toml index 6889632a36..c2ac6c9b4c 100644 --- a/pixi.toml +++ b/pixi.toml @@ -17,6 +17,7 @@ test-ui = ["py312", "test-core", "test", "test-ui"] test-core = ["py312", "test-core"] docs = ["py311", "example", "doc"] build = ["py311", "build"] +lint = ["py311", "lint"] [dependencies] python = ">=3.9" @@ -147,3 +148,13 @@ conda-build = "*" [feature.build.tasks] build-conda = 'bash scripts/conda/build.sh' build-pip = 'python -m build .' + +# ============================================= +# =================== lint ==================== +# ============================================= +[feature.lint.dependencies] +pre-commit = "*" + +[feature.lint.tasks] +lint = 'pre-commit run --all-files' +lint-install = 'pre-commit install' From d2891e858a55e98d69ff341436b71889ea2b254f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 11:46:49 +0200 Subject: [PATCH 82/92] Remove test-unit for the test-ui environment --- pixi.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pixi.toml b/pixi.toml index c2ac6c9b4c..acb8bf5d9e 100644 --- a/pixi.toml +++ b/pixi.toml @@ -9,12 +9,12 @@ download-data = 'python scripts/download_data.py' install = 'python -m pip install --no-deps --disable-pip-version-check -e .' [environments] -test-39 = ["py39", "test-core", "test", "example", "test-example"] -test-310 = ["py310", "test-core", "test", "example", "test-example"] -test-311 = ["py311", "test-core", "test", "example", "test-example"] -test-312 = ["py312", "test-core", "test", "example", "test-example"] +test-39 = ["py39", "test-core", "test", "example", "test-example", "test-unit-task"] +test-310 = ["py310", "test-core", "test", "example", "test-example", "test-unit-task"] +test-311 = ["py311", "test-core", "test", "example", "test-example", "test-unit-task"] +test-312 = ["py312", "test-core", "test", "example", "test-example", "test-unit-task"] test-ui = ["py312", "test-core", "test", "test-ui"] -test-core = ["py312", "test-core"] +test-core = ["py312", "test-core", "test-unit-task"] docs = ["py311", "example", "doc"] build = ["py311", "build"] lint = ["py311", "lint"] @@ -79,8 +79,8 @@ pillow = "*" plotly = ">=4.0" contourpy = "*" -[feature.test-core.tasks] -test-unit = 'pytest holoviews' +[feature.test-unit-task.tasks] +test-unit = 'pytest holoviews' # So it not showing up for UI tests [feature.test.dependencies] dask-core = "*" From fb90b4241cba455b75d43ff179db626835842497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 11:48:28 +0200 Subject: [PATCH 83/92] Add developer guide --- doc/developer_guide/index.md | 169 +++++++++++++++++++++++++++++++++++ doc/index.rst | 1 + 2 files changed, 170 insertions(+) create mode 100644 doc/developer_guide/index.md diff --git a/doc/developer_guide/index.md b/doc/developer_guide/index.md new file mode 100644 index 0000000000..d14eb8c963 --- /dev/null +++ b/doc/developer_guide/index.md @@ -0,0 +1,169 @@ +# Setting up a development environment + +The HoloViews library is a project that provides a wide range of data interfaces and an extensible set of plotting backends, which means the development and testing process involves a broad set of libraries. + +This guide describes how to install and configure development environments. + +If you have any problems with the steps here, please reach out in the `dev` channel on [Discord](https://discord.gg/rb6gPXbdAr) or on [Discourse](https://discourse.holoviz.org/). + +## Preliminaries + +### Basic understanding of how to contribute to Open Source + +If this is your first open-source contribution, please study one +or more of the below resources. + +- [How to Get Started with Contributing to Open Source | Video](https://youtu.be/RGd5cOXpCQw) +- [Contributing to Open-Source Projects as a New Python Developer | Video](https://youtu.be/jTTf4oLkvaM) +- [How to Contribute to an Open Source Python Project | Blog post](https://www.educative.io/blog/contribue-open-source-python-project) + +### Git + +The HoloViews source code is stored in a [Git](https://git-scm.com) source control repository. The first step to working on HoloViews is to install Git onto your system. There are different ways to do this, depending on whether you use Windows, Mac, or Linux. + +To install Git on any platform, refer to the [Installing Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) section of the [Pro Git Book](https://git-scm.com/book/en/v2). + +To contribute to HoloViews, you will also need [Github account](https://github.com/join) and knowledge of the [_fork and pull request workflow_](https://docs.github.com/en/get-started/quickstart/contributing-to-projects). + +### Pixi + +Developing all aspects of HoloViews requires a wide range of packages in different environments. To make this more manageable, Pixi manages the developer experience. To install Pixi, follow [this guide](https://prefix.dev/docs/pixi/overview#installation). + +TODO: Small explanation of environments and tasks. +TODO: Inform that .pixi directory will have all the environments in it, and can be big. + +## Installing the Project + +### Cloning the Project + +The source code for the HoloViews project is hosted on [GitHub](https://github.com/holoviz/holoviews). The first thing you need to do is clone the repository. + +1. Go to [github.com/holoviz/holoviews](https://github.com/holoviz/holoviews) +2. [Fork the repository](https://docs.github.com/en/get-started/quickstart/contributing-to-projects#forking-a-repository) +3. Run in your terminal: `git clone https://github.com//holoviews` + +The instructions for cloning above created a `holoviews` directory at your file system location. This `holoviews` directory is the _source checkout_ for the remainder of this document, and your current working directory is this directory. + +### Fetch tags from upstream + +The version number of the package depends on [`git tags`](https://git-scm.com/book/en/v2/Git-Basics-Tagging), so you need to fetch the tags from the upstream repository: + +```bash +git remote add upstream https://github.com/holoviz/holoviews.git +git fetch --tags upstream +git push --tags +``` + +## Start developing + +To start developing, run the following command + +```bash +pixi install +``` + +The first time you run it, it will create a `lock-file` with information for all available environments. This command will take a minute or so to run. When this is finished, it is possible to run the following command to download the data HoloViews tests and examples depend upon. + +```bash +pixi run download-data +``` + +TODO: PIXI TASKS, PIXI ENVIRONMENTS + +### Editable install + +It can be advantageous to install the HoloViews in [editable mode](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs) + +```bash +pixi run install +``` + +TODO: ADMONITION +Currently, this needs to be run for each environment. So, if you want to install in the `test-ui` environment, you can add `--environment`/`-e` to the command: + +```bash +pixi run -e test-ui install +``` + +## Linting + +HoloViews uses [pre-commit](https://pre-commit.com/) to apply linting to HoloViews code. Linting can be run for all the files with: + +```bash +pixi run lint +``` + +Linting can also be set up to run automatically with each commit; this is the recommended way because if linting is not passing, the [Continuous Integration](https://en.wikipedia.org/wiki/Continuous_integration) (CI) will also fail. + +```bash +pixi run lint-install +``` + +## Testing + +To help keep HoloViews maintainable, all Pull Requests (PR) with code changes should typically be accompanied by relevant tests. While exceptions may be made for specific circumstances, the default assumption should be that a Pull Request without tests will not be merged. + +There are three types of tasks and five environments related to tests. + +### Unit tests + +Unit tests are usually small tests executed with [pytest](https://docs.pytest.org). They can be found in `holoviews/tests/`. +Unit tests can be run with the `test-unit` task: + +```bash +pixi run test-unit +``` + +The task is available in the following environments: `test-39`, `test-310`, `test-311`, `test-312`, and `test-core`. Where the first ones have the same environments except for different Python versions, and `test-core` only has a core set of dependencies. + +If you haven't set the environment flag in the command, you need to select which one of the environments to use. + +### Example tests + +HoloViews's documentation consists mainly of Jupyter Notebooks. The example tests execute all the notebooks and fail if an error is raised. Example tests are possible thanks to [nbval](https://nbval.readthedocs.io/) and can be found in the `examples/` folder. +Example tests can be run with the following command: + +```bash +pixi run test-example +``` + +This task has the same environments as the unit tests except for `test-core`. + +### UI tests + +HoloViews provides web components that users can interact with through the browser. UI tests allow checking that these components get displayed as expected and that the backend <-> front-end bi-communication works correctly. UI tests are possible thanks to [Playwright](https://playwright.dev/python/). +The test can be found in the `holoviews/tests/ui/` folder. +UI tests can be run with the following task. This task is only available in the `test-ui` environment. The first time you run it, it will download the necessary browser files to run the tests in the Chrome browser. + +```bash +pixi run test-ui +``` + +## Documentation + +The documentation can be built with the command `pixi run docs-build`. As HoloViews uses notebooks for much of the documentation, this will take significant time to run (around an hour). If you want to run it locally, you can temporarily move the notebooks outside the examples so you only build the documentation for what you need. + +A development version of HoloViews can be found [here](https://dev.holoviews.org/). You can ask a maintainer if they want to make a dev release for your PR, but there is no guarantee they will say yes. + +## Build + +HoloViews have to build tasks. One is for installing packages with Pip, and the other is for installing packages with Conda. + +```bash +pixi run build-pip +pixi run build-conda +``` + +## Continuous Integration + +Every push to the `main` branch or any PR branch on GitHub automatically triggers a test build with [GitHub Actions](https://github.com/features/actions). + +You can see the list of all current and previous builds at [this URL](https://github.com/holoviz/holoviews/actions) + +### Etiquette + +GitHub Actions provides free build workers for open-source projects. A few considerations will help you be considerate of others needing these limited resources: + +- Run the tests locally before opening or pushing to an opened PR. + +- Group commits to meaningful chunks of work before pushing to GitHub (i.e., don't push on every commit). diff --git a/doc/index.rst b/doc/index.rst index fdf3210fc9..74b7aa900d 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -132,6 +132,7 @@ After you have successfully installed and configured HoloViews, please see `Gett User Guide Gallery Reference Gallery + Developer Guide Releases API FAQ From f4a18e483299b4b83f4205df76f8244f02d7a2c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 13:01:16 +0200 Subject: [PATCH 84/92] Remove environment variables as they are directly in the action --- .github/workflows/test.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4314a36145..1e3130852e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -36,13 +36,6 @@ env: DISPLAY: ":99.0" PYTHONIOENCODING: "utf-8" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OMP_NUM_THREADS: 1 - OPENBLAS_NUM_THREADS: 1 - MKL_NUM_THREADS: 1 - VECLIB_MAXIMUM_THREADS: 1 - NUMEXPR_NUM_THREADS: 1 - NUMBA_NUM_THREADS: 1 - PYDEVD_DISABLE_FILE_VALIDATION: 1 DASK_DATAFRAME__QUERY_PLANNING: false jobs: From f92a28598ea8121db0319dcf0f805e42c3d4f323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 13:01:53 +0200 Subject: [PATCH 85/92] Exclude lines from covarage --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 763a7d993d..56adbe9e01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,6 +120,11 @@ filterwarnings = [ [tool.coverage] run.concurrency = ["greenlet"] omit = ["holoviews/__version.py"] +exclude_also = [ + "if __name__ == .__main__.:", + "if TYPE_CHECKING:", + "if .pyodide. in sys.modules:", + ] [tool.ruff] fix = true From ad08c333a7cc4d50a35100da653e77bb2ff75aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 14:16:25 +0200 Subject: [PATCH 86/92] Remove coverage from examples as it significantly slows down the run time --- .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 1e3130852e..ef11a3ada8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -136,7 +136,7 @@ jobs: - name: Test Examples if: needs.setup.outputs.code_change == 'true' run: | - pixi run -e ${{ matrix.environment }} test-example --cov=./holoviews --cov-report=xml --cov-append + pixi run -e ${{ matrix.environment }} test-example - uses: codecov/codecov-action@v4 if: needs.setup.outputs.code_change == 'true' with: From 8c74dfe4a7ad54e4a4e072af6549c445df07699e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 14:54:39 +0200 Subject: [PATCH 87/92] Update developer guide --- doc/developer_guide/index.md | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/doc/developer_guide/index.md b/doc/developer_guide/index.md index d14eb8c963..5a5930082b 100644 --- a/doc/developer_guide/index.md +++ b/doc/developer_guide/index.md @@ -29,8 +29,19 @@ To contribute to HoloViews, you will also need [Github account](https://github.c Developing all aspects of HoloViews requires a wide range of packages in different environments. To make this more manageable, Pixi manages the developer experience. To install Pixi, follow [this guide](https://prefix.dev/docs/pixi/overview#installation). -TODO: Small explanation of environments and tasks. -TODO: Inform that .pixi directory will have all the environments in it, and can be big. +#### Glossary + +- Tasks: A task is what can be run with `pixi run `. Tasks can be anything from installing packages to running tests. +- Environments: An environment is a set of packages installed in a virtual environment. Each environment has a name; you can run tasks in a specific environment with the `-e` flag. For example, `pixi run -e test-core test-unit` will run the `test-unit` task in the `test-core` environment. +- Lock-file: A lock-file is a file that contains all the information about the environments. + +For more information, see the [Pixi documentation](https://pixi.sh/latest/). + +:::{admonition} Note +:class: info + +The first time you run `pixi`, it will create a `.pixi` directory in the source directory. This directory will contain all the files needed for the virtual environments. The `.pixi` directory can be large, so don't accidentally put it into a cloud-synced directory. +::: ## Installing the Project @@ -68,23 +79,25 @@ The first time you run it, it will create a `lock-file` with information for all pixi run download-data ``` -TODO: PIXI TASKS, PIXI ENVIRONMENTS - ### Editable install -It can be advantageous to install the HoloViews in [editable mode](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs) +It can be advantageous to install the HoloViews in [editable mode](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs): ```bash pixi run install ``` -TODO: ADMONITION -Currently, this needs to be run for each environment. So, if you want to install in the `test-ui` environment, you can add `--environment`/`-e` to the command: +:::{admonition} Note +:class: info + +Currently, this needs to be run for each environment. So, if you want to install in the `test-ui` environment, you can add `--environment` / `-e` to the command: ```bash pixi run -e test-ui install ``` +::: + ## Linting HoloViews uses [pre-commit](https://pre-commit.com/) to apply linting to HoloViews code. Linting can be run for all the files with: @@ -141,7 +154,13 @@ pixi run test-ui ## Documentation -The documentation can be built with the command `pixi run docs-build`. As HoloViews uses notebooks for much of the documentation, this will take significant time to run (around an hour). If you want to run it locally, you can temporarily move the notebooks outside the examples so you only build the documentation for what you need. +The documentation can be built with the command: + +```bash +pixi run docs-build +``` + +As HoloViews uses notebooks for much of the documentation, this will take significant time to run (around an hour). If you want to run it locally, you can temporarily move the notebooks outside the examples so you only build the documentation for what you need. A development version of HoloViews can be found [here](https://dev.holoviews.org/). You can ask a maintainer if they want to make a dev release for your PR, but there is no guarantee they will say yes. From 718403313d7ee8faf64276dacd1d73109245a10c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 16:09:40 +0200 Subject: [PATCH 88/92] Add to index.rst --- doc/index.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/index.rst b/doc/index.rst index 74b7aa900d..2edd33fdf3 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -138,3 +138,11 @@ After you have successfully installed and configured HoloViews, please see `Gett FAQ Roadmap About + +.. toctree:: + :titlesonly: + :hidden: + :maxdepth: 2 + :caption: FOR DEVELOPERS + + developer_guide/index From 788cf029b12395a87625ad923cda14a76b58a978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 16:10:00 +0200 Subject: [PATCH 89/92] Update extend-ignore --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 56adbe9e01..1090553c9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -123,8 +123,8 @@ omit = ["holoviews/__version.py"] exclude_also = [ "if __name__ == .__main__.:", "if TYPE_CHECKING:", - "if .pyodide. in sys.modules:", - ] + "if ._pyodide. in sys.modules:", +] [tool.ruff] fix = true From ab113a6e86e45d8399174c5db70b89fc4f3a4a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 18:42:06 +0200 Subject: [PATCH 90/92] Docs update --- doc/conf.py | 2 ++ doc/index.rst | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 63fe74c028..1c2cb85a52 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -61,6 +61,8 @@ 'nbsite.analytics', ] +myst_enable_extensions = ["colon_fence", "deflist"] + nbsite_analytics = { 'goatcounter_holoviz': True, } diff --git a/doc/index.rst b/doc/index.rst index 2edd33fdf3..74b7aa900d 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -138,11 +138,3 @@ After you have successfully installed and configured HoloViews, please see `Gett FAQ Roadmap About - -.. toctree:: - :titlesonly: - :hidden: - :maxdepth: 2 - :caption: FOR DEVELOPERS - - developer_guide/index From 9867caf1214110f3557f2eb7e4f70abf69e4f28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 19:26:49 +0200 Subject: [PATCH 91/92] Update documentation dev guide --- doc/developer_guide/index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/developer_guide/index.md b/doc/developer_guide/index.md index 5a5930082b..c25212997e 100644 --- a/doc/developer_guide/index.md +++ b/doc/developer_guide/index.md @@ -160,7 +160,9 @@ The documentation can be built with the command: pixi run docs-build ``` -As HoloViews uses notebooks for much of the documentation, this will take significant time to run (around an hour). If you want to run it locally, you can temporarily move the notebooks outside the examples so you only build the documentation for what you need. +As HoloViews uses notebooks for much of the documentation, this will take significant time to run (around an hour). +If you want to run it locally, you can temporarily disable the gallery by setting the environment variable `export HV_DOC_GALLERY=False`. +You can also disable the reference gallery by setting the environment variable `export HV_DOC_REF_GALLERY=False`. A development version of HoloViews can be found [here](https://dev.holoviews.org/). You can ask a maintainer if they want to make a dev release for your PR, but there is no guarantee they will say yes. From 8bd7937c9dd76747d1b76121be1594fac1c55ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Thu, 18 Apr 2024 19:36:01 +0200 Subject: [PATCH 92/92] Disable dask-expr for docs build --- .github/workflows/docs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 77eb16eba5..d3d8a607f2 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -46,6 +46,7 @@ jobs: PANEL_EMBED: "true" PANEL_EMBED_JSON: "true" PANEL_EMBED_JSON_PREFIX: "json" + DASK_DATAFRAME__QUERY_PLANNING: false steps: - uses: holoviz-dev/holoviz_tasks/pixi_install@pixi with: