14
0

- Remove now broken bconds for python2/python3.

- Add patch pytest-7-support.patch:
  * Support pytest 7.0+ changes.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-promise?expand=0&rev=9
This commit is contained in:
2022-06-20 03:00:20 +00:00
committed by Git OBS Bridge
parent 6403013bd4
commit 9e337e76a6
3 changed files with 46 additions and 15 deletions

34
pytest-7-support.patch Normal file
View File

@@ -0,0 +1,34 @@
From 381687df55fda715a87395f7ffba1c91428650e2 Mon Sep 17 00:00:00 2001
From: Bruno Oliveira <nicoddemus@gmail.com>
Date: Fri, 17 Dec 2021 10:16:06 -0300
Subject: [PATCH] Fix tests for pytest 7.0 compatibility
The `path` attribute of `Traceback` objects is now `pathlib.Path`.
This changes the affected code so it will work with pytest 7.0 and previous versions too.
---
tests/test_extra.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/test_extra.py b/tests/test_extra.py
index 4a08371..b983d07 100644
--- a/tests/test_extra.py
+++ b/tests/test_extra.py
@@ -113,7 +113,7 @@ def throws(v):
with raises(AssertionError) as assert_exc:
p3.get()
- assert assert_exc.traceback[-1].path.strpath == __file__
+ assert str(assert_exc.traceback[-1].path) == __file__
def test_thrown_exceptions_preserve_stacktrace():
@@ -127,7 +127,7 @@ def after_throws(v):
with raises(AssertionError) as assert_exc:
p3.get()
- assert assert_exc.traceback[-1].path.strpath == __file__
+ assert str(assert_exc.traceback[-1].path) == __file__
# WAIT

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Jun 20 02:53:04 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Remove now broken bconds for python2/python3.
- Add patch pytest-7-support.patch:
* Support pytest 7.0+ changes.
-------------------------------------------------------------------
Wed Mar 18 15:18:21 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-promise
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,41 +17,31 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2
%bcond_without python3
Name: python-promise
Version: 2.3.0
Release: 0
Summary: Promises/A+ implementation for Python
License: MIT
Group: Development/Languages/Python
URL: https://github.com/syrusakbary/promise
Source: https://github.com/syrusakbary/promise/archive/v%{version}.tar.gz#/promise-%{version}.tar.gz
# PATCH-FIX-UPSTREAM gh#syrusakbary/promise#96
Patch0: pytest-7-support.patch
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytest-benchmark}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
%if %{with python2}
BuildRequires: python2-futures
BuildRequires: python2-typing
%endif
%if %{with python3}
BuildRequires: python3-pytest-asyncio
%endif
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-six
BuildArch: noarch
%ifpython2
Requires: python-typing
%endif
%python_subpackages
%description
This is an implementation of Promises in Python
%prep
%setup -q -n promise-%{version}
%autosetup -p1 -n promise-%{version}
%build
%python_build