From d96b9f5808e5dc2ee263414e4e4e5cff6a82cc3d Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Wed, 22 Feb 2023 17:29:27 -0600 Subject: [PATCH] cargo2rpm: build for Python 3.11 on epel9 - Conditionally set %python3_pkgversion - Use pytest directly in place of tox. tox is not packaged for python3.11. --- cargo2rpm.spec | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cargo2rpm.spec b/cargo2rpm.spec index 8a7234c..1dcafd8 100644 --- a/cargo2rpm.spec +++ b/cargo2rpm.spec @@ -1,4 +1,7 @@ %bcond_without check +%if %{defined el9} +%global python3_pkgversion 3.11 +%endif Name: cargo2rpm Version: 0.1.2 @@ -11,7 +14,10 @@ Source: %{url}/archive/%{version}/cargo2rpm-%{version}.tar.gz BuildArch: noarch -BuildRequires: python3-devel +BuildRequires: python%{python3_pkgversion}-devel +%if %{with check} +BuildRequires: %{py3_dist pytest} +%endif Requires: cargo @@ -24,7 +30,7 @@ and a Python API (which rust2rpm is built upon). %autosetup -p1 %generate_buildrequires -%pyproject_buildrequires %{?with_check:-t} +%pyproject_buildrequires %build %pyproject_wheel @@ -36,7 +42,7 @@ and a Python API (which rust2rpm is built upon). %check %pyproject_check_import %if %{with check} -%tox +%pytest %endif %files -f %{pyproject_files}