Skip to content

Update pyodide to 0.27 for numpy 2 support unpinns cchdo.hydro #289

Update pyodide to 0.27 for numpy 2 support unpinns cchdo.hydro

Update pyodide to 0.27 for numpy 2 support unpinns cchdo.hydro #289

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint and Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: setup.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Lint with ruff
run: |
ruff check
- name: Test code style with ruff
run: |
ruff format --check
pytest:
name: Pytest ${{matrix.dep}}
runs-on: ubuntu-latest
strategy:
matrix:
dep: ["selftest", "test", "testminnumpy"]
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: setup.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[${{matrix.dep}}]
- name: Test with pytest
run: |
if [[ "${{ matrix.dep }}" == "selftest" ]];
then
pytest --pyargs cchdo.hydro
else
pytest --pyargs cchdo.hydro -n 4 --cov-report xml --cov=cchdo
fi
- name: Upload coverage to Coveralls
uses: coverallsapp/[email protected]
if: ${{matrix.dep}} != "selftest"
continue-on-error: true
with:
file: ./coverage.xml
typing:
name: Typing with mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: setup.py
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[test]
- name: Test typing
run: |
mypy --namespace-packages --explicit-package-bases cchdo