Skip to content

Commit

Permalink
Cleaning up build tools (#1723)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science authored Jun 5, 2024
1 parent f06e2bf commit f9903fe
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/black.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
34 changes: 34 additions & 0 deletions .github/workflows/unittests_old.yaml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions armi/bookkeeping/db/tests/test_database3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"


Expand Down
6 changes: 3 additions & 3 deletions armi/tests/test_mpiFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions armi/tests/test_mpiParameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"


Expand Down

0 comments on commit f9903fe

Please sign in to comment.