diff --git a/.github/workflows/black.yaml b/.github/workflows/black.yaml index 5e8b698d6..bc42c84ad 100644 --- a/.github/workflows/black.yaml +++ b/.github/workflows/black.yaml @@ -5,7 +5,7 @@ on: [push, pull_request] # use workaround due to: https://github.com/psf/black/issues/2079#issuecomment-812359146 jobs: check-formatting: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - name: Set up Python 3.11 diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index b3cd8de03..006512ded 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml index 15c0b2364..b020e6dbf 100644 --- a/.github/workflows/unittests.yaml +++ b/.github/workflows/unittests.yaml @@ -11,10 +11,10 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: - python: [3.7, 3.8, 3.9, '3.10', '3.11'] + python: [3.9, '3.10', '3.11'] steps: - uses: actions/checkout@v2 @@ -26,10 +26,9 @@ jobs: run: sudo apt-get update - name: Install mpi libs run: sudo apt-get -y install libopenmpi-dev - - name: Run Tests and Coverage + - name: Run Tests run: | pip install -e .[memprof,mpi,test] pytest -n 4 armi - mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --cov-report=lcov --cov-append --ignore=venv armi/tests/test_mpiFeatures.py || true - mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --cov-report=lcov --cov-append --ignore=venv armi/tests/test_mpiParameters.py || true - coverage combine --rcfile=pyproject.toml --keep -a + mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --ignore=venv armi/tests/test_mpiFeatures.py || true + mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --ignore=venv armi/tests/test_mpiParameters.py || true diff --git a/.github/workflows/unittests_old.yaml b/.github/workflows/unittests_old.yaml new file mode 100644 index 000000000..f4389d6a2 --- /dev/null +++ b/.github/workflows/unittests_old.yaml @@ -0,0 +1,34 @@ +name: unit tests - older Pythons + +on: + push: + paths-ignore: + - 'doc/**' + pull_request: + paths-ignore: + - 'doc/**' + +jobs: + build: + + runs-on: ubuntu-22.04 + strategy: + matrix: + python: [3.7, 3.8] + + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Update package index + run: sudo apt-get update + - name: Install mpi libs + run: sudo apt-get -y install libopenmpi-dev + - name: Run Tests + run: | + pip install -e .[memprof,mpi,test] + pytest -n 4 armi + mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --ignore=venv armi/tests/test_mpiFeatures.py || true + mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --ignore=venv armi/tests/test_mpiParameters.py || true diff --git a/armi/bookkeeping/db/tests/test_database3.py b/armi/bookkeeping/db/tests/test_database3.py index d7c4eca7d..f39e3015b 100644 --- a/armi/bookkeeping/db/tests/test_database3.py +++ b/armi/bookkeeping/db/tests/test_database3.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. """Tests for the Database3 class.""" -from distutils.spawn import find_executable +import shutil import subprocess import unittest @@ -31,9 +31,9 @@ # determine if this is a parallel run, and git is installed GIT_EXE = None -if find_executable("git") is not None: +if shutil.which("git") is not None: GIT_EXE = "git" -elif find_executable("git.exe") is not None: +elif shutil.which("git.exe") is not None: GIT_EXE = "git.exe" diff --git a/armi/tests/test_mpiFeatures.py b/armi/tests/test_mpiFeatures.py index abf16fa10..9a1c209c0 100644 --- a/armi/tests/test_mpiFeatures.py +++ b/armi/tests/test_mpiFeatures.py @@ -24,9 +24,9 @@ or mpiexec.exe -n 2 python -m pytest armi/tests/test_mpiFeatures.py """ -from distutils.spawn import find_executable from unittest.mock import patch import os +import shutil import unittest from armi import context @@ -47,9 +47,9 @@ # determine if this is a parallel run, and MPI is installed MPI_EXE = None -if find_executable("mpiexec.exe") is not None: +if shutil.which("mpiexec.exe") is not None: MPI_EXE = "mpiexec.exe" -elif find_executable("mpiexec") is not None: +elif shutil.which("mpiexec") is not None: MPI_EXE = "mpiexec" MPI_COMM = context.MPI_COMM diff --git a/armi/tests/test_mpiParameters.py b/armi/tests/test_mpiParameters.py index a5a6bd5e9..4754a7690 100644 --- a/armi/tests/test_mpiParameters.py +++ b/armi/tests/test_mpiParameters.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. """Tests of the MPI portion of the Parameters class.""" -from distutils.spawn import find_executable +import shutil import unittest from armi import context @@ -21,9 +21,9 @@ # determine if this is a parallel run, and MPI is installed MPI_EXE = None -if find_executable("mpiexec.exe") is not None: +if shutil.which("mpiexec.exe") is not None: MPI_EXE = "mpiexec.exe" -elif find_executable("mpiexec") is not None: +elif shutil.which("mpiexec") is not None: MPI_EXE = "mpiexec"