Skip to content

Commit

Permalink
Update python-promise to version 2.3.0 / rev 5 via SR 1067864
Browse files Browse the repository at this point in the history
https://build.opensuse.org/request/show/1067864
by user jayvdb + dimstar_suse
- Add python-311.patch to support python 3.11
  gh#syrusakbary/promise#99
  • Loading branch information
jayvdb authored and bmwiedemann committed Feb 27, 2023
1 parent ee7d95b commit 5907ccc
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 3 deletions.
Binary file modified packages/p/python-promise/.files
Binary file not shown.
10 changes: 10 additions & 0 deletions packages/p/python-promise/.rev
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,14 @@
* Support pytest 7.0+ changes.</comment>
<requestid>983793</requestid>
</revision>
<revision rev="5" vrev="3">
<srcmd5>e8d7709c17e68324c24f47ceaa8a3f09</srcmd5>
<version>2.3.0</version>
<time>1677498930</time>
<user>dimstar_suse</user>
<comment>- Add python-311.patch to support python 3.11
gh#syrusakbary/promise#99
</comment>
<requestid>1067864</requestid>
</revision>
</revisionlist>
41 changes: 41 additions & 0 deletions packages/p/python-promise/python-311.patch
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 6 additions & 0 deletions packages/p/python-promise/python-promise.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Feb 24 11:14:52 UTC 2023 - Daniel Garcia <[email protected]>

- Add python-311.patch to support python 3.11
gh#syrusakbary/promise#99

-------------------------------------------------------------------
Mon Jun 20 02:53:04 UTC 2022 - Steve Kowalik <[email protected]>

Expand Down
7 changes: 4 additions & 3 deletions packages/p/python-promise/python-promise.spec
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -16,7 +16,6 @@
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-promise
Version: 2.3.0
Release: 0
Expand All @@ -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}
Expand Down Expand Up @@ -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

0 comments on commit 5907ccc

Please sign in to comment.