don't use pytest-xdist in RHEL

Relates: https://github.com/fedora-eln/eln/issues/125
This commit is contained in:
Maxwell G 2023-05-19 20:01:17 +00:00
parent 17dab005cc
commit aaac9203b9
No known key found for this signature in database
GPG Key ID: F79E4E25E8C661F8

View File

@ -2,7 +2,9 @@ Name: pyproject-rpm-macros
Summary: RPM macros for PEP 517 Python packages Summary: RPM macros for PEP 517 Python packages
License: MIT License: MIT
%bcond_without 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 # The idea is to follow the spirit of semver
# Given version X.Y.Z: # Given version X.Y.Z:
@ -47,7 +49,9 @@ BuildArch: noarch
%if %{with tests} %if %{with tests}
BuildRequires: python3dist(pytest) BuildRequires: python3dist(pytest)
%if %{with pytest_xdist}
BuildRequires: python3dist(pytest-xdist) BuildRequires: python3dist(pytest-xdist)
%endif
BuildRequires: python3dist(pyyaml) BuildRequires: python3dist(pyyaml)
BuildRequires: python3dist(packaging) BuildRequires: python3dist(packaging)
BuildRequires: python3dist(pip) BuildRequires: python3dist(pip)
@ -128,7 +132,7 @@ test "$signature1" != ""
%if %{with tests} %if %{with tests}
export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856356 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 # brp-compress is provided as an argument to get the right directory macro expansion
%{python3} compare_mandata.py -f %{_rpmconfigdir}/brp-compress %{python3} compare_mandata.py -f %{_rpmconfigdir}/brp-compress