Skip to content

Support Python 3.12 only #482

Support Python 3.12 only

Support Python 3.12 only #482

Workflow file for this run

name: CI
on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# Existing codes likely still have "master" as the primary branch
# Both are tracked here to keep legacy and new codes working
push:
branches:
- "master"
- "main"
pull_request:
branches:
- "master"
- "main"
schedule:
# Nightly tests run on master by default:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "0 3 10 * *"
jobs:
test:
name: Test on ${{ matrix.cfg.os }}, Python ${{ matrix.cfg.python-version }}
runs-on: ${{ matrix.cfg.os }}
strategy:
matrix:
cfg:
- os: ubuntu-latest
python-version: "3.12"
- os: macos-latest
python-version: "3.12"
- os: windows-latest
python-version: "3.12"
steps:
- uses: actions/checkout@v3
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/marketplace/actions/provision-with-micromamba
- uses: mamba-org/provision-with-micromamba@main
with:
environment-file: devtools/conda-envs/test_env.yaml
environment-name: test
channels: conda-forge,defaults
extra-specs: |
python=${{ matrix.python-version }}
- name: Install package
shell: bash -l {0}
run: |
python -m pip install . --no-deps
micromamba list
- name: Run tests
shell: bash -l {0}
run: |
pytest -v --cov=dynophores --cov-report=xml --color=yes dynophores/tests/
- name: Run docs notebooks tests
shell: bash -l {0}
run: |
PYTEST_ARGS="--nbval-lax --current-env --nbval-cell-timeout=900"
pytest $PYTEST_ARGS docs/tutorials/*.ipynb -vvv
pytest $PYTEST_ARGS dynophores/notebooks/*.ipynb -vvv
- name: CodeCov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
lint-format:
name: Lint/format test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.12]
steps:
- uses: actions/checkout@v3
# More info on options: https://github.com/marketplace/actions/provision-with-micromamba
- uses: mamba-org/provision-with-micromamba@main
with:
environment-file: devtools/conda-envs/test_env.yaml
environment-name: test
channels: conda-forge,defaults
extra-specs: |
python=${{ matrix.python-version }}
- name: Install linter and formatter
shell: bash -l {0}
run: |
python -m pip install shyaml flake8 black black-nb flake8-nb
- name: Run black check
shell: bash -l {0}
run: |
black --check -l 99 dynophores
- name: Run flake8
shell: bash -l {0}
run: |
flake8 --config setup.cfg dynophores
- name: Run black-nb check
shell: bash -l {0}
run: |
black-nb --check -l 99 docs/tutorials/*.ipynb
black-nb --check -l 99 dynophores/notebooks/*.ipynb
- name: Run flake8-nb
shell: bash -l {0}
run: |
flake8-nb --config setup.cfg docs/tutorials/*.ipynb
flake8-nb --config setup.cfg dynophores/notebooks/*.ipynb
docs:
name: Docs test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.12]
steps:
- uses: actions/checkout@v3
# More info on options: https://github.com/marketplace/actions/provision-with-micromamba
- uses: mamba-org/provision-with-micromamba@main
with:
environment-file: devtools/conda-envs/test_env.yaml
environment-name: test
channels: conda-forge,defaults
extra-specs: |
python=${{ matrix.python-version }}
- name: Install package
shell: bash -l {0}
run: |
python -m pip install . --no-deps
micromamba list
- name: Run sphinx
shell: bash -l {0}
run: |
cd docs
make clean
SPHINXOPTS="-W -T --keep-going" make html