Skip to content

ENH: Add masking support for many algorithms #99

ENH: Add masking support for many algorithms

ENH: Add masking support for many algorithms #99

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# Will only trigger if there is a change within pybaselines or tests directories.
name: tests
on:
# allow manually activating the workflow
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'pybaselines/**'
- 'tests/**'
- '.github/workflows/**'
pull_request:
# always trigger on a pull request, regardless of the branch
paths:
- 'pybaselines/**'
- 'tests/**'
- '.github/workflows/**'
# cancel current jobs if a new job is started
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Use strings since yaml considers 3.10 equal to 3.1
# Only test one free-threaded build since threaded tests are very
# time consuming
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install required dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Test with required dependencies
run: pytest .
- name: Install optional dependencies
# uncomment the if statement below to allow skipping versions
#if: matrix.python-version != '3.14t'
run: python -m pip install .[full]
- name: Test with optional dependencies
run: pytest .
test-min-dependencies:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install minimum dependencies
# set installed versions using "==major.minor.*"" to allow bug fixes on patch versions
# for minimum supported versions
run: |
python -m pip install --upgrade pip
python -m pip install .[test] "numpy==1.22.*" "scipy==1.8.*"
- name: Test with minimum required dependencies
run: pytest .
- name: Install minimum optional dependencies
run: python -m pip install "numba==0.55.*"
- name: Test with minimum optional dependencies
run: pytest .
lint-and-doctest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# only test earliest and latest supported Python versions since the examples should
# be fairly simple
python-version: ['3.10', '3.14']
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
# TODO will need to think of how to handle doctests when they rely on optional dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[test, doctest, lint]"
- name: Lint
id: lint
run: ruff check .
- name: Doctest
id: doctest
# Run this step if the linting (and only the linting) failed; if a step before linting
# failed, its outcome would be "skipped", so just need to check for lint's failure. If this
# passes and linting fails, the job will still report failing, which is the desired outcome
if: success() || steps.lint.outcome == 'failure'
run: pytest pybaselines --doctest-modules
# Uses https://github.com/crate-ci/typos to spell check; note that it can be used as
# a GitHub action instead of downloading from PyPI and running, but the action only gives
# a pass/fail output, while running the actual program will output where each typo is so
# that it is much easier to correct
- name: Spell Check
# same logic as for doctesting, always want to run this if possible
if: success() || steps.lint.outcome == 'failure' || steps.doctest.outcome == 'failure'
run: typos