From 8378b5a6774d6107413eae4fa99d0ab4c0ce24ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Mon, 13 Feb 2023 13:51:22 +0100 Subject: [PATCH] Fix bootstrap mode for packaging 22.0+ Necessary changes in spec file so packaging builds with new flit_core backend. --- python-packaging.spec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python-packaging.spec b/python-packaging.spec index be4d504..27f872a 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -31,9 +31,10 @@ BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: pyproject-rpm-macros +BuildRequires: unzip %if %{with bootstrap} -BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-flit-core %endif # Upstream uses nox for testing, we specify the test deps manually as well. @@ -89,7 +90,7 @@ sed -i '/html_theme = "furo"/d' docs/conf.py %build %if %{with bootstrap} -%py3_build +%{python3} -m flit_core.wheel %else %pyproject_wheel %endif @@ -106,7 +107,8 @@ rm -rf html/_static/fonts/ %install %if %{with bootstrap} -%py3_install +mkdir -p %{buildroot}%{python3_sitelib} +unzip dist/packaging-%{version}-py3-none-any.whl -d %{buildroot}%{python3_sitelib} -x packaging-%{version}.dist-info/RECORD echo '%{python3_sitelib}/packaging*' > %{pyproject_files} %else %pyproject_install @@ -115,7 +117,7 @@ echo '%{python3_sitelib}/packaging*' > %{pyproject_files} %check -%pyproject_check_import +%{!?with_bootstrap:%pyproject_check_import} %if %{with tests} %pytest %endif