From dae72405972bc91822f1531ede348bca8d0f05bb Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Mon, 5 Feb 2024 11:16:29 -0600 Subject: [PATCH] Allow pytest 8 --- .github/workflows/CI.yml | 1 - .github/workflows/conda.yml | 14 +++++--------- .github/workflows/examples.yml | 22 ++++++---------------- devtools/conda-envs/conda.yaml | 4 +++- devtools/conda-envs/conda_oe.yaml | 4 +++- 5 files changed, 17 insertions(+), 28 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 108edf8ed..ecd15809d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,7 +41,6 @@ jobs: env: OE_LICENSE: ${{ github.workspace }}/oe_license.txt - PACKAGE: openff PYTEST_ARGS: -r fE --tb=short -nauto COV: --cov=openff/toolkit --cov-config=setup.cfg --cov-append --cov-report=xml diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 4e0d33b1d..23b22072a 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -25,11 +25,9 @@ jobs: openeye: ["true", "false"] env: - CI_OS: ${{ matrix.os }} OPENEYE: ${{ matrix.openeye }} - PYVER: ${{ matrix.python-version }} OE_LICENSE: ${{ github.workspace }}/oe_license.txt - PACKAGE: openff-toolkit + PYTEST_ARGS: -r fE --tb=short -nauto steps: - uses: actions/checkout@v4 @@ -106,16 +104,14 @@ jobs: - name: Test the package run: | - python -m pip install utilities/test_plugins - - pwd - ls + 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=" -r fE --tb=short --runslow openff/toolkit/_tests/conftest.py" + PYTEST_ARGS+=" --runslow" PYTEST_ARGS+=" --ignore=openff/toolkit/_tests/test_links.py" - pytest $PYTEST_ARGS openff + + python -m pytest $PYTEST_ARGS $COV diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index d03bc2ec2..9d2b6223f 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -66,24 +66,13 @@ jobs: create-args: >- python=${{ matrix.python-version }} - - name: Additional info about the build - run: | - uname -a - df -h - ulimit -a - - name: Make oe_license.txt file from GH org secret "OE_LICENSE" env: OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }} - run: | - echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE} + run: echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE} - name: Install package - run: | - # Maybe remove the packaged openff-toolkit, installed as a dependency of openmmforcefields - # and/or Interchange - micromamba remove --force openff-toolkit-base - python -m pip install . + run: python -m pip install . - name: Remove undesired toolkits run: | @@ -92,7 +81,7 @@ jobs: # so don't remove it. if [ ! -z "${{ env.PACKAGES_TO_REMOVE }}" ]; then for cpkg in ${{ env.PACKAGES_TO_REMOVE }}; do - if [[ $(conda list | grep $cpkg) ]]; then micromamba remove --force $cpkg --yes ; fi + if [[ $(micromamba list | grep $cpkg) ]]; then micromamba remove --force $cpkg --yes ; fi done fi @@ -119,10 +108,11 @@ jobs: python -c "from openff.toolkit.utils.toolkits import ${TK}_AVAILABLE; assert not ${TK}_AVAILABLE, '${TK} available'" done fi + - name: Environment Information run: | - conda info - conda list + micromamba info + micromamba list - name: Run example scripts run: | diff --git a/devtools/conda-envs/conda.yaml b/devtools/conda-envs/conda.yaml index ec34886aa..4ac8f1e5c 100644 --- a/devtools/conda-envs/conda.yaml +++ b/devtools/conda-envs/conda.yaml @@ -5,5 +5,7 @@ dependencies: # Base depends - openff-toolkit-examples # Tests - - pytest=7.4 + - pytest + - pytest-xdist + - pytest-randomly - pytest-rerunfailures diff --git a/devtools/conda-envs/conda_oe.yaml b/devtools/conda-envs/conda_oe.yaml index d379d4cb2..375ada423 100644 --- a/devtools/conda-envs/conda_oe.yaml +++ b/devtools/conda-envs/conda_oe.yaml @@ -7,5 +7,7 @@ dependencies: - openff-toolkit-examples # Tests - openeye-toolkits - - pytest=7.4 + - pytest + - pytest-xdist + - pytest-randomly - pytest-rerunfailures