Skip to content

Upload nightly wheels for PyWavelets to the Scientific Python Nightly… #10

Upload nightly wheels for PyWavelets to the Scientific Python Nightly…

Upload nightly wheels for PyWavelets to the Scientific Python Nightly… #10

Workflow file for this run

name: Test Pyodide build for PyWavelets
on:
push:
branches:
- master
- v1.**
pull_request:
branches:
- master
- v1.**
# Make it possible to upload wheels manually if needed
workflow_dispatch:
inputs:
push_wheels:
description: >
'Push wheels to Anaconda if "true". Default is "false". Warning: this will overwrite existing wheels.'
required: false
default: "false"
# Upload wheels to Anaconda on a schedule
schedule:
# Run at 0300 hours on days 3 and 17 of the month
- cron: "0 3 3,17 * *"
env:
FORCE_COLOR: 3
jobs:
build_wasm_emscripten:
name: Build PyWavelets for Pyodide
runs-on: ubuntu-latest
# Uncomment the following line to test changes on a fork
# if: github.repository == 'PyWavelets/pywt'
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v2
with:
python-version: "3.11.2"
- name: Install prerequisites
run: |
python -m pip install pyodide-build "pydantic<2"
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
- name: Set up Emscripten toolchain
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
actions-cache-folder: emsdk-cache
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: "18"
- name: Build PyWavelets
run: |
pyodide build
- name: Install and test wheel
run: |
pyodide venv .venv-pyodide
source .venv-pyodide/bin/activate
pip install dist/*.whl
pushd demo
pip install matplotlib pytest
python -c "import pywt; print(pywt.__version__)"
pytest --pyargs pywt
# https://anaconda.org/scientific-python-nightly-wheels/pywavelets
# WARNING: this job will overwrite existing wheels.
- name: Push to Anaconda PyPI index
if: (github.repository == 'PyWavelets/pywt') && (github.event_name == 'push' && github.ref == 'refs/heads/master') || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') || (github.event_name == 'schedule')
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
with:
artifacts_path: dist/
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}