From 63bd3979bf39c8268d6690819112fcb4d2e29c82 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Nov 01 2020 21:35:18 +0000 Subject: Initial commit --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..add5338 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/pytest-mpi-0.4.tar.gz diff --git a/12.patch b/12.patch new file mode 100644 index 0000000..8bf09ec --- /dev/null +++ b/12.patch @@ -0,0 +1,66 @@ +From 3c9305cdad917793155465b1e4570e9a4ed40aae Mon Sep 17 00:00:00 2001 +From: James Tocknell +Date: Fri, 2 Oct 2020 17:28:40 +1000 +Subject: [PATCH] Fix tests failing due to pytest changes + +--- + tests/test_fixtures.py | 6 +++--- + tests/test_markers.py | 8 ++++---- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/tests/test_fixtures.py b/tests/test_fixtures.py +index 92819e4..041f8a7 100644 +--- a/tests/test_fixtures.py ++++ b/tests/test_fixtures.py +@@ -56,7 +56,7 @@ def test_mpi_file_name(mpi_testdir, has_mpi4py): + if has_mpi4py: + result.assert_outcomes(passed=1) + else: +- result.assert_outcomes(error=1) ++ result.assert_outcomes(errors=1) + + + def test_mpi_tmpdir(mpi_testdir, has_mpi4py): +@@ -67,7 +67,7 @@ def test_mpi_tmpdir(mpi_testdir, has_mpi4py): + if has_mpi4py: + result.assert_outcomes(passed=1) + else: +- result.assert_outcomes(error=1) ++ result.assert_outcomes(errors=1) + + + def test_mpi_tmp_path(mpi_testdir, has_mpi4py): +@@ -78,4 +78,4 @@ def test_mpi_tmp_path(mpi_testdir, has_mpi4py): + if has_mpi4py: + result.assert_outcomes(passed=1) + else: +- result.assert_outcomes(error=1) ++ result.assert_outcomes(errors=1) +diff --git a/tests/test_markers.py b/tests/test_markers.py +index d0fd94e..c005bce 100644 +--- a/tests/test_markers.py ++++ b/tests/test_markers.py +@@ -67,9 +67,9 @@ def test_mpi_with_mpi(mpi_testdir, has_mpi4py): + result = mpi_testdir.runpytest("--with-mpi") + + if has_mpi4py: +- result.assert_outcomes(passed=3, error=1, skipped=1) ++ result.assert_outcomes(passed=3, errors=1, skipped=1) + else: +- result.assert_outcomes(passed=1, error=4) ++ result.assert_outcomes(passed=1, errors=4) + + + def test_mpi_only_mpi(mpi_testdir, has_mpi4py): +@@ -78,9 +78,9 @@ def test_mpi_only_mpi(mpi_testdir, has_mpi4py): + result = mpi_testdir.runpytest("--only-mpi") + + if has_mpi4py: +- result.assert_outcomes(passed=2, error=1, skipped=2) ++ result.assert_outcomes(passed=2, errors=1, skipped=2) + else: +- result.assert_outcomes(error=4, skipped=1) ++ result.assert_outcomes(errors=4, skipped=1) + + + def test_mpi_skip(testdir): diff --git a/python-pytest-mpi.spec b/python-pytest-mpi.spec new file mode 100644 index 0000000..a9857c4 --- /dev/null +++ b/python-pytest-mpi.spec @@ -0,0 +1,75 @@ +%?python_enable_dependency_generator +%global srcname pytest-mpi + +Name: python-%{srcname} +Version: 0.4 +Release: 2%{?dist} +Summary: Pytest plugin for running tests under MPI + +License: BSD +URL: https://github.com/aragilar/pytest-mpi +Source0: https://github.com/aragilar/%{srcname}/archive/v%{version}/%{srcname}-%{version}.tar.gz + +# Fix build with newer pytest +Patch0: https://patch-diff.githubusercontent.com/raw/aragilar/pytest-mpi/pull/12.patch + +BuildArch: noarch + +%description +pytest_mpi is a plugin for pytest providing some useful tools when running +tests under MPI, and testing MPI-related code. + + +%package -n python%{python3_pkgversion}-%{srcname} +Summary: Pytest plugin for running tests under MPI +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-pytest +BuildRequires: python%{python3_pkgversion}-sybil +BuildRequires: mpich-devel +BuildRequires: python%{python3_pkgversion}-mpi4py-mpich +BuildRequires: openmpi-devel +BuildRequires: python%{python3_pkgversion}-mpi4py-openmpi + +%description -n python%{python3_pkgversion}-%{srcname} +pytest_mpi is a plugin for pytest providing some useful tools when running +tests under MPI, and testing MPI-related code. + + +%prep +%autosetup -p1 -n %{srcname}-%{version} + + +%build +%py3_build + + +%install +%py3_install + + +%check +%_mpich_load +export PYTHONPATH=%{buildroot}%{python3_sitelib}:$MPI_PYTHON3_SITEARCH +py.test-%{python3_version} -p pytester --runpytest=subprocess -vv +%_mpich_unload +%_openmpi_load +export PYTHONPATH=%{buildroot}%{python3_sitelib}:$MPI_PYTHON3_SITEARCH +py.test-%{python3_version} -p pytester --runpytest=subprocess -vv +%_openmpi_unload + + +%files -n python%{python3_pkgversion}-%{srcname} +%license LICENSE.txt +%doc README.md +%{python3_sitelib}/pytest_mpi/ +%{python3_sitelib}/pytest_mpi-*.egg-info/ + + +%changelog +* Sun Nov 1 2020 Orion Poplawski - 0.4-2 +- Change URL +- Fix permissions + +* Sun Oct 11 2020 Orion Poplawski - 0.4-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..6681e0a --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (pytest-mpi-0.4.tar.gz) = 3b9690c135f4da992c806ba340845841d86479ce71403405391b9c8461dd94a6648efd92f97a730228f24d637fb2c5aa5c302260c70d5eb2087bb355d48ff09f