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 May 14, 2024
1 parent 5aeb017 commit a22fb70
Show file tree
Hide file tree
Showing 37 changed files with 1,197 additions and 1,467 deletions.
94 changes: 34 additions & 60 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ env:
PYTHON_VERSION: "3.11"
NODE_VERSION: "20"
MPLBACKEND: "Agg"
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"

jobs:
waiting_room:
Expand All @@ -33,33 +32,29 @@ 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
with:
fetch-depth: "100"
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- uses: conda-incubator/setup-miniconda@v3
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
miniconda-version: "latest"
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: conda setup
run: |
conda install -y conda-build build
environments: "build"
install: false
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 @@ -93,24 +88,16 @@ 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
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/setup-node@v4
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install build
run: |
python -m pip install build
environments: "build"
install: false
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 Expand Up @@ -154,27 +141,20 @@ jobs:

npm_build:
name: Build NPM
needs: [pixi_lock]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "100"
- uses: actions/setup-python@v5
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- name: package install
run: |
python -m pip install -ve .
environments: "build"
download-data: false
- name: npm build
run: |
cd ${{ env.PACKAGE }}
TARBALL=$(npm pack .)
TARBALL=$(pixi run build-npm)
echo "TARBALL=$TARBALL" >> $GITHUB_ENV
- name: npm publish dry-run
run: |
cd $PACKAGE
npm publish --dry-run $TARBALL
cd ..
- uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -216,26 +196,20 @@ jobs:
cdn_build:
name: Build CDN
needs: [pixi_lock]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "100"
- uses: actions/setup-python@v5
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
environments: "build"
install: false
download-data: false
- name: build pyodide wheels
run: |
python -m pip install packaging
python ./scripts/build_pyodide_wheels.py --verify-clean
pixi run build-pyodide --verify-clean
- name: build CDN
run: |
python -m pip install -ve .
pixi run build-pip
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
123 changes: 58 additions & 65 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,86 +3,79 @@ name: docs
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+b[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+a[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+b[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
workflow_dispatch:
inputs:
target:
description: 'Site to build and deploy'
description: "Site to build and deploy"
type: choice
options:
- dev
- main
- dryrun
- dev
- main
- dryrun
required: true
default: dryrun
schedule:
- cron: '0 19 * * SUN'
- cron: "0 19 * * SUN"

defaults:
run:
shell: bash -el {0}

env:
MPLBACKEND: "Agg"
MOZ_HEADLESS: 1
DISPLAY: ":99.0"
PANEL_IPYWIDGET: 1

jobs:
build_docs:
name: Documentation
runs-on: 'macos-14'
pixi_lock:
name: Pixi lock
runs-on: ubuntu-latest
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi

docs_build:
name: Build Documentation
needs: [pixi_lock]
runs-on: "macos-latest"
timeout-minutes: 180
defaults:
run:
shell: bash -l {0}
env:
DESC: "Documentation build"
MPLBACKEND: "Agg"
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
MOZ_HEADLESS: 1
DISPLAY: ":99.0"
PANEL_IPYWIDGET: 1
outputs:
tag: ${{ steps.vars.outputs.tag }}
steps:
- uses: holoviz-dev/holoviz_tasks/install@v0
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
name: doc_build
python-version: "3.11"
channels: pyviz/label/dev,conda-forge,bokeh,nodefaults
conda-update: 'true'
nodejs: true
nodejs-version: 20
# Remove when all examples tools can be installed on 3.10
envs: -o examples -o doc -o build
cache: true
environments: docs
opengl: true
- name: doit develop_install
if: steps.install.outputs.cache-hit != 'true'
run: |
conda activate test-environment
pip install --use-deprecated=legacy-resolver pyecharts ipywidgets_bokeh==1.5.0
- name: bokeh sampledata
run: |
conda activate test-environment
bokeh sampledata
- name: refmanual
run: |
conda activate test-environment
python ./doc/generate_modules.py panel -d ./doc/api -n panel -e tests
- name: build docs
run: |
conda activate test-environment
python scripts/gallery/convert_gallery.py
nbsite build --what=html --output=builtdocs --org holoviz --project-name panel
cp -r ./panel/dist ./builtdocs/panel_dist
- name: convert gallery
run: |
conda activate test-environment
panel convert examples/gallery/*.ipynb doc/how_to/*/examples/*.md --to pyodide-worker --out ./builtdocs/pyodide/ --pwa --index --requirements doc/pyodide_dependencies.json
- name: git status and git diff
run: |
git status
git diff
- name: Set and echo git ref
- name: Build documentation
run: pixi run -e docs docs-build
- uses: actions/upload-artifact@v4
if: always()
with:
name: docs
if-no-files-found: error
path: builtdocs
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT

docs_publish:
name: Publish Documentation
runs-on: "ubuntu-latest"
needs: [docs_build]
steps:
- uses: actions/download-artifact@v4
with:
name: docs
path: builtdocs/
- name: Set output
id: vars
run: |
echo "Deploying from ref ${GITHUB_REF#refs/*/}"
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
run: echo "tag=${{ needs.docs_build.outputs.tag }}" >> $GITHUB_OUTPUT
- name: Deploy dev
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'dev') ||
(github.event_name == 'push' && (contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
Expand All @@ -95,7 +88,7 @@ jobs:
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'main') ||
(github.event_name == 'push' && !(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./builtdocs
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/nightly_lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: nightly_lock
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
pixi_lock:
name: Pixi lock
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi
- name: Upload lock-file to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "eu-west-1"
PACKAGE: "panel"
run: |
zip $(date +%Y-%m-%d).zip pixi.lock
aws s3 cp ./$(date +%Y-%m-%d).zip s3://assets.holoviz.org/lock/$PACKAGE/
Loading

0 comments on commit a22fb70

Please sign in to comment.