diff --git a/fix-dummy-collector-pytest6.patch b/fix-dummy-collector-pytest6.patch new file mode 100644 index 0000000..0c503de --- /dev/null +++ b/fix-dummy-collector-pytest6.patch @@ -0,0 +1,49 @@ +From abb18d6f52a0fd22de209f5d02f4d5c66656a26a Mon Sep 17 00:00:00 2001 +From: Ben Greiner +Date: Fri, 4 Dec 2020 01:24:34 +0100 +Subject: [PATCH] fix dummycollector for pytest >= 6 + +--- + tests/conftest.py | 22 +++++++++++++++++----- + 1 file changed, 17 insertions(+), 5 deletions(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index e37790f..9e9e35b 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -2,18 +2,30 @@ + + import pytest + ++try: ++ from pytest import File as FileCollector ++except ImportError: ++ from pytest.collect import File as FileCollector ++ + version = tuple(sys.version_info[:2]) + +-class DummyCollector(pytest.collect.File): ++class DummyCollector(FileCollector): + def collect(self): + return [] + ++def construct_dummy(path, parent): ++ if hasattr(DummyCollector, "from_parent"): ++ item = DummyCollector.from_parent(parent, fspath=path) ++ return item ++ else: ++ return DummyCollector(path, parent=parent) ++ + def pytest_pycollect_makemodule(path, parent): + if '_py33' in path.basename and version < (3, 3): +- return DummyCollector(path, parent=parent) ++ return construct_dummy(path, parent) + if '_py37' in path.basename and version < (3, 7): +- return DummyCollector(path, parent=parent) ++ return construct_dummy(path, parent) + if '_py3' in path.basename and version < (3, 0): +- return DummyCollector(path, parent=parent) ++ return construct_dummy(path, parent) + if '_py2' in path.basename and version >= (3, 0): +- return DummyCollector(path, parent=parent) ++ return construct_dummy(path, parent) diff --git a/python-wrapt.changes b/python-wrapt.changes index 06d9692..677e346 100644 --- a/python-wrapt.changes +++ b/python-wrapt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Dec 4 00:37:53 UTC 2020 - Benjamin Greiner + +- Fix python3.6 build with pytest 6 + * fix-dummy-collector-pytest6.patch + * gh#GrahamDumpleton/wrapt#168 + ------------------------------------------------------------------- Mon Mar 16 11:01:55 UTC 2020 - Dirk Mueller diff --git a/python-wrapt.spec b/python-wrapt.spec index 958e328..975068f 100644 --- a/python-wrapt.spec +++ b/python-wrapt.spec @@ -26,6 +26,8 @@ License: BSD-2-Clause Group: Development/Languages/Python URL: https://github.com/GrahamDumpleton/wrapt Source: https://github.com/GrahamDumpleton/wrapt/archive/%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#GrahamDumpleton/wrapt#168 -- fix pytest 6 dummy collection +Patch0: https://github.com/GrahamDumpleton/wrapt/pull/168.patch#/fix-dummy-collector-pytest6.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} @@ -59,6 +61,7 @@ For further information on the **wrapt** module see: %prep %setup -q -n wrapt-%{version} +%patch0 -p1 %build export CFLAGS="%{optflags}"