diff options
author | Michał Górny <mgorny@gentoo.org> | 2022-01-20 15:18:39 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-01-20 15:20:21 +0100 |
commit | 5aec68724c4be3f94d78445a03c1f906da387c89 (patch) | |
tree | 0b9d15a97bf44a0dcc04aa45c674934a2537d4cc /dev-python/async_timeout | |
parent | dev-python/aiohttp: Remove old (diff) | |
download | gentoo-5aec68724c4be3f94d78445a03c1f906da387c89.tar.gz gentoo-5aec68724c4be3f94d78445a03c1f906da387c89.tar.bz2 gentoo-5aec68724c4be3f94d78445a03c1f906da387c89.zip |
dev-python/async_timeout: Remove old
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/async_timeout')
-rw-r--r-- | dev-python/async_timeout/Manifest | 2 | ||||
-rw-r--r-- | dev-python/async_timeout/async_timeout-3.0.1.ebuild | 37 | ||||
-rw-r--r-- | dev-python/async_timeout/async_timeout-4.0.1.ebuild | 38 | ||||
-rw-r--r-- | dev-python/async_timeout/files/async_timeout-3.0.1-fix-py3.10.patch | 387 |
4 files changed, 0 insertions, 464 deletions
diff --git a/dev-python/async_timeout/Manifest b/dev-python/async_timeout/Manifest index 093108feba67..d2f3d5fd58b2 100644 --- a/dev-python/async_timeout/Manifest +++ b/dev-python/async_timeout/Manifest @@ -1,3 +1 @@ -DIST async-timeout-3.0.1.tar.gz 9724 BLAKE2B f18ae75969b7048469fe22949f25ea25da3fdbf08b98a16b5d5ffe823060a75e6de9ed764727e08d4344c79426e9c89013d49522f20ed62e6fbe912b5c7a8787 SHA512 fd30842671a79edfd52c7350e7fb2120533a6d97b44975f7b071ce2cbde43443bd5bbe1f2ad0ad3ab2156e1987b9e58e0c149b0ecfea8674eb0cb78eee79c986 -DIST async-timeout-4.0.1.tar.gz 8030 BLAKE2B 73bb3f38d33608d120a0d633231bc781b9b5530d80a08c98370ab9100486bda5fd9d7a68ae6b16315bf306a75690897d724fa5db318847803bc445074908e650 SHA512 24a72daf9e0737d0be351a35ff28242dea735bed33f06d9865a71983b1341693c80856c0668d6a485bccc8cf7b9adde33fa904e94bf4730e4a678216e572d119 DIST async-timeout-4.0.2.tar.gz 8221 BLAKE2B ebcb2ef956590e265bbdecc223a877e7260750aecf5b631c6af1f335ce57b51579467901e2344bfa8495010eb1e6e7a39adfd4b6311483d63e0674221888d1f7 SHA512 e9884a525b99bc1a3a15c958a1dbb25a92cb286bb7360b03b0be3198e61685970628c8fef6dc478beba3f031e0ff6f03b1fcc3c2c34032d7fea6f8b65850ac38 diff --git a/dev-python/async_timeout/async_timeout-3.0.1.ebuild b/dev-python/async_timeout/async_timeout-3.0.1.ebuild deleted file mode 100644 index 72fa7f086448..000000000000 --- a/dev-python/async_timeout/async_timeout-3.0.1.ebuild +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{8..10} pypy3 ) - -inherit distutils-r1 - -MY_P=${PN/_/-}-${PV} -DESCRIPTION="Timeout context manager for asyncio programs" -HOMEPAGE="https://github.com/aio-libs/async-timeout" -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz" -S=${WORKDIR}/${MY_P} - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 ~riscv sparc x86 ~x64-macos" - -BDEPEND=" - dev-python/setuptools_scm[${PYTHON_USEDEP}] - test? ( - dev-python/pytest-aiohttp[${PYTHON_USEDEP}] - dev-python/pytest-asyncio[${PYTHON_USEDEP}] - )" - -PATCHES=( "${FILESDIR}/${P}-fix-py3.10.patch" ) - -distutils_enable_tests pytest - -python_prepare_all() { - # remove pointless dep on pytest-cov - sed -i -e '/addopts/d' setup.cfg || die - # tests fail due to missing fixture when trying to load this file - rm tests/conftest.py || die - distutils-r1_python_prepare_all -} diff --git a/dev-python/async_timeout/async_timeout-4.0.1.ebuild b/dev-python/async_timeout/async_timeout-4.0.1.ebuild deleted file mode 100644 index deb375553838..000000000000 --- a/dev-python/async_timeout/async_timeout-4.0.1.ebuild +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{8..10} pypy3 ) -inherit distutils-r1 - -MY_P=${PN/_/-}-${PV} -DESCRIPTION="Timeout context manager for asyncio programs" -HOMEPAGE="https://github.com/aio-libs/async-timeout" -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz" -S=${WORKDIR}/${MY_P} - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 ~riscv sparc x86 ~x64-macos" - -RDEPEND=" - dev-python/typing-extensions[${PYTHON_USEDEP}]" -BDEPEND=" - dev-python/setuptools_scm[${PYTHON_USEDEP}] - test? ( - dev-python/pytest-aiohttp[${PYTHON_USEDEP}] - dev-python/pytest-asyncio[${PYTHON_USEDEP}] - )" - -distutils_enable_tests pytest - -python_prepare_all() { - # remove pointless dep on pytest-cov - sed -i -e '/addopts/d' setup.cfg || die - distutils-r1_python_prepare_all -} - -python_test() { - epytest -p no:aiohttp -} diff --git a/dev-python/async_timeout/files/async_timeout-3.0.1-fix-py3.10.patch b/dev-python/async_timeout/files/async_timeout-3.0.1-fix-py3.10.patch deleted file mode 100644 index 5bfdcf2e6dab..000000000000 --- a/dev-python/async_timeout/files/async_timeout-3.0.1-fix-py3.10.patch +++ /dev/null @@ -1,387 +0,0 @@ -diff --git a/tests/test_py35.py b/tests/test_py35.py -index 00bb7f0..7d88d99 100644 ---- a/tests/test_py35.py -+++ b/tests/test_py35.py -@@ -4,30 +4,32 @@ import pytest - - from async_timeout import timeout - --pytestmark = pytest.mark.asyncio - -- --async def test_async_timeout(loop): -+@pytest.mark.asyncio -+async def test_async_timeout(): - with pytest.raises(asyncio.TimeoutError): -- async with timeout(0.01, loop=loop) as cm: -- await asyncio.sleep(10, loop=loop) -+ async with timeout(0.01) as cm: -+ await asyncio.sleep(10) - assert cm.expired - - --async def test_async_no_timeout(loop): -- async with timeout(1, loop=loop) as cm: -- await asyncio.sleep(0, loop=loop) -+@pytest.mark.asyncio -+async def test_async_no_timeout(): -+ async with timeout(1) as cm: -+ await asyncio.sleep(0) - assert not cm.expired - - --async def test_async_zero(loop): -+@pytest.mark.asyncio -+async def test_async_zero(): - with pytest.raises(asyncio.TimeoutError): -- async with timeout(0, loop=loop) as cm: -- await asyncio.sleep(10, loop=loop) -+ async with timeout(0) as cm: -+ await asyncio.sleep(10) - assert cm.expired - - --async def test_async_zero_coro_not_started(loop): -+@pytest.mark.asyncio -+async def test_async_zero_coro_not_started(): - coro_started = False - - async def coro(): -@@ -35,8 +37,8 @@ async def test_async_zero_coro_not_started(loop): - coro_started = True - - with pytest.raises(asyncio.TimeoutError): -- async with timeout(0, loop=loop) as cm: -- await asyncio.sleep(0, loop=loop) -+ async with timeout(0) as cm: -+ await asyncio.sleep(0) - await coro() - - assert cm.expired -diff --git a/tests/test_timeout.py b/tests/test_timeout.py -index 8915546..b1cb3c7 100644 ---- a/tests/test_timeout.py -+++ b/tests/test_timeout.py -@@ -6,89 +6,69 @@ import pytest - - from async_timeout import timeout - --from asyncio import ensure_future -- -- --def create_future(loop): -- """Compatibility wrapper for the loop.create_future() call introduced in -- 3.5.2.""" -- if hasattr(loop, 'create_future'): -- return loop.create_future() -- else: -- return asyncio.Future(loop=loop) -- - - @pytest.mark.asyncio --async def test_timeout(loop): -+async def test_timeout(): - canceled_raised = False - - async def long_running_task(): - try: -- await asyncio.sleep(10, loop=loop) -+ await asyncio.sleep(10) - except asyncio.CancelledError: - nonlocal canceled_raised - canceled_raised = True - raise - - with pytest.raises(asyncio.TimeoutError): -- with timeout(0.01, loop=loop) as t: -+ with timeout(0.01) as t: - await long_running_task() -- assert t._loop is loop -+ assert t._loop is asyncio.get_event_loop() - assert canceled_raised, 'CancelledError was not raised' - - - @pytest.mark.asyncio --async def test_timeout_finish_in_time(loop): -+async def test_timeout_finish_in_time(): - async def long_running_task(): -- await asyncio.sleep(0.01, loop=loop) -+ await asyncio.sleep(0.01) - return 'done' - -- with timeout(0.1, loop=loop): -+ with timeout(0.1): - resp = await long_running_task() - assert resp == 'done' - - --def test_timeout_global_loop(loop): -- asyncio.set_event_loop(loop) -- -- async def run(): -- with timeout(10) as t: -- await asyncio.sleep(0.01) -- assert t._loop is loop -- -- loop.run_until_complete(run()) -- -- - @pytest.mark.asyncio --async def test_timeout_disable(loop): -+async def test_timeout_disable(): - async def long_running_task(): -- await asyncio.sleep(0.1, loop=loop) -+ await asyncio.sleep(0.1) - return 'done' - -+ loop = asyncio.get_event_loop() - t0 = loop.time() -- with timeout(None, loop=loop): -+ with timeout(None): - resp = await long_running_task() - assert resp == 'done' - dt = loop.time() - t0 - assert 0.09 < dt < 0.13, dt - - --def test_timeout_is_none_no_task(loop): -+def test_timeout_is_none_no_task(): -+ loop = asyncio.get_event_loop() - with timeout(None, loop=loop) as cm: - assert cm._task is None - - - @pytest.mark.asyncio --async def test_timeout_enable_zero(loop): -+async def test_timeout_enable_zero(): - with pytest.raises(asyncio.TimeoutError): -- with timeout(0, loop=loop) as cm: -- await asyncio.sleep(0.1, loop=loop) -+ with timeout(0) as cm: -+ await asyncio.sleep(0.1) - - assert cm.expired - - - @pytest.mark.asyncio --async def test_timeout_enable_zero_coro_not_started(loop): -+async def test_timeout_enable_zero_coro_not_started(): - coro_started = False - - async def coro(): -@@ -96,8 +76,8 @@ async def test_timeout_enable_zero_coro_not_started(loop): - coro_started = True - - with pytest.raises(asyncio.TimeoutError): -- with timeout(0, loop=loop) as cm: -- await asyncio.sleep(0, loop=loop) -+ with timeout(0) as cm: -+ await asyncio.sleep(0) - await coro() - - assert cm.expired -@@ -105,51 +85,52 @@ async def test_timeout_enable_zero_coro_not_started(loop): - - - @pytest.mark.asyncio --async def test_timeout_not_relevant_exception(loop): -- await asyncio.sleep(0, loop=loop) -+async def test_timeout_not_relevant_exception(): -+ await asyncio.sleep(0) - with pytest.raises(KeyError): -- with timeout(0.1, loop=loop): -+ with timeout(0.1): - raise KeyError - - - @pytest.mark.asyncio --async def test_timeout_canceled_error_is_not_converted_to_timeout(loop): -- await asyncio.sleep(0, loop=loop) -+async def test_timeout_canceled_error_is_not_converted_to_timeout(): -+ await asyncio.sleep(0) - with pytest.raises(asyncio.CancelledError): -- with timeout(0.001, loop=loop): -+ with timeout(0.001): - raise asyncio.CancelledError - - - @pytest.mark.asyncio --async def test_timeout_blocking_loop(loop): -+async def test_timeout_blocking_loop(): - async def long_running_task(): - time.sleep(0.1) - return 'done' - -- with timeout(0.01, loop=loop): -+ with timeout(0.01): - result = await long_running_task() - assert result == 'done' - - - @pytest.mark.asyncio --async def test_for_race_conditions(loop): -- fut = create_future(loop) -+async def test_for_race_conditions(): -+ loop = asyncio.get_event_loop() -+ fut = loop.create_future() - loop.call_later(0.1, fut.set_result('done')) -- with timeout(0.2, loop=loop): -+ with timeout(0.2): - resp = await fut - assert resp == 'done' - - - @pytest.mark.asyncio --async def test_timeout_time(loop): -+async def test_timeout_time(): - foo_running = None -- -+ loop = asyncio.get_event_loop() - start = loop.time() - with pytest.raises(asyncio.TimeoutError): -- with timeout(0.1, loop=loop): -+ with timeout(0.1): - foo_running = True - try: -- await asyncio.sleep(0.2, loop=loop) -+ await asyncio.sleep(0.2) - finally: - foo_running = False - -@@ -160,26 +141,26 @@ async def test_timeout_time(loop): - assert not foo_running - - --def test_raise_runtimeerror_if_no_task(loop): -+def test_raise_runtimeerror_if_no_task(): - with pytest.raises(RuntimeError): -- with timeout(0.1, loop=loop): -+ with timeout(0.1): - pass - - - @pytest.mark.asyncio --async def test_outer_coro_is_not_cancelled(loop): -+async def test_outer_coro_is_not_cancelled(): - - has_timeout = False - - async def outer(): - nonlocal has_timeout - try: -- with timeout(0.001, loop=loop): -- await asyncio.sleep(1, loop=loop) -+ with timeout(0.001): -+ await asyncio.sleep(1) - except asyncio.TimeoutError: - has_timeout = True - -- task = ensure_future(outer(), loop=loop) -+ task = asyncio.ensure_future(outer()) - await task - assert has_timeout - assert not task.cancelled() -@@ -187,14 +168,15 @@ async def test_outer_coro_is_not_cancelled(loop): - - - @pytest.mark.asyncio --async def test_cancel_outer_coro(loop): -- fut = create_future(loop) -+async def test_cancel_outer_coro(): -+ loop = asyncio.get_event_loop() -+ fut = loop.create_future() - - async def outer(): - fut.set_result(None) -- await asyncio.sleep(1, loop=loop) -+ await asyncio.sleep(1) - -- task = ensure_future(outer(), loop=loop) -+ task = asyncio.ensure_future(outer()) - await fut - task.cancel() - with pytest.raises(asyncio.CancelledError): -@@ -204,57 +186,64 @@ async def test_cancel_outer_coro(loop): - - - @pytest.mark.asyncio --async def test_timeout_suppress_exception_chain(loop): -+async def test_timeout_suppress_exception_chain(): - with pytest.raises(asyncio.TimeoutError) as ctx: -- with timeout(0.01, loop=loop): -- await asyncio.sleep(10, loop=loop) -+ with timeout(0.01): -+ await asyncio.sleep(10) - assert not ctx.value.__suppress_context__ - - - @pytest.mark.asyncio --async def test_timeout_expired(loop): -+async def test_timeout_expired(): - with pytest.raises(asyncio.TimeoutError): -- with timeout(0.01, loop=loop) as cm: -- await asyncio.sleep(10, loop=loop) -+ with timeout(0.01) as cm: -+ await asyncio.sleep(10) - assert cm.expired - - - @pytest.mark.asyncio --async def test_timeout_inner_timeout_error(loop): -+async def test_timeout_inner_timeout_error(): - with pytest.raises(asyncio.TimeoutError): -- with timeout(0.01, loop=loop) as cm: -+ with timeout(0.01) as cm: - raise asyncio.TimeoutError - assert not cm.expired - - - @pytest.mark.asyncio --async def test_timeout_inner_other_error(loop): -+async def test_timeout_inner_other_error(): - with pytest.raises(RuntimeError): -- with timeout(0.01, loop=loop) as cm: -+ with timeout(0.01) as cm: - raise RuntimeError - assert not cm.expired - - - @pytest.mark.asyncio --async def test_timeout_remaining(loop): -- with timeout(None, loop=loop) as cm: -+async def test_timeout_remaining(): -+ with timeout(None) as cm: - assert cm.remaining is None -+ assert cm.remaining is None -+ -+ t = timeout(None) -+ assert t.remaining is None - -- t = timeout(1.0, loop=loop) -+ t = timeout(1.0) - assert t.remaining is None - -- with timeout(1.0, loop=loop) as cm: -- await asyncio.sleep(0.1, loop=loop) -+ with timeout(1.0) as cm: -+ await asyncio.sleep(0.1) - assert cm.remaining < 1.0 -+ r = cm.remaining -+ time.sleep(0.1) -+ assert abs(r - cm.remaining) < 1.0 - - with pytest.raises(asyncio.TimeoutError): -- with timeout(0.1, loop=loop) as cm: -- await asyncio.sleep(0.5, loop=loop) -+ with timeout(0.1) as cm: -+ await asyncio.sleep(0.5) - - assert cm.remaining == 0.0 - - --def test_cancel_without_starting(loop): -- tm = timeout(1, loop=loop) -+def test_cancel_without_starting(): -+ tm = timeout(1) - tm._cancel_task() - tm._cancel_task() # double call should success |