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

Migrate colorcet to using pixi for development #128

Merged
merged 26 commits into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
151 changes: 110 additions & 41 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: packages

on:
push:
tags:
Expand All @@ -12,62 +11,132 @@ on:
schedule:
- cron: '0 9 * * SUN'

env:
PYTHON_VERSION: "3.11"
PACKAGE: "colorcet"

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

jobs:
waiting_room:
name: Waiting Room
runs-on: ubuntu-latest
needs: [conda_build, pip_install]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
environment:
name: publish
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@v0

conda_build:
name: Build Conda Packages
runs-on: 'ubuntu-latest'
name: Build Conda
needs: [pixi_lock]
runs-on: "ubuntu-latest"
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_install@v0
with:
environments: "build"
download-data: false
install: false
- name: conda build
run: pixi run -e build build-conda
- uses: actions/upload-artifact@v4
if: always()
with:
name: conda
path: dist/*.tar.bz2
if-no-files-found: error

conda-publish:
name: Publish Conda
runs-on: ubuntu-latest
needs: [conda_build, waiting_room]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
defaults:
run:
shell: bash -l {0}
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/download-artifact@v4
with:
name: conda
path: dist/
- name: Set environment variables
run: |
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "CONDA_FILE=$(ls dist/*.tar.bz2)" >> $GITHUB_ENV
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
python-version: "3.11"
auto-update-conda: true
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
channels: "conda-forge"
- name: conda setup
run: |
conda install anaconda-client conda-build setuptools_scm
- name: conda build
run: |
VERSION=`python -m setuptools_scm` conda build conda.recipe/
conda install -y anaconda-client
- name: conda dev upload
if: (github.event_name == 'push' && (contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
if: contains(env.TAG, 'a') || contains(env.TAG, 'b') || contains(env.TAG, 'rc')
run: |
anaconda --token ${{ secrets.CONDA_UPLOAD_TOKEN }} upload --user pyviz --label=dev $(VERSION=`python -m setuptools_scm` conda build --output conda.recipe)
anaconda --token ${{ secrets.CONDA_UPLOAD_TOKEN }} upload --user pyviz --label=dev $CONDA_FILE
- name: conda main upload
if: (github.event_name == 'push' && !(contains(steps.vars.outputs.tag, 'a') || contains(steps.vars.outputs.tag, 'b') || contains(steps.vars.outputs.tag, 'rc')))
if: (!(contains(env.TAG, 'a') || contains(env.TAG, 'b') || contains(env.TAG, 'rc')))
run: |
anaconda --token ${{ secrets.CONDA_UPLOAD_TOKEN }} upload --user pyviz --label=dev --label=main $(VERSION=`python -m setuptools_scm` conda build --output conda.recipe)
anaconda --token ${{ secrets.CONDA_UPLOAD_TOKEN }} upload --user pyviz --label=dev --label=main $CONDA_FILE

pip_build:
name: Build PyPI Packages
runs-on: 'ubuntu-latest'
defaults:
run:
shell: bash -l {0}
name: Build PyPI
needs: [pixi_lock]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- name: Set up Python
uses: actions/setup-python@v5
- uses: holoviz-dev/holoviz_tasks/pixi_install@v0
with:
python-version: "3.11"
- name: env setup
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: pip build
run: |
python -m build
- name: Publish package to PyPI
if: github.event_name == 'push'
environments: "build"
download-data: false
install: false
- name: Build package
run: pixi run -e build build-pip
- uses: actions/upload-artifact@v4
if: always()
with:
name: pip
path: dist/
if-no-files-found: error

pip_install:
name: Install PyPI
runs-on: "ubuntu-latest"
needs: [pip_build]
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/download-artifact@v4
with:
name: pip
path: dist/
- name: Install package
run: python -m pip install dist/*.whl
- name: Import package
run: python -c "import $PACKAGE; print($PACKAGE._version.__version__)"

pip_publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [pip_build, waiting_room]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
permissions:
id-token: write
steps:
- uses: pypa/gh-action-pypi-publish@release/v1
with:
name: pip
path: dist/
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.PPU }}
Expand Down
79 changes: 54 additions & 25 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

name: docs

on:
push:
tags:
Expand All @@ -11,7 +9,7 @@ on:
workflow_dispatch:
inputs:
target:
description: 'Site to build and deploy'
description: 'Site to build and deploy, or dry-run'
type: choice
options:
- dev
Expand All @@ -22,38 +20,69 @@ on:
schedule:
- cron: '0 9 * * SUN'

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

env:
PYTHON_VERSION: "3.11"
MPLBACKEND: "Agg"

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

docs_build:
name: Build Documentation
needs: [pixi_lock]
runs-on: 'ubuntu-latest'
timeout-minutes: 120
defaults:
run:
shell: bash -l {0}
outputs:
tag: ${{ steps.vars.outputs.tag }}
env:
MPLBACKEND: "Agg"
DISPLAY: ":99.0"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: holoviz-dev/holoviz_tasks/pixi_install@v0
with:
environments: docs
- name: Build documentation
run: pixi run -e docs docs-build
- uses: actions/upload-artifact@v4
if: always()
with:
fetch-depth: "100"
- name: Fetch
run: git fetch --prune --tags -f
name: docs
if-no-files-found: error
path: builtdocs
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: install
run: pip install ."[doc, examples]"
- name: build docs
run: sphinx-build -b html doc builtdocs
- name: git status
run: |
git status
git diff
echo "Deploying from ref ${GITHUB_REF#refs/*/}"
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: report failure
if: failure()
run: cat /tmp/sphinx-*.log | tail -n 100

docs_publish:
name: Publish Documentation
runs-on: "ubuntu-latest"
needs: [docs_build]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
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
if: |
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/nightly_lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: nightly_lock
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

env:
PACKAGE: "colorcet"

jobs:
pixi_lock:
if: ${{ !github.event.repository.fork }}
name: Pixi lock
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_lock@v0
Loading