From 264dae5a4c99c5ab99be360e1f136d3eec288db3 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Tue, 14 Nov 2023 14:11:32 +0100 Subject: [PATCH] Fix building on Fedora 37 and EPEL 9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These OS releases come with a Poetry version older than 1.2 and don’t cope with group sections in pyproject.toml. [skip changelog] Signed-off-by: Nils Philippsen --- python-rpmautospec.spec | 14 +++++++++++++- rpmautospec-0.3.7-old-poetry.patch | 12 ++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 rpmautospec-0.3.7-old-poetry.patch diff --git a/python-rpmautospec.spec b/python-rpmautospec.spec index db6a230..e3e199b 100644 --- a/python-rpmautospec.spec +++ b/python-rpmautospec.spec @@ -8,6 +8,13 @@ %bcond rpmmacropkg 0 %endif +# Appease old Poetry versions (<1.2.0a2) +%if ! 0%{?fedora}%{?rhel} || 0%{?fedora} >= 38 || 0%{?rhel} >= 10 +%bcond oldpoetry 0 +%else +%bcond oldpoetry 1 +%endif + %global srcname rpmautospec %global canonicalname %{py_dist_name %{srcname}} @@ -18,6 +25,7 @@ Summary: Package and CLI tool to generate release fields and changelogs License: MIT URL: https://github.com/fedora-infra/%{canonicalname} Source0: https://github.com/fedora-infra/%{canonicalname}/releases/download/%{version}/%{canonicalname}-%{version}.tar.gz +Patch100: rpmautospec-0.3.7-old-poetry.patch BuildArch: noarch BuildRequires: git @@ -80,7 +88,11 @@ enabled packages locally. %pyproject_buildrequires %prep -%autosetup -n %{srcname}-%{version} +%autosetup -n %{srcname}-%{version} -N +%autopatch -M 99 +%if %{with oldpoetry} +%autopatch 100 +%endif %build %pyproject_wheel diff --git a/rpmautospec-0.3.7-old-poetry.patch b/rpmautospec-0.3.7-old-poetry.patch new file mode 100644 index 0000000..0fb7034 --- /dev/null +++ b/rpmautospec-0.3.7-old-poetry.patch @@ -0,0 +1,12 @@ +diff -up rpmautospec-0.3.7/pyproject.toml.old-poetry rpmautospec-0.3.7/pyproject.toml +--- rpmautospec-0.3.7/pyproject.toml.old-poetry 2023-11-14 13:33:59.369684500 +0100 ++++ rpmautospec-0.3.7/pyproject.toml 2023-11-14 13:57:31.085972996 +0100 +@@ -47,7 +47,7 @@ babel = "^2.9" + koji = "^1.33.0" + pygit2 = "^1.2.1" + +-[tool.poetry.group.dev.dependencies] ++[tool.poetry.dev-dependencies] + pyyaml = "^5.3.1 || ^6" + pytest = "^6.2.2 || ^7" + pytest-cov = "^4.0.0"