Merge remote-tracking branch 'upstream/main' into pytest-8 #1772
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: Conda latest | |
on: | |
push: | |
release: | |
types: | |
- released | |
- prereleased | |
schedule: | |
- cron: "0 20 * * *" | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
test: | |
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}, OpenEye=${{ matrix.openeye }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
python-version: ["3.10"] | |
openeye: ["true", "false"] | |
env: | |
OPENEYE: ${{ matrix.openeye }} | |
OE_LICENSE: ${{ github.workspace }}/oe_license.txt | |
PYTEST_ARGS: -r fE --tb=short -n logical --durations=20 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Vanilla install from conda | |
uses: mamba-org/setup-micromamba@v2 | |
if: ${{ matrix.openeye == 'false' }} | |
with: | |
environment-file: devtools/conda-envs/conda.yaml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
- name: Install from conda with OpenEye | |
uses: mamba-org/setup-micromamba@v2 | |
if: ${{ matrix.openeye == 'true' }} | |
with: | |
environment-file: devtools/conda-envs/conda_oe.yaml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
openff-toolkit-examples | |
smirnoff-plugins=2024 | |
pytest-xdist | |
pytest-rerunfailures | |
- name: Install OpenEye Toolkits | |
if: ${{ matrix.openeye == 'true' }} | |
run: micromamba install openeye-toolkits -c openeye | |
- name: Make oe_license.txt file from GH org secret "OE_LICENSE" | |
if: ${{ matrix.openeye == 'true' }} | |
env: | |
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }} | |
run: | | |
echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE} | |
- name: Environment Information | |
run: | | |
micromamba info | |
micromamba list | |
pip list | |
- name: Check installed toolkits | |
run: | | |
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-toolkit.git | cut -f2 | grep -E "([0-9]+)\.([0-9]+)\.([0-9]+)$" | sort --version-sort | tail -1 | sed 's/refs\/tags\///') | |
if [[ "$OPENEYE" == true ]]; then | |
python -c "from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE; assert OPENEYE_AVAILABLE, 'OpenEye unavailable'" | |
fi | |
if [[ "$OPENEYE" == false ]]; then | |
if [[ $(conda list | grep openeye-toolkits) ]]; then | |
micromamba remove --force openeye-toolkits --yes | |
fi | |
python -c "from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE; assert not OPENEYE_AVAILABLE, 'OpenEye unexpectedly found'" | |
fi | |
- name: Check that correct OFFTK version was installed | |
run: | | |
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-toolkit.git | cut -f2 | grep -E "([0-9]+)\.([0-9]+)\.([0-9]+)$" | sort --version-sort | tail -1 | sed 's/refs\/tags\///') | |
export FOUND_VER=$(python -c "import openff.toolkit; print(openff.toolkit.__version__)") | |
echo "Latest tag is" | |
echo $LATEST_TAG | |
echo "Found version is" | |
echo $FOUND_VER | |
if [[ $LATEST_TAG != $FOUND_VER ]]; | |
then echo "Version mismatch" | |
# exit 1 | |
fi | |
- name: Test the package | |
run: | | |
# Act like we're testing with this patch deployed ... | |
python -m pip install . utilities/test_plugins/ | |
if [[ "$OPENEYE" == true ]]; then | |
python -c "import openff.toolkit; print(openff.toolkit.__file__)" | |
python -c "import openeye; print(openeye.oechem.OEChemIsLicensed())" | |
fi | |
PYTEST_ARGS+=" --ignore-glob='*_links.py'" | |
PYTEST_ARGS+=" --ignore-glob='*_examples.py'" | |
PYTEST_ARGS+=" --ignore-glob='*_nagl.py'" | |
env | |
python -m pytest $PYTEST_ARGS \ | |
--pyargs "openff.toolkit" \ | |
-m "slow or not slow" -x | |
- name: Run example notebooks | |
run: | | |
# External examples are temporarily skipped due to parmed incompatibility https://github.com/openforcefield/openff-toolkit/issues/1532 | |
python -m pytest -r fE -v -x --tb=short --nbval-lax --ignore=examples/deprecated --ignore=examples/external examples |