]> git.ipfire.org Git - thirdparty/starlette.git/commitdiff
Deprecate run_until_first_complete (#1443)
authorMarcelo Trylesinski <marcelotryle@gmail.com>
Mon, 14 Feb 2022 15:41:58 +0000 (12:41 -0300)
committerGitHub <noreply@github.com>
Mon, 14 Feb 2022 15:41:58 +0000 (15:41 +0000)
Co-authored-by: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
setup.cfg
starlette/concurrency.py

index 9f9c7b4eb679aee215c61d2dbc4749e7161cc8ba..f1a5c9929ef6a27a8b784fd6d64230e32f2f5a73 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -29,6 +29,7 @@ filterwarnings=
     ignore: The 'variables' alias has been deprecated. Please use 'variable_values' instead\.:DeprecationWarning
     # Workaround for Python 3.9.7 (see https://bugs.python.org/issue45097)
     ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10\.:DeprecationWarning:asyncio
+    ignore: run_until_first_complete is deprecated and will be removed in a future version.:DeprecationWarning
     ignore: starlette\.middleware\.wsgi is deprecated and will be removed in a future release\.*:DeprecationWarning
 
 [coverage:run]
index ac2ce6eb735994a1017634a81a053480fce47586..5c76cb3df7c58d0ef5829bfd166bb7b29018e1c9 100644 (file)
@@ -1,6 +1,7 @@
 import functools
 import sys
 import typing
+import warnings
 
 import anyio
 
@@ -15,6 +16,12 @@ P = ParamSpec("P")
 
 
 async def run_until_first_complete(*args: typing.Tuple[typing.Callable, dict]) -> None:
+    warnings.warn(
+        "run_until_first_complete is deprecated "
+        "and will be removed in a future version.",
+        DeprecationWarning,
+    )
+
     async with anyio.create_task_group() as task_group:
 
         async def run(func: typing.Callable[[], typing.Coroutine]) -> None: