Skip to content

Support Pint 0.24

Support Pint 0.24 #274

Workflow file for this run

name: CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
defaults:
run:
shell: bash -l {0}
jobs:
test:
name: ${{ matrix.os }}, 🐍=${{ matrix.python-version }}, OpenMM=${{ matrix.openmm }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
openmm: ["true", "false"]
python-version: ["3.10", "3.11", "3.12"]
pint-version: ["0.24"]
env:
CI_OS: ${{ matrix.os }}
PYVER: ${{ matrix.python-version }}
PYTEST_ARGS: -v -n logical
COV: --cov=openff/units --cov-report=xml --cov-config=setup.cfg --cov-append
steps:
- uses: actions/checkout@v4
- name: Install conda environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: devtools/conda-envs/test_env.yaml
create-args: >-
python=${{ matrix.python-version }}
pint=${{ matrix.pint-version }}
- name: Optionally install OpenMM
if: ${{ matrix.openmm == 'true' }}
run: micromamba install openmm -c conda-forge -yq
- name: Verify OpenMM is not installed when not expected
if: ${{ matrix.openmm == 'false' }}
run: |
# If the number of packages matching "*openmm*" is greater than zero
if [[ $(micromamba list | grep openmm | wc -l) -gt 0 ]]; then
micromamba list;
exit 1;
fi
- name: Install package
run: python -m pip install -e downstream_dummy/ .
- name: Run unit tests
run: |
if [[ ${{ matrix.openmm }} == false ]]; then
PYTEST_ARGS+=" --ignore=openff/units/_tests/test_openmm.py"
fi
python -m pytest $PYTEST_ARGS $COV openff/units/_tests/
- name: Run dummy package tests
run: python -m pytest $PYTEST_ARGS downstream_dummy/tests/
- name: Run mypy
if: ${{ matrix.python-version == '3.12' }}
run: python -m mypy -p "openff.units" && python -m mypy downstream_dummy/ --exclude=downstream_dummy/build/
- name: Run docexamples
if: ${{ matrix.openmm == 'true' }}
run: pytest --doctest-modules $PYTEST_ARGS openff --ignore=openff/units/_tests
- name: Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: false