From 368763e1d8e59f42c5bd0769f3a391be5e831abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 10 Feb 2023 17:43:21 +0100 Subject: [PATCH] Update the RHEL %bconds comment and style, run basic checks even --without tests It is obvious to me now that this is not going to be removed, but will be reused for RHEL 10, 11, etc. The new %bcond syntax is nicer. Some checks can run even --without tests, do it. --- python-setuptools.spec | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/python-setuptools.spec b/python-setuptools.spec index e047d4d..6fc726a 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -1,16 +1,10 @@ %global srcname setuptools -# The original RHEL 9 content set is defined by (build)dependencies -# of the packages in Fedora ELN. Hence we disable tests here +# The original RHEL N+1 content set is defined by (build)dependencies +# of the packages in Fedora ELN. Hence we disable tests and documentation here # to prevent pulling many unwanted packages in. -# Once the RHEL 9 content set is defined and/or RHEL 9 forks from ELN, -# the conditional can be removed from the Fedora spec file. # We intentionally keep this enabled on EPEL. -%if 0%{?rhel} >= 9 && !0%{?epel} -%bcond_with tests -%else -%bcond_without tests -%endif +%bcond tests %[%{defined fedora} || %{defined epel}] # WARNING When bootstrapping, disable tests as well, # because tests need pip. @@ -176,20 +170,26 @@ install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_w %endif -%if %{with tests} %check # Verify bundled provides are up to date cat pkg_resources/_vendor/vendored.txt setuptools/_vendor/vendored.txt > allvendor.txt %{_rpmconfigdir}/pythonbundles.py allvendor.txt --namespace 'python%{python3_pkgversion}dist' --compare-with '%{bundled}' +%if %{without bootstrap} # Regression test, the wheel should not be larger than 900 kB # https://bugzilla.redhat.com/show_bug.cgi?id=1914481#c3 test $(stat --format %%s %{_pyproject_wheeldir}/%{python_wheel_name}) -lt 900000 +%endif # Regression test, the tests are not supposed to be installed test ! -d %{buildroot}%{python3_sitelib}/pkg_resources/tests test ! -d %{buildroot}%{python3_sitelib}/setuptools/tests +%if %{without bootstrap} +%pyproject_check_import +%endif + +%if %{with tests} # https://github.com/pypa/setuptools/discussions/2607 rm pyproject.toml