From 590b9b7b03bf4651e099949e318755af7cfa81b8 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 1 Aug 2021 22:03:23 +0100 Subject: gentoo resync : 01.08.2021 --- dev-python/asgiref/Manifest | 7 +- dev-python/asgiref/asgiref-3.3.4.ebuild | 32 --- dev-python/asgiref/asgiref-3.4.0.ebuild | 27 --- dev-python/asgiref/asgiref-3.4.1.ebuild | 2 +- .../files/asgiref-3.3.4-py310-warnings.patch | 235 --------------------- 5 files changed, 2 insertions(+), 301 deletions(-) delete mode 100644 dev-python/asgiref/asgiref-3.3.4.ebuild delete mode 100644 dev-python/asgiref/asgiref-3.4.0.ebuild delete mode 100644 dev-python/asgiref/files/asgiref-3.3.4-py310-warnings.patch (limited to 'dev-python/asgiref') diff --git a/dev-python/asgiref/Manifest b/dev-python/asgiref/Manifest index 034e1a92f16a..96f682b5867b 100644 --- a/dev-python/asgiref/Manifest +++ b/dev-python/asgiref/Manifest @@ -1,8 +1,3 @@ -AUX asgiref-3.3.4-py310-warnings.patch 8869 BLAKE2B 9690124277e49c87fe5d72965407f50b3826d5e26e9f81c4a5f25b88872f2d133f656d5e63dbe7b6503e9242912d7d0ed1d19d9b38640dcced8b709edadd5309 SHA512 53de4ba34d212ff4e750764a790d8e5ed9fae5fb78f4e278820680bc8fa7028e6f2658d16cf9826790b49d185ffbf360f8fe539f3ed5d03907eab114cc258174 -DIST asgiref-3.3.4.tar.gz 30780 BLAKE2B f14a5ae3cc3d0c67a827b4b8d002c9d92388285f7388b7ac439b11fbe2e72b6dee5a9c38637e6b5189e3a3625d24a806b5aeff1ffc41861fd4947d7b7c4621ba SHA512 e224ce82f9156e3efde316f3e209a9fbb9494cb9347d6652e19ed130921143de8d3e2a45f50352bf13fcdf229c291e68a0348fff31de144e58cd1a53b4eb0c31 -DIST asgiref-3.4.0.tar.gz 32396 BLAKE2B bbf80c4f5bfc7eaf2f27896913a59f522643de35a5eac45807b88f0b2deef6acef408a6d3abb939c4653554415028b5eea68e99ee45247e384848c554ab61c7c SHA512 259dd6fafcd4db73554a4bd26f6000b33c61e8e4d42294bc22826bc95e89959bcc3f9f97d8f0b5dc7e0cf8420890ea8ab368232b4046254e8c91ad010f6509c0 DIST asgiref-3.4.1.tar.gz 32529 BLAKE2B 4b5f3b33e165468d71711cf28a5a6161866cd7495140cb67ff028aba5a2586414783d2fa7ce744e99e269714d9d64a019a67c852fd4546ba1f71625473010b9f SHA512 af266fc3eac58c21f2ab3f66e522067388f9cf232b17344fb5afbc408c034e61a1cce02362ec5dc494985beef099800f75cf7de28dc057c45e4bcb973b0a6dbe -EBUILD asgiref-3.3.4.ebuild 813 BLAKE2B d3734b2e613038bc04c49562c75695a1affb024cb3db63a7632e615b2942bb4698f6d25616df76489c4163bc8088396731229895c37601c741ece1490a883174 SHA512 e394d35e7ca25e84395fc20c6a7b998d076e3268319991cbe9116b059d9bd969c220fbd2fa107d0846b7a4935b36082964105482912746ea4d6b0c3d118eb3bf -EBUILD asgiref-3.4.0.ebuild 698 BLAKE2B f04dd652264530179490857aef42e3af9a8d4f14a7976602c77f8e99af47d84ceb3a57981db64aa29a519e85beae4535aea99e475a4b82124b98d35457998fbd SHA512 3d11e79046a7ea4e9ff0ff4cd4816d19634cfafb6fc4b18a7305ae9befb672fab0d996da1905e6c721d5c0bd570669d7759df36041fc77c9c50cdabedd2e00b8 -EBUILD asgiref-3.4.1.ebuild 698 BLAKE2B 1a4ef749ea4481e64d8c87eb8f5cb51fb2e875fd8f5108f02472c1bf344385011073a22bb4f5175069b48546562b5a6a19a798045d5341062a98fef08d98ebed SHA512 48a91d936af1299747d53535ba24406c9c5d42865d45fc30a71d82e1d863c5add0e5d1e21e42a3994a827351caf72d55ebaf40b6be1d896bd098b4ffdd367aff +EBUILD asgiref-3.4.1.ebuild 691 BLAKE2B 760dfe213ac9e17eaa8878640350414e140d368007a7ca4b12ad5eb321bb21ccf92cf9d2db1e4e300d9cf9a1ef66a3bae40f95763b688a551379f7aea76b7b60 SHA512 23639dccacd3fd63e5c519e180b09ab8eb02117b5653efb5da9893eb5f40e2add7780c80bd55abbeff0f751512e12c246bf07636e75557d275c34122bc4e8212 MISC metadata.xml 388 BLAKE2B eb8c329aa8d5220d66dd380ad7c4bb4fe539b3fb5b854e9a6b4912d2212b6ffa74d7f9331c5ec575bfd53407d016b464efb06c3f94c4088dd729f646b5d528ab SHA512 45d74c331619ea754ed36e7a2e9eee1687be49cf698ed7d9e89c8cb006b40001be93a8fc753830dbbba12a5ca61d3407aaa364aff3354708ae79cbb72cba6a20 diff --git a/dev-python/asgiref/asgiref-3.3.4.ebuild b/dev-python/asgiref/asgiref-3.3.4.ebuild deleted file mode 100644 index 30ca06005aa0..000000000000 --- a/dev-python/asgiref/asgiref-3.3.4.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2020-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7..10} pypy3 ) -inherit distutils-r1 - -DESCRIPTION="ASGI utilities (successor to WSGI)" -HOMEPAGE=" - https://asgi.readthedocs.io/en/latest/ - https://github.com/django/asgiref/ - https://pypi.org/project/asgiref/" -SRC_URI="mirror://pypi/${PN::1}/${PN}/${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~riscv sparc x86" - -RDEPEND=" - $(python_gen_cond_dep ' - dev-python/typing-extensions[${PYTHON_USEDEP}] - ' python3_7 pypy3)" -BDEPEND=" - test? ( dev-python/pytest-asyncio[${PYTHON_USEDEP}] )" - -PATCHES=( - # Provided to upstream: https://github.com/django/asgiref/pull/262 - "${FILESDIR}/${P}-py310-warnings.patch" -) - -distutils_enable_tests pytest diff --git a/dev-python/asgiref/asgiref-3.4.0.ebuild b/dev-python/asgiref/asgiref-3.4.0.ebuild deleted file mode 100644 index d0582cfb5185..000000000000 --- a/dev-python/asgiref/asgiref-3.4.0.ebuild +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2020-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 - -DESCRIPTION="ASGI utilities (successor to WSGI)" -HOMEPAGE=" - https://asgi.readthedocs.io/en/latest/ - https://github.com/django/asgiref/ - https://pypi.org/project/asgiref/" -SRC_URI="mirror://pypi/${PN::1}/${PN}/${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86" - -RDEPEND=" - $(python_gen_cond_dep ' - dev-python/typing-extensions[${PYTHON_USEDEP}] - ' python3_7 pypy3)" -BDEPEND=" - test? ( dev-python/pytest-asyncio[${PYTHON_USEDEP}] )" - -distutils_enable_tests pytest diff --git a/dev-python/asgiref/asgiref-3.4.1.ebuild b/dev-python/asgiref/asgiref-3.4.1.ebuild index 29fe309588a5..7b6c812c573a 100644 --- a/dev-python/asgiref/asgiref-3.4.1.ebuild +++ b/dev-python/asgiref/asgiref-3.4.1.ebuild @@ -15,7 +15,7 @@ SRC_URI="mirror://pypi/${PN::1}/${PN}/${P}.tar.gz" LICENSE="BSD" SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86" +KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ppc ppc64 ~riscv sparc x86" RDEPEND=" $(python_gen_cond_dep ' diff --git a/dev-python/asgiref/files/asgiref-3.3.4-py310-warnings.patch b/dev-python/asgiref/files/asgiref-3.3.4-py310-warnings.patch deleted file mode 100644 index 1cd017ddfbde..000000000000 --- a/dev-python/asgiref/files/asgiref-3.3.4-py310-warnings.patch +++ /dev/null @@ -1,235 +0,0 @@ -From 0c9e989f18b99ea24a1fb3ea2c8a66fd295c2178 Mon Sep 17 00:00:00 2001 -From: Ekaterina Vaartis -Date: Thu, 20 May 2021 19:44:15 +0300 -Subject: [PATCH] Fix deprecation warnings for python 3.10 - -asyncio.get_event_loop was marked as deprecated, the documnetation -now refers to asyncio.get_running_loop([1]) - -asyncio.ensure_future issues a deprecation warning if there is no -running event loop([2]), so use asyncio.run which creates and destroys the -loop itself - -asyncio.gather issues a warning if run outside of event -loop (i.e. there is no running event loop)([3]), so wrap it into an -async def - -explicit passing of coroutine objects to asyncio.wait is deprecated -since 3.8([4]), so wrap them in asyncio.create_task - -plus, add 3.10 to tox.ini - -[1]: https://docs.python.org/3.10/library/asyncio-eventloop.html#asyncio.get_event_loop -[2]: https://docs.python.org/3.10/library/asyncio-future.html#asyncio.ensure_future -[3]: https://docs.python.org/3.10/library/asyncio-task.html#asyncio.gather -[4]: https://docs.python.org/3.10/library/asyncio-task.html#asyncio.wait ---- - asgiref/compatibility.py | 14 ++++++++++++++ - asgiref/server.py | 8 ++++---- - asgiref/sync.py | 15 ++++++++++----- - tests/test_sync.py | 19 ++++++++++++++----- - tests/test_sync_contextvars.py | 3 ++- - tox.ini | 2 +- - 6 files changed, 45 insertions(+), 16 deletions(-) - -diff --git a/asgiref/compatibility.py b/asgiref/compatibility.py -index eccaee0..614b2e6 100644 ---- a/asgiref/compatibility.py -+++ b/asgiref/compatibility.py -@@ -1,5 +1,6 @@ - import asyncio - import inspect -+import sys - - - def is_double_callable(application): -@@ -45,3 +46,16 @@ def guarantee_single_callable(application): - if is_double_callable(application): - application = double_to_single_callable(application) - return application -+ -+ -+if sys.version_info >= (3, 7): -+ # these were introduced in 3.7 -+ get_running_loop = asyncio.get_running_loop -+ run_future = asyncio.run -+ create_task = asyncio.create_task -+else: -+ # marked as deprecated in 3.10, did not exist before 3.7 -+ get_running_loop = asyncio.get_event_loop -+ run_future = asyncio.ensure_future -+ # does nothing, this is fine for <3.7 -+ create_task = lambda task: task -diff --git a/asgiref/server.py b/asgiref/server.py -index f975f78..fb1c394 100644 ---- a/asgiref/server.py -+++ b/asgiref/server.py -@@ -3,7 +3,7 @@ import logging - import time - import traceback - --from .compatibility import guarantee_single_callable -+from .compatibility import get_running_loop, guarantee_single_callable, run_future - - logger = logging.getLogger(__name__) - -@@ -56,7 +56,7 @@ class StatelessServer: - """ - Runs the asyncio event loop with our handler loop. - """ -- event_loop = asyncio.get_event_loop() -+ event_loop = get_running_loop() - asyncio.ensure_future(self.application_checker()) - try: - event_loop.run_until_complete(self.handle()) -@@ -88,12 +88,12 @@ class StatelessServer: - input_queue = asyncio.Queue() - application_instance = guarantee_single_callable(self.application) - # Run it, and stash the future for later checking -- future = asyncio.ensure_future( -+ future = run_future( - application_instance( - scope=scope, - receive=input_queue.get, - send=lambda message: self.application_send(scope, message), -- ) -+ ), - ) - self.application_instances[scope_id] = { - "input_queue": input_queue, -diff --git a/asgiref/sync.py b/asgiref/sync.py -index 6b87c7e..9476e66 100644 ---- a/asgiref/sync.py -+++ b/asgiref/sync.py -@@ -9,6 +9,7 @@ import weakref - from concurrent.futures import Future, ThreadPoolExecutor - from typing import Any, Callable, Dict, Optional, Union - -+from .compatibility import get_running_loop - from .current_thread_executor import CurrentThreadExecutor - from .local import Local - -@@ -132,7 +133,7 @@ class AsyncToSync: - self.main_event_loop = None - else: - try: -- self.main_event_loop = asyncio.get_event_loop() -+ self.main_event_loop = get_running_loop() - except RuntimeError: - # There's no event loop in this thread. Look for the threadlocal if - # we're inside SyncToAsync -@@ -151,7 +152,7 @@ class AsyncToSync: - def __call__(self, *args, **kwargs): - # You can't call AsyncToSync from a thread with a running event loop - try: -- event_loop = asyncio.get_event_loop() -+ event_loop = get_running_loop() - except RuntimeError: - pass - else: -@@ -238,7 +239,11 @@ class AsyncToSync: - tasks = asyncio.Task.all_tasks(loop) - for task in tasks: - task.cancel() -- loop.run_until_complete(asyncio.gather(*tasks, return_exceptions=True)) -+ -+ async def gather(): -+ await asyncio.gather(*tasks, return_exceptions=True) -+ -+ loop.run_until_complete(gather()) - for task in tasks: - if task.cancelled(): - continue -@@ -320,7 +325,7 @@ class SyncToAsync: - - # If they've set ASGI_THREADS, update the default asyncio executor for now - if "ASGI_THREADS" in os.environ: -- loop = asyncio.get_event_loop() -+ loop = get_running_loop() - loop.set_default_executor( - ThreadPoolExecutor(max_workers=int(os.environ["ASGI_THREADS"])) - ) -@@ -370,7 +375,7 @@ class SyncToAsync: - pass - - async def __call__(self, *args, **kwargs): -- loop = asyncio.get_event_loop() -+ loop = get_running_loop() - - # Work out what thread to run the code in - if self._thread_sensitive: -diff --git a/tests/test_sync.py b/tests/test_sync.py -index cf0e0c5..8ed76a7 100644 ---- a/tests/test_sync.py -+++ b/tests/test_sync.py -@@ -9,6 +9,7 @@ from unittest import TestCase - - import pytest - -+from asgiref.compatibility import create_task, get_running_loop - from asgiref.sync import ThreadSensitiveContext, async_to_sync, sync_to_async - - -@@ -33,12 +34,17 @@ async def test_sync_to_async(): - assert result == 42 - assert end - start >= 1 - # Set workers to 1, call it twice and make sure that works right -- loop = asyncio.get_event_loop() -- old_executor = loop._default_executor -+ loop = get_running_loop() -+ old_executor = loop._default_executor or ThreadPoolExecutor() - loop.set_default_executor(ThreadPoolExecutor(max_workers=1)) - try: - start = time.monotonic() -- await asyncio.wait([async_function(), async_function()]) -+ await asyncio.wait( -+ [ -+ create_task(async_function()), -+ create_task(async_function()), -+ ] -+ ) - end = time.monotonic() - # It should take at least 2 seconds as there's only one worker. - assert end - start >= 2 -@@ -428,7 +434,7 @@ async def test_thread_sensitive_outside_async(): - result["thread"] = threading.current_thread() - - # Run it (in supposed parallel!) -- await asyncio.wait([outer(result_1), inner(result_2)]) -+ await asyncio.wait([create_task(outer(result_1)), create_task(inner(result_2))]) - - # They should not have run in the main thread, but in the same thread - assert result_1["thread"] != threading.current_thread() -@@ -449,7 +455,10 @@ async def test_thread_sensitive_with_context_matches(): - async with ThreadSensitiveContext(): - # Run it (in supposed parallel!) - await asyncio.wait( -- [store_thread_async(result_1), store_thread_async(result_2)] -+ [ -+ create_task(store_thread_async(result_1)), -+ create_task(store_thread_async(result_2)), -+ ] - ) - - await fn() -diff --git a/tests/test_sync_contextvars.py b/tests/test_sync_contextvars.py -index b1027aa..9665bf9 100644 ---- a/tests/test_sync_contextvars.py -+++ b/tests/test_sync_contextvars.py -@@ -4,6 +4,7 @@ import time - - import pytest - -+from asgiref.compatibility import create_task - from asgiref.sync import ThreadSensitiveContext, async_to_sync, sync_to_async - - contextvars = pytest.importorskip("contextvars") -@@ -25,7 +26,7 @@ async def test_thread_sensitive_with_context_different(): - await store_thread(result) - - # Run it (in true parallel!) -- await asyncio.wait([fn(result_1), fn(result_2)]) -+ await asyncio.wait([create_task(fn(result_1)), create_task(fn(result_2))]) - - # They should not have run in the main thread, and on different threads - assert result_1["thread"] != threading.current_thread() -- cgit v1.2.3