forked from pool/python-promise
Accepting request 1067864 from devel:languages:python
- Add python-311.patch to support python 3.11 gh#syrusakbary/promise#99 OBS-URL: https://build.opensuse.org/request/show/1067864 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-promise?expand=0&rev=5
This commit is contained in:
41
python-311.patch
Normal file
41
python-311.patch
Normal file
@@ -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)
|
@@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Feb 24 11:14:52 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
|
||||||
|
|
||||||
|
- Add python-311.patch to support python 3.11
|
||||||
|
gh#syrusakbary/promise#99
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jun 20 02:53:04 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
|
Mon Jun 20 02:53:04 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-promise
|
# 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
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
||||||
Name: python-promise
|
Name: python-promise
|
||||||
Version: 2.3.0
|
Version: 2.3.0
|
||||||
Release: 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
|
Source: https://github.com/syrusakbary/promise/archive/v%{version}.tar.gz#/promise-%{version}.tar.gz
|
||||||
# PATCH-FIX-UPSTREAM gh#syrusakbary/promise#96
|
# PATCH-FIX-UPSTREAM gh#syrusakbary/promise#96
|
||||||
Patch0: pytest-7-support.patch
|
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-asyncio}
|
||||||
BuildRequires: %{python_module pytest-benchmark}
|
BuildRequires: %{python_module pytest-benchmark}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
@@ -56,6 +57,6 @@ This is an implementation of Promises in Python
|
|||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/promise*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Reference in New Issue
Block a user