From 46e4eb4bcdd23f47c5a1fa8a4581304f52b6b04b Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Jun 17 2021 11:08:36 +0000 Subject: CI tests: Make python-pytest.spec build with Python 3.10+ Preserve compatibility with Fedora 33. --- diff --git a/tests/python-pytest.spec b/tests/python-pytest.spec index c43bd2a..e9a3146 100644 --- a/tests/python-pytest.spec +++ b/tests/python-pytest.spec @@ -1,12 +1,28 @@ %global pypi_name pytest Name: python-%{pypi_name} + +# For testing purposes, we package different versions on different Fedoras, +# because otherwise we would miss some dependencies (pytest 6.2 needs tox 3.20+) +# Please, don't write spec files like this in Fedora, it is forbidden. +%if 0%{?fedora} > 33 || 0%{?rhel} > 9 +Version: 6.2.4 +%else Version: 4.4.2 +%endif + Release: 0%{?dist} Summary: Simple powerful testing with Python License: MIT URL: https://pytest.org Source0: %{pypi_source} +%if v"%{version}" >= v"6.2" +# Fix Python 3.10 test issues +# Merged upstream, https://github.com/pytest-dev/pytest/pull/8555 +# Rebased slightly +Patch2: https://src.fedoraproject.org/rpms/pytest/raw/a368ab2b2249b5d03a145f1d8b70e5636fc6eca8/f/8555.patch +%endif + BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros @@ -29,6 +45,11 @@ Summary: %{summary} %prep %autosetup -p1 -n %{pypi_name}-%{version} +# Remove duplicate '>=' in setup.cfg +# https://github.com/pytest-dev/pytest/pull/8336 +# https://github.com/pytest-dev/pytest/pull/8774 +sed -i 's/>=>=/>=/' setup.cfg + %generate_buildrequires %pyproject_buildrequires -x testing -t