forked from pool/python-wrapt
Accepting request 853000 from home:bnavigator:branches:devel:languages:python
- Fix python3.6 build with pytest 6 * fix-dummy-collector-pytest6.patch * gh#GrahamDumpleton/wrapt#168 OBS-URL: https://build.opensuse.org/request/show/853000 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wrapt?expand=0&rev=23
This commit is contained in:
49
fix-dummy-collector-pytest6.patch
Normal file
49
fix-dummy-collector-pytest6.patch
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
From abb18d6f52a0fd22de209f5d02f4d5c66656a26a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ben Greiner <code@bnavigator.de>
|
||||||
|
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)
|
@@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Dec 4 00:37:53 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
- 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 <dmueller@suse.com>
|
Mon Mar 16 11:01:55 UTC 2020 - Dirk Mueller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@@ -26,6 +26,8 @@ License: BSD-2-Clause
|
|||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://github.com/GrahamDumpleton/wrapt
|
URL: https://github.com/GrahamDumpleton/wrapt
|
||||||
Source: https://github.com/GrahamDumpleton/wrapt/archive/%{version}.tar.gz
|
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 devel}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
@@ -59,6 +61,7 @@ For further information on the **wrapt** module see:
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n wrapt-%{version}
|
%setup -q -n wrapt-%{version}
|
||||||
|
%patch0 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CFLAGS="%{optflags}"
|
export CFLAGS="%{optflags}"
|
||||||
|
Reference in New Issue
Block a user