From 5eeb94917bd7598afedf0bf1a77938d1f69da0e8 Mon Sep 17 00:00:00 2001 From: Nick Touran Date: Wed, 9 Aug 2023 08:32:43 -0700 Subject: [PATCH 1/2] Remove coveragepy-lcov dependency during CI. coveragepy-lcov is incompatible with coverage 7.0.0 and in fact is totally unnecessary now that pytest can write lcov format files directly. This switches pytest to write lcov directly. Now coverage should work in CI on python 3.11 Fixes #1377 --- .github/workflows/coverage.yaml | 10 +--------- .gitignore | 1 + tox.ini | 4 ++-- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index fd049661b..7e4cf59d4 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -31,17 +31,9 @@ jobs: run: tox -e cov1 || true - name: Run Coverage Part 2 run: tox -e cov2 - - name: Convert Coverage Results - env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - run: | - pip install click==8.1.3 - pip install coverage==6.5.0 - pip install coveragepy-lcov==0.1.2 - coveragepy-lcov --data_file_path coverage_results.cov --output_file_path lcov.txt - name: Publish to coveralls.io uses: coverallsapp/github-action@v1.1.2 with: github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: lcov.txt + path-to-lcov: coverage.lcov diff --git a/.gitignore b/.gitignore index 9b209fa96..83bb002f7 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ doc/gallery doc/gallery-src/framework/*.yaml .coverage coverage.xml +coverage.lcov coverage_results.* htmlcov/ monkeytype.* diff --git a/tox.ini b/tox.ini index 33eb32173..8795e5a92 100644 --- a/tox.ini +++ b/tox.ini @@ -39,7 +39,7 @@ deps= allowlist_externals = /usr/bin/mpiexec commands = - mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=.coveragerc -m pytest --cov=armi --cov-config=.coveragerc --ignore=venv --cov-fail-under=80 armi/tests/test_mpiFeatures.py + mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=.coveragerc -m pytest --cov=armi --cov-config=.coveragerc --cov-report=lcov --ignore=venv --cov-fail-under=80 armi/tests/test_mpiFeatures.py # Second, run code coverage over the rest of the unit tests, and combine the coverage results together [testenv:cov2] @@ -51,7 +51,7 @@ deps= allowlist_externals = /usr/bin/mpiexec commands = - coverage run --rcfile=.coveragerc -m pytest -n 4 --cov=armi --cov-config=.coveragerc --cov-append --ignore=venv armi + coverage run --rcfile=.coveragerc -m pytest -n 4 --cov=armi --cov-config=.coveragerc --cov-report=lcov --cov-append --ignore=venv armi coverage combine --rcfile=.coveragerc --keep -a # NOTE: This only runs the MPI unit tests. From fca30afa637418bd6d00a730f23d5cd93ae8b72c Mon Sep 17 00:00:00 2001 From: Nick Touran Date: Wed, 9 Aug 2023 13:27:18 -0700 Subject: [PATCH 2/2] Remove coverage pins and change coverage to py311. Requested in review. --- .github/workflows/coverage.yaml | 6 +----- setup.py | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 7e4cf59d4..0e85a6400 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -8,19 +8,16 @@ on: jobs: build: - runs-on: ubuntu-22.04 - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - steps: - uses: actions/checkout@v2 - name: Setup Python uses: actions/setup-python@v2 with: - python-version: '3.10' + python-version: '3.11' - name: Update package index run: sudo apt-get update - name: Install mpi libs @@ -36,4 +33,3 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: coverage.lcov - diff --git a/setup.py b/setup.py index f253cd84b..9b5468d70 100644 --- a/setup.py +++ b/setup.py @@ -56,8 +56,7 @@ def collectExtraFiles(): entry_points={"console_scripts": ["armi = armi.__main__:main"]}, install_requires=[ "configparser", - 'coverage; python_version>="3.11"', - 'coverage<=6.5.0; python_version<"3.11"', + "coverage", "future", "h5py>=3.0", "htmltree",