don't use pytest-xdist in RHEL

Relates: https://github.com/fedora-eln/eln/issues/125

Related: rhbz#2208971
This commit is contained in:
Maxwell G 2023-05-19 20:01:17 +00:00 committed by Miro Hrončok
parent a7a8d6bda0
commit 0dd9e91f43

View File

@ -2,9 +2,9 @@ Name: pyproject-rpm-macros
Summary: RPM macros for PEP 517 Python packages
License: MIT
# Disable tests on RHEL9 as to not pull in the test dependencies
# Specify --with tests to run the tests e.g. on EPEL
%bcond_with tests
%bcond tests 1
# pytest-xdist is not available in RHEL
%bcond pytest_xdist %{undefined rhel}
# The idea is to follow the spirit of semver
# Given version X.Y.Z:
@ -49,7 +49,9 @@ BuildArch: noarch
%if %{with tests}
BuildRequires: python3dist(pytest)
%if %{with pytest_xdist}
BuildRequires: python3dist(pytest-xdist)
%endif
BuildRequires: python3dist(pyyaml)
BuildRequires: python3dist(packaging)
BuildRequires: python3dist(pip)
@ -130,7 +132,7 @@ test "$signature1" != ""
%if %{with tests}
export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856356
%pytest -vv --doctest-modules -n auto
%pytest -vv --doctest-modules %{?with_pytest_xdist:-n auto}
# brp-compress is provided as an argument to get the right directory macro expansion
%{python3} compare_mandata.py -f %{_rpmconfigdir}/brp-compress