From d2d1e5602a290a9a1a3de349301ca659a11cdfd1 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Feb 10 2023 17:24:33 +0000 Subject: Don't build tests and docs on RHEL to reduce deps Signed-off-by: Stephen Gallagher --- diff --git a/pytest.spec b/pytest.spec index 7222a33..39b6f0e 100644 --- a/pytest.spec +++ b/pytest.spec @@ -2,7 +2,7 @@ Name: pytest %global base_version 7.2.1 #global prerelease ... Version: %{base_version}%{?prerelease:~%{prerelease}} -Release: 1%{?dist} +Release: 2%{?dist} Summary: Simple powerful testing with Python License: MIT URL: https://pytest.org @@ -18,8 +18,10 @@ Patch: pytest-7.1.3-fix-xfails.patch # When building pytest for the first time with new Python version # we might not yet have all the BRs, those conditionals allow us to do that. -# This can be used to disable all tests for faster bootstrapping -%bcond_without tests +# This can be used to disable all tests for faster bootstrapping. +# The tests are enabled by default except when building on RHEL/ELN +# (to avoid pulling in extra dependencies into next RHEL). +%bcond tests %{undefined rhel} # Only disabling the optional tests is a more complex but careful approach # Pytest will skip the related tests, so we only conditionalize the BRs @@ -34,7 +36,9 @@ Patch: pytest-7.1.3-fix-xfails.patch # When building pytest for the first time with new Python version # we also don't have sphinx yet and cannot build docs. -%bcond_without docs +# The docs are enabled by default except when building on RHEL/ELN +# (to avoid pulling in extra dependencies into next RHEL). +%bcond docs %{undefined rhel} BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros >= 0-51 @@ -151,11 +155,13 @@ find %{buildroot}%{python3_sitelib} \ -exec sed -i -e '1{/^#!/d}' {} \; -%if %{with tests} %check +%if %{with tests} %global __pytest %{buildroot}%{_bindir}/pytest # optional_tests deps contain pytest-xdist, so we can use it to run tests faster %pytest testing %{?with_timeout:--timeout=30} %{?with_optional_tests:-n auto} -rs +%else +%pyproject_check_import %endif @@ -175,6 +181,9 @@ find %{buildroot}%{python3_sitelib} \ %changelog +* Fri Feb 10 2023 Stephen Gallagher - 7.2.1-2 +- Don't build tests and docs on RHEL to reduce dependencies + * Fri Jan 27 2023 Miro HronĨok - 7.2.1-1 - Update to 7.2.1 - Fixes: rhbz#2160925