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.
This commit is contained in:
parent
7a72517736
commit
368763e1d8
@ -1,16 +1,10 @@
|
|||||||
%global srcname setuptools
|
%global srcname setuptools
|
||||||
|
|
||||||
# The original RHEL 9 content set is defined by (build)dependencies
|
# The original RHEL N+1 content set is defined by (build)dependencies
|
||||||
# of the packages in Fedora ELN. Hence we disable tests here
|
# of the packages in Fedora ELN. Hence we disable tests and documentation here
|
||||||
# to prevent pulling many unwanted packages in.
|
# 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.
|
# We intentionally keep this enabled on EPEL.
|
||||||
%if 0%{?rhel} >= 9 && !0%{?epel}
|
%bcond tests %[%{defined fedora} || %{defined epel}]
|
||||||
%bcond_with tests
|
|
||||||
%else
|
|
||||||
%bcond_without tests
|
|
||||||
%endif
|
|
||||||
|
|
||||||
# WARNING When bootstrapping, disable tests as well,
|
# WARNING When bootstrapping, disable tests as well,
|
||||||
# because tests need pip.
|
# because tests need pip.
|
||||||
@ -176,20 +170,26 @@ install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_w
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%if %{with tests}
|
|
||||||
%check
|
%check
|
||||||
# Verify bundled provides are up to date
|
# Verify bundled provides are up to date
|
||||||
cat pkg_resources/_vendor/vendored.txt setuptools/_vendor/vendored.txt > allvendor.txt
|
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}'
|
%{_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
|
# Regression test, the wheel should not be larger than 900 kB
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1914481#c3
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1914481#c3
|
||||||
test $(stat --format %%s %{_pyproject_wheeldir}/%{python_wheel_name}) -lt 900000
|
test $(stat --format %%s %{_pyproject_wheeldir}/%{python_wheel_name}) -lt 900000
|
||||||
|
%endif
|
||||||
|
|
||||||
# Regression test, the tests are not supposed to be installed
|
# Regression test, the tests are not supposed to be installed
|
||||||
test ! -d %{buildroot}%{python3_sitelib}/pkg_resources/tests
|
test ! -d %{buildroot}%{python3_sitelib}/pkg_resources/tests
|
||||||
test ! -d %{buildroot}%{python3_sitelib}/setuptools/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
|
# https://github.com/pypa/setuptools/discussions/2607
|
||||||
rm pyproject.toml
|
rm pyproject.toml
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user