Bump black from 20.8b1 to 24.3.0 #485
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PyMC3-HMM | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Cancels all previous workflow runs for pull requests that have not completed. | |
concurrency: | |
# The concurrency group contains the workflow name and the branch name for pull requests | |
# or the commit hash for any other events. | |
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
changes: | |
name: "Check for changes" | |
runs-on: ubuntu-latest | |
outputs: | |
changes: ${{ steps.changes.outputs.src }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
python: &python | |
- 'pymc3_hmm/*.py' | |
- 'tests/*.py' | |
- '*.py' | |
src: | |
- *python | |
- '.github/**/*.yml' | |
- 'setup.cfg' | |
- 'requirements.txt' | |
- '.coveragerc' | |
- '.pre-commit-config.yaml' | |
style: | |
name: Check code style | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- uses: pre-commit/[email protected] | |
python-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7] | |
pymc3-version: [stable] | |
# pymc3-version: [stable, dev] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
mamba-version: "*" | |
channels: conda-forge,defaults | |
channel-priority: true | |
python-version: ${{ matrix.python-version }} | |
auto-update-conda: true | |
- name: Install dependencies | |
shell: bash -l {0} | |
run: | | |
mamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" theano-pymc mkl numpy scipy pip mkl-service datashader | |
if [[ "${{ matrix.pymc3-version }}" != "stable" ]]; then pip install "pymc3 @ git+https://github.com/pymc-devs/pymc3.git@master"; fi | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
mamba list && pip freeze | |
python -c 'import theano; print(theano.config.__str__(print_doc=False))' | |
python -c 'import theano; assert(theano.config.blas__ldflags != "")' | |
env: | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
- name: Test with pytest | |
shell: bash -l {0} | |
run: | | |
pytest -x -r A --verbose tests --cov=pymc3_hmm --cov-report=xml:./coverage.xml | |
env: | |
MKL_THREADING_LAYER: GNU | |
MKL_NUM_THREADS: 1 | |
OMP_NUM_THREADS: 1 | |
- name: Fetch main for coverage diff | |
shell: bash -l {0} | |
run: | | |
git fetch --no-tags --prune origin main | |
- name: Check coverage | |
shell: bash -l {0} | |
run: | | |
diff-cover ./coverage.xml --compare-branch=origin/main --fail-under=100 --diff-range-notation '..' |