Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Pixi for development / CI and hatchling for build system #733

Merged
merged 32 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8ebc81a
Only run test if xarray or scipy is installed
hoxbro Jun 21, 2024
fc9766e
Add first pixi file
hoxbro Jun 21, 2024
efb0bda
Update test workflow
hoxbro Jun 21, 2024
ff6bf4a
Add pip to deps
hoxbro Jun 21, 2024
511b086
Update pixi.toml for tests
hoxbro Jun 21, 2024
f0b4260
Update doc feature
hoxbro Jun 21, 2024
d61068a
Fix coverage path
hoxbro Jun 21, 2024
bdb8861
Update docs.yaml
hoxbro Jun 21, 2024
db11901
Add nodejs
hoxbro Jun 21, 2024
0657039
Add lint feature
hoxbro Jun 21, 2024
4408625
Enable build step
hoxbro Jun 21, 2024
a439c22
Add iris to test dependencies
hoxbro Jun 21, 2024
f2727b2
Update to hatch
hoxbro Jun 21, 2024
d593b21
add __version.py
hoxbro Jun 21, 2024
f78b9b8
Ignore Python 3.10 lints for now
hoxbro Jun 21, 2024
1499dd4
Update conda core
hoxbro Jun 21, 2024
3171ad1
Update conda geoviews-recommened
hoxbro Jun 21, 2024
8e201eb
fix
hoxbro Jun 21, 2024
2e93b5f
Update build
hoxbro Jun 21, 2024
4a88c86
Add nighly lock workflow
hoxbro Jun 21, 2024
39cbcb5
fix
hoxbro Jun 21, 2024
ac9554d
fix 2
hoxbro Jun 21, 2024
0ab15eb
Update pixi deps
hoxbro Jun 21, 2024
658d402
Add sync git tag
hoxbro Jun 21, 2024
f45d913
Lint toml
hoxbro Jun 21, 2024
804d4ba
Align files in packages
hoxbro Jun 22, 2024
90a755f
Fix iris test not running
hoxbro Jun 22, 2024
5be00f8
remove old setting files
hoxbro Jun 22, 2024
fef50df
Merge branch 'main' into pixi
hoxbro Jun 22, 2024
1959fcf
Add developer guide to the documentation
hoxbro Jun 22, 2024
68e43fd
Update docs build
hoxbro Jun 22, 2024
a189b83
Add strict mode to bash
hoxbro Jun 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

78 changes: 27 additions & 51 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ env:
PACKAGE: "geoviews"
PYTHON_VERSION: "3.11"
NODE_VERSION: "20"
MPLBACKEND: "Agg"
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"

jobs:
waiting_room:
Expand All @@ -33,36 +31,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
with:
miniconda-version: "latest"
- uses: actions/setup-node@v4
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
node-version: ${{ env.NODE_VERSION }}
- name: conda setup
run: |
conda install -y conda-build build pyct
environments: "build"
install: false
download-data: false
- name: conda build
run: |
source ./scripts/conda/build.sh
echo "CONDA_FILE="$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2"" >> $GITHUB_ENV
echo "CONDA_CORE_FILE="$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-core-$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 }}
${{ env.CONDA_CORE_FILE }}
path: dist/*.tar.bz2
if-no-files-found: error

conda_publish:
Expand Down Expand Up @@ -99,24 +90,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
- 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: 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 @@ -160,27 +143,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
99 changes: 55 additions & 44 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,66 +1,77 @@
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 18 * * SUN'
- cron: "0 18 * * SUN"

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

env:
DISPLAY: ":99.0"

jobs:
build_docs:
name: Documentation
runs-on: 'ubuntu-latest'
timeout-minutes: 120
defaults:
run:
shell: bash -l {0}
env:
DESC: "Documentation build"
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
MPLBACKEND: "Agg"
MOZ_HEADLESS: 1
DISPLAY: ":99.0"
DASK_DATAFRAME__QUERY_PLANNING: false
pixi_lock:
name: Pixi lock
runs-on: ubuntu-latest
steps:
- uses: holoviz-dev/holoviz_tasks/install@v0
- uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi

docs_build:
name: Build Documentation
needs: [pixi_lock]
runs-on: "macos-latest"
timeout-minutes: 180
outputs:
tag: ${{ steps.vars.outputs.tag }}
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
environments: docs
- name: Build documentation
run: pixi run -e docs docs-build
- uses: actions/upload-artifact@v4
if: always()
with:
name: Documentation
python-version: "3.10"
channels: pyviz,conda-forge,nodefaults
envs: "-o doc -o examples_extra"
cache: true
conda-update: true
name: docs
if-no-files-found: error
path: builtdocs
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: download data
run: |
conda activate test-environment
python download_data.py
- name: generate rst
run: |
conda activate test-environment
nbsite generate-rst --org holoviz --project-name geoviews
- name: build docs
run: |
conda activate test-environment
nbsite build --what=html --output=builtdocs --org holoviz --project-name geoviews

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 "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 @@ -73,7 +84,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
25 changes: 25 additions & 0 deletions .github/workflows/nightly_lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: nightly_lock
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

env:
PACKAGE: "geoviews"

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
if: '!github.event.pull_request.head.repo.fork'
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"
run: |
zip $(date +%Y-%m-%d).zip pixi.lock pixi.toml
aws s3 cp ./$(date +%Y-%m-%d).zip s3://assets.holoviz.org/lock/$PACKAGE/
Loading