From 4d658edf0b341d2882f5fbe896abaeb7ecbe5dae Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Thu, 29 Jun 2023 17:09:56 -0500 Subject: [PATCH] Add build and installtime requirements on tomli when building for Python < 3.11 Signed-off-by: Michel Alexandre Salim --- python-flit-core.spec | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/python-flit-core.spec b/python-flit-core.spec index 884e209..07f7bb0 100644 --- a/python-flit-core.spec +++ b/python-flit-core.spec @@ -9,7 +9,7 @@ Name: python-flit-core Version: 3.9.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: PEP 517 build backend for packages using Flit # flit-core is BSD-3-Clause @@ -53,10 +53,17 @@ Requires: python(abi) = %{python3_version} %prep %autosetup -p1 -n flit_core-%{version} +%if %{without bootstrap} || 0%{?python3_version_nodots} >= 311 +# Add tomli to build-system.requires and project.dependencies to account for +# our tomli unbundling. +# tomllib is a part of standard library since Python 3.11, so we only need this +# for python_version<'3.11'. +sed -i 's/^\(dependencies\|requires\) = \[\]/\1 = ["tomli; python_version<'\'3.11\''"]/' pyproject.toml + # Remove vendored tomli that flit_core includes to solve the circular dependency on older Pythons # (flit_core requires tomli, but flit_core is needed to build tomli). -# We don't use this, as tomllib is a part of standard library since Python 3.11. rm -rf flit_core/vendor +%endif %if %{without bootstrap} @@ -101,6 +108,9 @@ rm -r %{buildroot}%{python3_sitelib}/flit_core/tests/ %changelog +* Thu Jun 29 2023 Michel Alexandre Salim - 3.9.0-4 +- Add build and installtime requirements on tomli when building for Python < 3.11 + * Fri Jun 16 2023 Python Maint - 3.9.0-3 - Rebuilt for Python 3.12