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.
epel9
Maxwell G 2 years ago
parent 8d4ba2215a
commit d96b9f5808
No known key found for this signature in database
GPG Key ID: F79E4E25E8C661F8

@ -1,4 +1,7 @@
%bcond_without check %bcond_without check
%if %{defined el9}
%global python3_pkgversion 3.11
%endif
Name: cargo2rpm Name: cargo2rpm
Version: 0.1.2 Version: 0.1.2
@ -11,7 +14,10 @@ Source: %{url}/archive/%{version}/cargo2rpm-%{version}.tar.gz
BuildArch: noarch BuildArch: noarch
BuildRequires: python3-devel BuildRequires: python%{python3_pkgversion}-devel
%if %{with check}
BuildRequires: %{py3_dist pytest}
%endif
Requires: cargo Requires: cargo
@ -24,7 +30,7 @@ and a Python API (which rust2rpm is built upon).
%autosetup -p1 %autosetup -p1
%generate_buildrequires %generate_buildrequires
%pyproject_buildrequires %{?with_check:-t} %pyproject_buildrequires
%build %build
%pyproject_wheel %pyproject_wheel
@ -36,7 +42,7 @@ and a Python API (which rust2rpm is built upon).
%check %check
%pyproject_check_import %pyproject_check_import
%if %{with check} %if %{with check}
%tox %pytest
%endif %endif
%files -f %{pyproject_files} %files -f %{pyproject_files}

Loading…
Cancel
Save