Skip to content

Commit

Permalink
Switch to Pixi for development / CI and hatchling for build system (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored Apr 19, 2024
1 parent 39489c5 commit 4727470
Show file tree
Hide file tree
Showing 25 changed files with 677 additions and 593 deletions.
44 changes: 17 additions & 27 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ defaults:
shell: bash -el {0}

env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
PYTHON_VERSION: "3.11"
PACKAGE: "holoviews"

Expand All @@ -30,31 +29,28 @@ 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"
download-data: false
- name: conda build
run: |
source ./scripts/build_conda.sh
echo "CONDA_FILE="$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2"" >> $GITHUB_ENV
run: pixi run -e build build-conda
- uses: actions/upload-artifact@v4
if: always()
with:
name: conda
path: ${{ env.CONDA_FILE }}
path: dist/*tar.bz2
if-no-files-found: error

conda_publish:
Expand Down Expand Up @@ -88,21 +84,15 @@ 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"
download-data: false
- name: Build package
run: python -m build .
run: pixi run -e build build-pip
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
36 changes: 12 additions & 24 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -39,35 +46,16 @@ jobs:
PANEL_EMBED: "true"
PANEL_EMBED_JSON: "true"
PANEL_EMBED_JSON_PREFIX: "json"
DASK_DATAFRAME__QUERY_PLANNING: false
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
- name: Build documentation
run: pixi run -e docs docs-build
- name: upload dev
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'dev') ||
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/nightly_lock.yaml
Original file line number Diff line number Diff line change
@@ -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
139 changes: 45 additions & 94 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,10 @@ defaults:
shell: bash -el {0}

env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
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:
pre_commit:
Expand All @@ -61,7 +54,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
Expand All @@ -71,7 +64,7 @@ jobs:
code:
- 'holoviews/**'
- 'examples/**'
- 'setup.py'
- 'pixi.toml'
- 'pyproject.toml'
- '.github/workflows/test.yaml'
- name: Set matrix option
Expand All @@ -90,153 +83,111 @@ jobs:
if: env.MATRIX_OPTION == 'default'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"python-version": ["3.9", "3.12"]
"os": ["ubuntu-latest", "macos-14", "windows-latest"],
"environment": ["test-39", "test-312"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
- name: Set test matrix with 'full' option
if: env.MATRIX_OPTION == 'full'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"python-version": ["3.9", "3.10", "3.11", "3.12"]
"os": ["ubuntu-latest", "macos-14", "windows-latest"],
"environment": ["test-39", "test-310", "test311", "test312"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
- name: Set test matrix with 'downstream' option
if: env.MATRIX_OPTION == 'downstream'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest"],
"python-version": ["3.11"]
"environment": ["test-311"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
pixi_lock:
name: Pixi lock
runs-on: ubuntu-latest
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi
with:
cache: ${{ github.event.inputs.cache == 'true' || github.event.inputs.cache == '' }}

unit_test_suite:
name: Unit tests on Python ${{ matrix.python-version }}, ${{ matrix.os }}
needs: [pre_commit, setup]
name: unit:${{ matrix.environment }}:${{ matrix.os }}
needs: [pre_commit, setup, pixi_lock]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
timeout-minutes: 120
env:
DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} unit tests"
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: holoviz-dev/holoviz_tasks/install@v0
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
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
id: install
environments: ${{ matrix.environment }}
- 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
pixi run -e ${{ matrix.environment }} check-latest-packages bokeh panel param datashader
- name: Test Unit
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
doit test_unit
- name: test examples
pixi run -e ${{ matrix.environment }} test-unit --cov=./holoviews --cov-report=xml
- name: Test Examples
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
doit test_examples
- name: codecov
pixi run -e ${{ matrix.environment }} test-example
- uses: codecov/codecov-action@v4
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
codecov
with:
token: ${{ secrets.CODECOV_TOKEN }}

ui_test_suite:
name: UI tests on Python ${{ matrix.python-version }}, ${{ matrix.os }}
needs: [pre_commit, setup]
name: ui:${{ matrix.environment }}:${{ matrix.os }}
needs: [pre_commit, setup, pixi_lock]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9"]
environment: ["test-ui"]
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
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
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
environments: ${{ matrix.environment }}
- name: Test UI
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
doit test_ui
- name: Upload coverage to Codecov
pixi run -e ${{ matrix.environment }} test-ui --cov=./holoviews --cov-report=xml
- uses: codecov/codecov-action@v4
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)
token: ${{ secrets.CODECOV_TOKEN }}

core_test_suite:
name: Core tests on Python ${{ matrix.python-version }}, ${{ matrix.os }}
needs: [pre_commit, setup]
name: core:${{ matrix.environment }}:${{ matrix.os }}
needs: [pre_commit, setup, pixi_lock]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.12"]
environment: ["test-core"]
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
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
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
environments: ${{ matrix.environment }}
- 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
pixi run -e ${{ matrix.environment }} check-latest-packages numpy pandas bokeh panel param
- name: Test Unit
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
pytest holoviews
pixi run -e ${{ matrix.environment }} test-unit
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
.ipynb_checkpoints
.coverage
.pytest_cache
.pixi
holoviews/_version.py

/release
/doc/Tutorials-WIP/*.ipynb
.idea
.vscode
holoviews.rc
/examples/assets/
ghostdriver.log
holoviews/.version
.dir-locals.el
Expand Down
Loading

0 comments on commit 4727470

Please sign in to comment.