- Add Iterable-collections.patch to avoid Python 3.10

incompatibility (gh#man-group/pytest-plugins#197).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-verbose-parametrize?expand=0&rev=7
This commit is contained in:
2022-01-10 16:12:45 +00:00
committed by Git OBS Bridge
parent c5b9b87a26
commit b1f97d0a17
3 changed files with 28 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
---
pytest_verbose_parametrize.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/pytest_verbose_parametrize.py
+++ b/pytest_verbose_parametrize.py
@@ -1,4 +1,7 @@
-from collections import Iterable
+try:
+ from collections.abc import Iterable
+except (ImportError, ModuleNotFoundError):
+ from collections import Iterable
from six import string_types, text_type

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jan 10 16:09:01 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Add Iterable-collections.patch to avoid Python 3.10
incompatibility (gh#man-group/pytest-plugins#197).
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Aug 22 09:05:47 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com> Thu Aug 22 09:05:47 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-pytest-verbose-parametrize # spec file for package python-pytest-verbose-parametrize
# #
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2022 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,10 @@ License: MIT
Group: Development/Languages/Python Group: Development/Languages/Python
URL: https://github.com/manahl/pytest-plugins URL: https://github.com/manahl/pytest-plugins
Source: https://files.pythonhosted.org/packages/source/p/pytest-verbose-parametrize/pytest-verbose-parametrize-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/p/pytest-verbose-parametrize/pytest-verbose-parametrize-%{version}.tar.gz
# PATCH-FIX-UPSTREAM Iterable-collections.patch gh#man-group/pytest-plugins#197 mcepl@suse.com
# Python 3.10 finally really killed collections class, which are now in
# collections.abc
Patch0: Iterable-collections.patch
BuildRequires: %{python_module setuptools-git} BuildRequires: %{python_module setuptools-git}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: fdupes BuildRequires: fdupes
@@ -46,6 +50,8 @@ More descriptive output for parametrized py.test tests.
%prep %prep
%setup -q -n pytest-verbose-parametrize-%{version} %setup -q -n pytest-verbose-parametrize-%{version}
%autopatch -p1
# we can't do integration tests as py2 and py3 can be different versions # we can't do integration tests as py2 and py3 can be different versions
# and the script simply calls $bindir/pytest # and the script simply calls $bindir/pytest
rm tests/integration/test_verbose_parametrize.py rm tests/integration/test_verbose_parametrize.py