From 965c333517dae6b6beef72bb426417aaae7577515b9e4d17dc8b261ab8d06449 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Fri, 24 Feb 2023 11:23:34 +0000 Subject: [PATCH] - Add python-311.patch to support python 3.11 gh#syrusakbary/promise#99 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-promise?expand=0&rev=11 --- python-311.patch | 41 +++++++++++++++++++++++++++++++++++++++++ python-promise.changes | 6 ++++++ python-promise.spec | 7 ++++--- 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 python-311.patch diff --git a/python-311.patch b/python-311.patch new file mode 100644 index 0000000..1a50000 --- /dev/null +++ b/python-311.patch @@ -0,0 +1,41 @@ +diff --git a/tests/test_awaitable.py b/tests/test_awaitable.py +index aad7f2c..a14a181 100644 +--- a/tests/test_awaitable.py ++++ b/tests/test_awaitable.py +@@ -1,18 +1,15 @@ +-from asyncio import coroutine + from pytest import mark + from time import sleep + from promise import Promise + + + @mark.asyncio +-@coroutine +-def test_await(): +- yield from Promise.resolve(True) ++async def test_await(): ++ await Promise.resolve(True) + + + @mark.asyncio +-@coroutine +-def test_await_time(): ++async def test_await_time(): + def resolve_or_reject(resolve, reject): + sleep(.1) + resolve(True) +@@ -22,11 +19,9 @@ def resolve_or_reject(resolve, reject): + + + @mark.asyncio +-@coroutine +-def test_promise_coroutine(): +- @coroutine +- def my_coro(): +- yield from Promise.resolve(True) ++async def test_promise_coroutine(): ++ async def my_coro(): ++ await Promise.resolve(True) + + promise = Promise.resolve(my_coro()) + assert isinstance(promise, Promise) diff --git a/python-promise.changes b/python-promise.changes index c9a7c68..3f2add4 100644 --- a/python-promise.changes +++ b/python-promise.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Feb 24 11:14:52 UTC 2023 - Daniel Garcia + +- Add python-311.patch to support python 3.11 + gh#syrusakbary/promise#99 + ------------------------------------------------------------------- Mon Jun 20 02:53:04 UTC 2022 - Steve Kowalik diff --git a/python-promise.spec b/python-promise.spec index 8552913..e44968a 100644 --- a/python-promise.spec +++ b/python-promise.spec @@ -1,7 +1,7 @@ # # spec file for package python-promise # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-promise Version: 2.3.0 Release: 0 @@ -26,6 +25,8 @@ 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 +# PATCH-FIX-UPSTREAM python-311.patch gh#syrusakbary/promise#99 +Patch1: python-311.patch BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest-benchmark} BuildRequires: %{python_module pytest} @@ -56,6 +57,6 @@ This is an implementation of Promises in Python %files %{python_files} %doc README.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/promise* %changelog