Don't run tox tests on RHEL by default, as tox is unwanted in RHEL

See https://github.com/fedora-eln/eln/issues/126
This commit is contained in:
Miro Hrončok 2023-05-23 11:04:33 +02:00 committed by Maxwell G
parent 193a077e5b
commit b05b7f600b
No known key found for this signature in database
GPG Key ID: F79E4E25E8C661F8

View File

@ -3,8 +3,9 @@ Summary: RPM macros for PEP 517 Python packages
License: MIT License: MIT
%bcond tests 1 %bcond tests 1
# pytest-xdist is not available in RHEL # pytest-xdist and tox are not desired in RHEL
%bcond pytest_xdist %{undefined rhel} %bcond pytest_xdist %{undefined rhel}
%bcond tox_tests %{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:
@ -56,7 +57,9 @@ BuildRequires: python3dist(pyyaml)
BuildRequires: python3dist(packaging) BuildRequires: python3dist(packaging)
BuildRequires: python3dist(pip) BuildRequires: python3dist(pip)
BuildRequires: python3dist(setuptools) BuildRequires: python3dist(setuptools)
%if %{with tox_tests}
BuildRequires: python3dist(tox-current-env) >= 0.0.6 BuildRequires: python3dist(tox-current-env) >= 0.0.6
%endif
BuildRequires: python3dist(wheel) BuildRequires: python3dist(wheel)
BuildRequires: (python3dist(toml) if python3-devel < 3.11) BuildRequires: (python3dist(toml) if python3-devel < 3.11)
%endif %endif
@ -132,7 +135,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 %{?with_pytest_xdist:-n auto} %pytest -vv --doctest-modules %{?with_pytest_xdist:-n auto} %{!?with_tox_tests:-k "not tox"}
# 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