From fb1cb520d982402c14ebc376468f489defe85395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 23 May 2023 11:04:33 +0200 Subject: [PATCH] Don't run tox tests on RHEL by default, as tox is unwanted in RHEL See https://github.com/fedora-eln/eln/issues/126 Related: rhbz#2208971 --- pyproject-rpm-macros.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index d2b27c2..d6bd876 100644 --- a/pyproject-rpm-macros.spec +++ b/pyproject-rpm-macros.spec @@ -3,8 +3,9 @@ Summary: RPM macros for PEP 517 Python packages License: MIT %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 tox_tests %{undefined rhel} # The idea is to follow the spirit of semver # Given version X.Y.Z: @@ -56,7 +57,9 @@ BuildRequires: python3dist(pyyaml) BuildRequires: python3dist(packaging) BuildRequires: python3dist(pip) BuildRequires: python3dist(setuptools) +%if %{with tox_tests} BuildRequires: python3dist(tox-current-env) >= 0.0.6 +%endif BuildRequires: python3dist(wheel) BuildRequires: (python3dist(toml) if python3-devel < 3.11) %endif @@ -132,7 +135,7 @@ test "$signature1" != "" %if %{with tests} 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 %{python3} compare_mandata.py -f %{_rpmconfigdir}/brp-compress