Fix building on Fedora 37 and EPEL 9

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 <nils@redhat.com>
This commit is contained in:
Nils Philippsen 2023-11-14 14:11:32 +01:00
parent e2e8052efe
commit 264dae5a4c
2 changed files with 25 additions and 1 deletions

View File

@ -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

View File

@ -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"