forked from pool/python-reactivex
Compare commits
4 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| d3125115db | |||
| 52a1a730b1 | |||
| 513f71c445 | |||
| e9f5b2e04b |
334
fix-python314-test.patch
Normal file
334
fix-python314-test.patch
Normal file
@@ -0,0 +1,334 @@
|
|||||||
|
Index: RxPY-4.1.0/tests/test_observable/test_flatmap_async.py
|
||||||
|
===================================================================
|
||||||
|
--- RxPY-4.1.0.orig/tests/test_observable/test_flatmap_async.py
|
||||||
|
+++ RxPY-4.1.0/tests/test_observable/test_flatmap_async.py
|
||||||
|
@@ -9,7 +9,11 @@ from reactivex.subject import Subject
|
||||||
|
class TestFlatMapAsync(unittest.TestCase):
|
||||||
|
def test_flat_map_async(self):
|
||||||
|
actual_next = None
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
scheduler = AsyncIOScheduler(loop=loop)
|
||||||
|
|
||||||
|
def mapper(i: int):
|
||||||
|
Index: RxPY-4.1.0/tests/test_observable/test_fromfuture.py
|
||||||
|
===================================================================
|
||||||
|
--- RxPY-4.1.0.orig/tests/test_observable/test_fromfuture.py
|
||||||
|
+++ RxPY-4.1.0/tests/test_observable/test_fromfuture.py
|
||||||
|
@@ -7,7 +7,11 @@ import reactivex
|
||||||
|
|
||||||
|
class TestFromFuture(unittest.TestCase):
|
||||||
|
def test_future_success(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
success = [False, True, False]
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
@@ -31,7 +35,11 @@ class TestFromFuture(unittest.TestCase):
|
||||||
|
assert all(success)
|
||||||
|
|
||||||
|
def test_future_failure(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
success = [True, False, True]
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
@@ -57,7 +65,11 @@ class TestFromFuture(unittest.TestCase):
|
||||||
|
assert all(success)
|
||||||
|
|
||||||
|
def test_future_cancel(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
success = [True, False, True]
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
@@ -80,7 +92,11 @@ class TestFromFuture(unittest.TestCase):
|
||||||
|
assert all(success)
|
||||||
|
|
||||||
|
def test_future_dispose(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
success = [True, True, True]
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
Index: RxPY-4.1.0/tests/test_observable/test_start.py
|
||||||
|
===================================================================
|
||||||
|
--- RxPY-4.1.0.orig/tests/test_observable/test_start.py
|
||||||
|
+++ RxPY-4.1.0/tests/test_observable/test_start.py
|
||||||
|
@@ -16,7 +16,11 @@ created = ReactiveTest.created
|
||||||
|
|
||||||
|
class TestStart(unittest.TestCase):
|
||||||
|
def test_start_async(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
success = [False]
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
@@ -36,7 +40,11 @@ class TestStart(unittest.TestCase):
|
||||||
|
assert all(success)
|
||||||
|
|
||||||
|
def test_start_async_error(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
success = [False]
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
Index: RxPY-4.1.0/tests/test_observable/test_tofuture.py
|
||||||
|
===================================================================
|
||||||
|
--- RxPY-4.1.0.orig/tests/test_observable/test_tofuture.py
|
||||||
|
+++ RxPY-4.1.0/tests/test_observable/test_tofuture.py
|
||||||
|
@@ -18,7 +18,11 @@ created = ReactiveTest.created
|
||||||
|
|
||||||
|
class TestToFuture(unittest.TestCase):
|
||||||
|
def test_await_success(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
result = None
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
@@ -30,7 +34,11 @@ class TestToFuture(unittest.TestCase):
|
||||||
|
assert result == 42
|
||||||
|
|
||||||
|
def test_await_success_on_sequence(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
result = None
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
@@ -42,7 +50,11 @@ class TestToFuture(unittest.TestCase):
|
||||||
|
assert result == 42
|
||||||
|
|
||||||
|
def test_await_error(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
error = Exception("error")
|
||||||
|
result = None
|
||||||
|
|
||||||
|
@@ -58,7 +70,11 @@ class TestToFuture(unittest.TestCase):
|
||||||
|
assert result == error
|
||||||
|
|
||||||
|
def test_await_empty_observable(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
result = None
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
@@ -71,7 +87,11 @@ class TestToFuture(unittest.TestCase):
|
||||||
|
)
|
||||||
|
|
||||||
|
def test_await_with_delay(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
result = None
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
@@ -83,7 +103,11 @@ class TestToFuture(unittest.TestCase):
|
||||||
|
assert result == 42
|
||||||
|
|
||||||
|
def test_cancel(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
source = reactivex.return_value(42)
|
||||||
|
@@ -96,7 +120,11 @@ class TestToFuture(unittest.TestCase):
|
||||||
|
self.assertRaises(asyncio.CancelledError, loop.run_until_complete, go())
|
||||||
|
|
||||||
|
def test_dispose_on_cancel(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
sub = Subject()
|
||||||
|
|
||||||
|
async def using_sub():
|
||||||
|
Index: RxPY-4.1.0/tests/test_scheduler/test_eventloop/test_asyncioscheduler.py
|
||||||
|
===================================================================
|
||||||
|
--- RxPY-4.1.0.orig/tests/test_scheduler/test_eventloop/test_asyncioscheduler.py
|
||||||
|
+++ RxPY-4.1.0/tests/test_scheduler/test_eventloop/test_asyncioscheduler.py
|
||||||
|
@@ -13,14 +13,22 @@ CI = os.getenv("CI") is not None
|
||||||
|
class TestAsyncIOScheduler(unittest.TestCase):
|
||||||
|
@pytest.mark.skipif(CI, reason="Flaky test in GitHub Actions")
|
||||||
|
def test_asyncio_schedule_now(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
scheduler = AsyncIOScheduler(loop)
|
||||||
|
diff = scheduler.now - datetime.fromtimestamp(loop.time(), tz=timezone.utc)
|
||||||
|
assert abs(diff) < timedelta(milliseconds=2) # NOTE: may take 1 ms in CI
|
||||||
|
|
||||||
|
@pytest.mark.skipif(CI, reason="Test is flaky in GitHub Actions")
|
||||||
|
def test_asyncio_schedule_now_units(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
scheduler = AsyncIOScheduler(loop)
|
||||||
|
diff = scheduler.now
|
||||||
|
yield from asyncio.sleep(0.1)
|
||||||
|
@@ -28,7 +36,11 @@ class TestAsyncIOScheduler(unittest.Test
|
||||||
|
assert timedelta(milliseconds=80) < diff < timedelta(milliseconds=180)
|
||||||
|
|
||||||
|
def test_asyncio_schedule_action(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
scheduler = AsyncIOScheduler(loop)
|
||||||
|
@@ -46,7 +58,11 @@ class TestAsyncIOScheduler(unittest.Test
|
||||||
|
loop.run_until_complete(go())
|
||||||
|
|
||||||
|
def test_asyncio_schedule_action_due(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
scheduler = AsyncIOScheduler(loop)
|
||||||
|
@@ -67,7 +83,11 @@ class TestAsyncIOScheduler(unittest.Test
|
||||||
|
loop.run_until_complete(go())
|
||||||
|
|
||||||
|
def test_asyncio_schedule_action_cancel(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
ran = False
|
||||||
|
Index: RxPY-4.1.0/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py
|
||||||
|
===================================================================
|
||||||
|
--- RxPY-4.1.0.orig/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py
|
||||||
|
+++ RxPY-4.1.0/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py
|
||||||
|
@@ -14,14 +14,22 @@ CI = os.getenv("CI") is not None
|
||||||
|
class TestAsyncIOThreadSafeScheduler(unittest.TestCase):
|
||||||
|
@pytest.mark.skipif(CI, reason="Flaky test in GitHub Actions")
|
||||||
|
def test_asyncio_threadsafe_schedule_now(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
scheduler = AsyncIOThreadSafeScheduler(loop)
|
||||||
|
diff = scheduler.now - datetime.fromtimestamp(loop.time(), tz=timezone.utc)
|
||||||
|
assert abs(diff) < timedelta(milliseconds=2)
|
||||||
|
|
||||||
|
@pytest.mark.skipif(CI, reason="Flaky test in GitHub Actions")
|
||||||
|
def test_asyncio_threadsafe_schedule_now_units(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
scheduler = AsyncIOThreadSafeScheduler(loop)
|
||||||
|
diff = scheduler.now
|
||||||
|
yield from asyncio.sleep(0.1)
|
||||||
|
@@ -29,7 +37,11 @@ class TestAsyncIOThreadSafeScheduler(uni
|
||||||
|
assert timedelta(milliseconds=80) < diff < timedelta(milliseconds=180)
|
||||||
|
|
||||||
|
def test_asyncio_threadsafe_schedule_action(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
scheduler = AsyncIOThreadSafeScheduler(loop)
|
||||||
|
@@ -50,7 +62,11 @@ class TestAsyncIOThreadSafeScheduler(uni
|
||||||
|
loop.run_until_complete(go())
|
||||||
|
|
||||||
|
def test_asyncio_threadsafe_schedule_action_due(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
scheduler = AsyncIOThreadSafeScheduler(loop)
|
||||||
|
@@ -74,7 +90,11 @@ class TestAsyncIOThreadSafeScheduler(uni
|
||||||
|
loop.run_until_complete(go())
|
||||||
|
|
||||||
|
def test_asyncio_threadsafe_schedule_action_cancel(self):
|
||||||
|
- loop = asyncio.get_event_loop()
|
||||||
|
+ try:
|
||||||
|
+ loop = asyncio.get_running_loop()
|
||||||
|
+ except RuntimeError:
|
||||||
|
+ loop = asyncio.new_event_loop()
|
||||||
|
+ asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
|
async def go():
|
||||||
|
ran = False
|
||||||
@@ -1,3 +1,30 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Nov 27 17:47:25 UTC 2025 - Marius Grossu <marius.grossu@suse.com>
|
||||||
|
|
||||||
|
- Upadate to version 4.1.0:
|
||||||
|
* Update Notebooks: Part One by @J0
|
||||||
|
* Update get_started.rst
|
||||||
|
* docs: fix miss typed operator name
|
||||||
|
* Fix flake8 in pre-commit
|
||||||
|
* fix(docs): IO Concurrency for 3.10+
|
||||||
|
* Concat map
|
||||||
|
* Docs on testing
|
||||||
|
* [DOCS] Getting started: fix example
|
||||||
|
* Update pyright to 1.1.286
|
||||||
|
* Add CI check for Python-3.11
|
||||||
|
* Switchmap operator
|
||||||
|
* Fix deprecated calls to datetime by @ricardobranco777
|
||||||
|
* CI: Update used actions and Python versions
|
||||||
|
* Fix build
|
||||||
|
* Drop Python 3.8 support
|
||||||
|
* Support Python 3.11, 3.12 and 3.13
|
||||||
|
- Added fix-python314-test.patch: Fix tests to be compatible with Python3.14 until new version release
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Mar 12 13:19:12 UTC 2025 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- build against modern python on sle15
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Mar 3 11:48:45 UTC 2024 - Ben Greiner <code@bnavigator.de>
|
Sun Mar 3 11:48:45 UTC 2024 - Ben Greiner <code@bnavigator.de>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-reactivex
|
# spec file for package python-reactivex
|
||||||
#
|
#
|
||||||
# Copyright (c) 2024 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC and contributors
|
||||||
#
|
#
|
||||||
# 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,14 +16,17 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-reactivex
|
Name: python-reactivex
|
||||||
Version: 4.0.4
|
Version: 4.1.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: ReactiveX (Rx) for Python
|
Summary: ReactiveX (Rx) for Python
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://reactivex.io
|
URL: https://reactivex.io
|
||||||
# SourceRepository: https://github.com/ReactiveX/RxPY
|
# SourceRepository: https://github.com/ReactiveX/RxPY
|
||||||
Source: https://github.com/ReactiveX/RxPY/archive/refs/tags/v%{version}.tar.gz#/reactivex-%{version}-gh.tar.gz
|
Source: https://github.com/ReactiveX/RxPY/archive/refs/tags/v%{version}.tar.gz#/reactivex-%{version}-gh.tar.gz
|
||||||
|
#PATCH-FIX-OPENSUSE fix-python314-test.patch
|
||||||
|
Patch0: fix-python314-test.patch
|
||||||
BuildRequires: %{python_module base >= 3.7}
|
BuildRequires: %{python_module base >= 3.7}
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module poetry-core >= 1.0.0}
|
BuildRequires: %{python_module poetry-core >= 1.0.0}
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:4222862253bfc7c34baefffc8761fea7b66446576791450cacb65584d9c92fb8
|
|
||||||
size 916572
|
|
||||||
3
reactivex-4.1.0-gh.tar.gz
Normal file
3
reactivex-4.1.0-gh.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a048a6e894fc9da992b186a74ff494fdb59cab5422b5bf23ebe7adcf490dcdc6
|
||||||
|
size 928201
|
||||||
Reference in New Issue
Block a user