Date: Wednesday, April 19, 2023 @ 09:11:02
Author: alucryd
Revision: 1447420
archrelease: copy trunk to community-staging-any
Added:
python-rx/repos/community-staging-any/
python-rx/repos/community-staging-any/PKGBUILD
(from rev 1447419, python-rx/trunk/PKGBUILD)
python-rx/repos/community-staging-any/python-rx-py311.patch
(from rev 1447419, python-rx/trunk/python-rx-py311.patch)
-----------------------+
PKGBUILD | 59 ++++++++++
python-rx-py311.patch | 258 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 317 insertions(+)
Copied: python-rx/repos/community-staging-any/PKGBUILD (from rev 1447419,
python-rx/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD (rev 0)
+++ community-staging-any/PKGBUILD 2023-04-19 09:11:02 UTC (rev 1447420)
@@ -0,0 +1,59 @@
+# Maintainer: Maxime Gauduin <[email protected]>
+# Contributor: Ilya Elenskiy <[email protected]>
+# Contributor: Julien Nicoulaud <[email protected]>
+
+pkgname=python-rx
+pkgver=3.2.0
+pkgrel=4
+pkgdesc='Reactive Extensions for Python'
+arch=(any)
+url=http://reactivex.io
+license=(APACHE)
+depends=(python)
+makedepends=(
+ git
+ python-setuptools
+)
+checkdepends=(
+ python-coverage
+ python-nose
+ python-pytest
+ python-pytest-asyncio
+)
+_tag=5054de8874f275ed0de55007b87cff4817b1d9f7
+source=(
+ git+https://github.com/ReactiveX/RxPY.git#tag=${_tag}
+ python-rx-py311.patch
+)
+b2sums=('SKIP'
+
'3062891dcdfec9ad21ec6815aa1f83ad6b898de32339c02cef9369a975719a1d58ab7bb07cc352829264b20bfd9a710905c96cc3b88c31b157ba1336dc77271d')
+
+pkgver() {
+ cd RxPY
+ git describe --tags | sed 's/^v//'
+}
+
+prepare() {
+ cd RxPY
+ # Remove deprecated loop parameter (#575)
+ # https://github.com/ReactiveX/RxPY/pull/575
+ git format-patch -1 --stdout 246eabfefd17 | patch -Np1
+ patch -Np1 -i ../python-rx-py311.patch
+}
+
+build() {
+ cd RxPY
+ python setup.py build
+}
+
+check() {
+ cd RxPY
+ python -m pytest
+}
+
+package() {
+ cd RxPY
+ python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+}
+
+# vim: ts=2 sw=2 et:
Copied: python-rx/repos/community-staging-any/python-rx-py311.patch (from rev
1447419, python-rx/trunk/python-rx-py311.patch)
===================================================================
--- community-staging-any/python-rx-py311.patch (rev 0)
+++ community-staging-any/python-rx-py311.patch 2023-04-19 09:11:02 UTC (rev
1447420)
@@ -0,0 +1,258 @@
+diff '--color=auto' -rupN RxPY.orig/examples/asyncio/toasyncgenerator.py
RxPY/examples/asyncio/toasyncgenerator.py
+--- RxPY.orig/examples/asyncio/toasyncgenerator.py 2023-04-19
10:47:27.792573762 +0200
++++ RxPY/examples/asyncio/toasyncgenerator.py 2023-04-19 10:58:20.669169041
+0200
+@@ -37,8 +37,7 @@ def to_async_generator(sentinel=None):
+
+ source.pipe(ops.materialize()).subscribe(on_next)
+
+- @asyncio.coroutine
+- def gen():
++ async def gen():
+ """Generator producing futures"""
+ nonlocal future
+
+@@ -50,17 +49,16 @@ def to_async_generator(sentinel=None):
+ return _to_async_generator
+
+
[email protected]
+-def go(loop):
++async def go(loop):
+ scheduler = AsyncIOScheduler(loop)
+
+ xs = rx.from_([x for x in range(10)], scheduler=scheduler)
+ gen = xs.pipe(to_async_generator())
+
+ # Wish we could write something like:
+- # ys = (x for x in yield from gen())
++ # ys = (x for x in await gen())
+ while True:
+- x = yield from gen()
++ x = await gen()
+ if x is None:
+ break
+ print(x)
+diff '--color=auto' -rupN RxPY.orig/tests/test_observable/test_fromfuture.py
RxPY/tests/test_observable/test_fromfuture.py
+--- RxPY.orig/tests/test_observable/test_fromfuture.py 2023-04-19
10:47:27.805908319 +0200
++++ RxPY/tests/test_observable/test_fromfuture.py 2023-04-19
10:48:45.369694016 +0200
+@@ -11,8 +11,7 @@ class TestFromFuture(unittest.TestCase):
+ loop = asyncio.get_event_loop()
+ success = [False, True, False]
+
+- @asyncio.coroutine
+- def go():
++ async def go():
+ future = Future()
+ future.set_result(42)
+
+@@ -36,8 +35,7 @@ class TestFromFuture(unittest.TestCase):
+ loop = asyncio.get_event_loop()
+ success = [True, False, True]
+
+- @asyncio.coroutine
+- def go():
++ async def go():
+ error = Exception('woops')
+
+ future = Future()
+@@ -63,8 +61,7 @@ class TestFromFuture(unittest.TestCase):
+ loop = asyncio.get_event_loop()
+ success = [True, False, True]
+
+- @asyncio.coroutine
+- def go():
++ async def go():
+ future = Future()
+ source = rx.from_future(future)
+
+@@ -87,8 +84,7 @@ class TestFromFuture(unittest.TestCase):
+ loop = asyncio.get_event_loop()
+ success = [True, True, True]
+
+- @asyncio.coroutine
+- def go():
++ async def go():
+ future = Future()
+ future.set_result(42)
+
+diff '--color=auto' -rupN RxPY.orig/tests/test_observable/test_start.py
RxPY/tests/test_observable/test_start.py
+--- RxPY.orig/tests/test_observable/test_start.py 2023-04-19
10:47:27.809241958 +0200
++++ RxPY/tests/test_observable/test_start.py 2023-04-19 10:49:03.544695537
+0200
+@@ -20,8 +20,7 @@ class TestStart(unittest.TestCase):
+ loop = asyncio.get_event_loop()
+ success = [False]
+
+- @asyncio.coroutine
+- def go():
++ async def go():
+ def func():
+ future = Future()
+ future.set_result(42)
+@@ -40,8 +39,7 @@ class TestStart(unittest.TestCase):
+ loop = asyncio.get_event_loop()
+ success = [False]
+
+- @asyncio.coroutine
+- def go():
++ async def go():
+ def func():
+ future = Future()
+ future.set_exception(Exception(str(42)))
+diff '--color=auto' -rupN
RxPY.orig/tests/test_scheduler/test_eventloop/test_asyncioscheduler.py
RxPY/tests/test_scheduler/test_eventloop/test_asyncioscheduler.py
+--- RxPY.orig/tests/test_scheduler/test_eventloop/test_asyncioscheduler.py
2023-04-19 10:47:27.822576515 +0200
++++ RxPY/tests/test_scheduler/test_eventloop/test_asyncioscheduler.py
2023-04-19 11:08:03.866092222 +0200
+@@ -14,19 +14,18 @@ class TestAsyncIOScheduler(unittest.Test
+ diff = scheduler.now - datetime.utcfromtimestamp(loop.time())
+ assert abs(diff) < timedelta(milliseconds=1)
+
+- def test_asyncio_schedule_now_units(self):
++ async def test_asyncio_schedule_now_units(self):
+ loop = asyncio.get_event_loop()
+ scheduler = AsyncIOScheduler(loop)
+ diff = scheduler.now
+- yield from asyncio.sleep(0.1)
++ await asyncio.sleep(0.1)
+ diff = scheduler.now - diff
+ assert timedelta(milliseconds=80) < diff < timedelta(milliseconds=180)
+
+ def test_asyncio_schedule_action(self):
+ loop = asyncio.get_event_loop()
+
+- @asyncio.coroutine
+- def go():
++ async def go():
+ scheduler = AsyncIOScheduler(loop)
+ ran = False
+
+@@ -36,7 +35,7 @@ class TestAsyncIOScheduler(unittest.Test
+
+ scheduler.schedule(action)
+
+- yield from asyncio.sleep(0.1)
++ await asyncio.sleep(0.1)
+ assert ran is True
+
+ loop.run_until_complete(go())
+@@ -44,8 +43,7 @@ class TestAsyncIOScheduler(unittest.Test
+ def test_asyncio_schedule_action_due(self):
+ loop = asyncio.get_event_loop()
+
+- @asyncio.coroutine
+- def go():
++ async def go():
+ scheduler = AsyncIOScheduler(loop)
+ starttime = loop.time()
+ endtime = None
+@@ -56,7 +54,7 @@ class TestAsyncIOScheduler(unittest.Test
+
+ scheduler.schedule_relative(0.2, action)
+
+- yield from asyncio.sleep(0.3)
++ await asyncio.sleep(0.3)
+ assert endtime is not None
+ diff = endtime - starttime
+ assert diff > 0.18
+@@ -66,8 +64,7 @@ class TestAsyncIOScheduler(unittest.Test
+ def test_asyncio_schedule_action_cancel(self):
+ loop = asyncio.get_event_loop()
+
+- @asyncio.coroutine
+- def go():
++ async def go():
+ ran = False
+ scheduler = AsyncIOScheduler(loop)
+
+@@ -78,7 +75,7 @@ class TestAsyncIOScheduler(unittest.Test
+ d = scheduler.schedule_relative(0.05, action)
+ d.dispose()
+
+- yield from asyncio.sleep(0.3)
++ await asyncio.sleep(0.3)
+ assert ran is False
+
+ loop.run_until_complete(go())
+diff '--color=auto' -rupN
RxPY.orig/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py
RxPY/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py
+---
RxPY.orig/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py
2023-04-19 10:47:27.822576515 +0200
++++
RxPY/tests/test_scheduler/test_eventloop/test_asynciothreadsafescheduler.py
2023-04-19 11:08:34.792276377 +0200
+@@ -15,19 +15,18 @@ class TestAsyncIOThreadSafeScheduler(uni
+ diff = scheduler.now - datetime.utcfromtimestamp(loop.time())
+ assert abs(diff) < timedelta(milliseconds=1)
+
+- def test_asyncio_threadsafe_schedule_now_units(self):
++ async def test_asyncio_threadsafe_schedule_now_units(self):
+ loop = asyncio.get_event_loop()
+ scheduler = AsyncIOThreadSafeScheduler(loop)
+ diff = scheduler.now
+- yield from asyncio.sleep(0.1)
++ await asyncio.sleep(0.1)
+ diff = scheduler.now - diff
+ assert timedelta(milliseconds=80) < diff < timedelta(milliseconds=180)
+
+ def test_asyncio_threadsafe_schedule_action(self):
+ loop = asyncio.get_event_loop()
+
+- @asyncio.coroutine
+- def go():
++ async def go():
+ scheduler = AsyncIOThreadSafeScheduler(loop)
+ ran = False
+
+@@ -40,7 +39,7 @@ class TestAsyncIOThreadSafeScheduler(uni
+
+ threading.Thread(target=schedule).start()
+
+- yield from asyncio.sleep(0.1)
++ await asyncio.sleep(0.1)
+ assert ran is True
+
+ loop.run_until_complete(go())
+@@ -48,8 +47,7 @@ class TestAsyncIOThreadSafeScheduler(uni
+ def test_asyncio_threadsafe_schedule_action_due(self):
+ loop = asyncio.get_event_loop()
+
+- @asyncio.coroutine
+- def go():
++ async def go():
+ scheduler = AsyncIOThreadSafeScheduler(loop)
+ starttime = loop.time()
+ endtime = None
+@@ -63,7 +61,7 @@ class TestAsyncIOThreadSafeScheduler(uni
+
+ threading.Thread(target=schedule).start()
+
+- yield from asyncio.sleep(0.3)
++ await asyncio.sleep(0.3)
+ assert endtime is not None
+ diff = endtime - starttime
+ assert diff > 0.18
+@@ -73,8 +71,7 @@ class TestAsyncIOThreadSafeScheduler(uni
+ def test_asyncio_threadsafe_schedule_action_cancel(self):
+ loop = asyncio.get_event_loop()
+
+- @asyncio.coroutine
+- def go():
++ async def go():
+ ran = False
+ scheduler = AsyncIOThreadSafeScheduler(loop)
+
+@@ -88,7 +85,7 @@ class TestAsyncIOThreadSafeScheduler(uni
+
+ threading.Thread(target=schedule).start()
+
+- yield from asyncio.sleep(0.3)
++ await asyncio.sleep(0.3)
+ assert ran is False
+
+ loop.run_until_complete(go())
+@@ -110,9 +107,8 @@ class TestAsyncIOThreadSafeScheduler(uni
+
+ test_body(scheduler, action, update_state)
+
+- @asyncio.coroutine
+- def go():
+- yield from asyncio.sleep(0.2)
++ async def go():
++ await asyncio.sleep(0.2)
+
+ loop.run_until_complete(go())
+