Skip to content

Commit b84944f

Browse files
committed
add mpi4py in tests.
1 parent 54b088b commit b84944f

4 files changed

Lines changed: 28 additions & 21 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,30 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
20+
mpi: ['mpich']
2021

2122
steps:
22-
- uses: actions/checkout@v3
23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v3
25-
with:
26-
python-version: ${{ matrix.python-version }}
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
python -m pip install flake8 pytest
31-
python -m pip install .[test]
32-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
33-
- name: Lint with flake8
34-
run: |
35-
# stop the build if there are Python syntax errors or undefined names
36-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
37-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
38-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
39-
- name: Test with pytest
40-
run: |
41-
pytest
23+
- uses: actions/checkout@v3
24+
- name: Setup MPI
25+
uses: mpi4py/setup-mpi@v1
26+
with:
27+
mpi: ${{ matrix.mpi }}
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v3
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
python -m pip install flake8 pytest
36+
python -m pip install ".[test, mpi]"
37+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
38+
- name: Lint with flake8
39+
run: |
40+
# stop the build if there are Python syntax errors or undefined names
41+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
42+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
43+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
44+
- name: Test with pytest
45+
run: |
46+
pytest

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def get_version():
150150
# Similar to `install_requires` above, these must be valid existing
151151
# projects.
152152
extras_require={ # Optional
153+
"mpi": ["mpi4py",],
153154
"docs": ["sphinx-rtd-theme==1.1.1",
154155
"sphinx>=5.0.0",
155156
"myst-parser",

src/icoco/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class MEDCouplingField: # pylint: disable=too-few-public-methods
2626
"""dummy class for MEDCouplingField type hinting"""
2727

2828

29-
try: # pragma: no cover
29+
try:
3030
import mpi4py
3131
mpi4py.rc.initialize = False
3232
mpi4py.rc.finalize = False

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ deps =
1212
pytest-coverage
1313
pylint
1414
flake8
15+
mpi4py
1516
extras =
1617
test
1718
commands =

0 commit comments

Comments
 (0)