From 9e337e76a69224e866d91fac8d0570b841684dc3afa971dfc863e1452ca0cc5d Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 20 Jun 2022 03:00:20 +0000 Subject: [PATCH] - 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 --- pytest-7-support.patch | 34 ++++++++++++++++++++++++++++++++++ python-promise.changes | 7 +++++++ python-promise.spec | 20 +++++--------------- 3 files changed, 46 insertions(+), 15 deletions(-) create mode 100644 pytest-7-support.patch diff --git a/pytest-7-support.patch b/pytest-7-support.patch new file mode 100644 index 0000000..d60d974 --- /dev/null +++ b/pytest-7-support.patch @@ -0,0 +1,34 @@ +From 381687df55fda715a87395f7ffba1c91428650e2 Mon Sep 17 00:00:00 2001 +From: Bruno Oliveira +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 diff --git a/python-promise.changes b/python-promise.changes index b7a923d..c9a7c68 100644 --- a/python-promise.changes +++ b/python-promise.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jun 20 02:53:04 UTC 2022 - Steve Kowalik + +- 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 diff --git a/python-promise.spec b/python-promise.spec index 5338526..8552913 100644 --- a/python-promise.spec +++ b/python-promise.spec @@ -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