From 1b6fe9bd84aa955a84c9776adb4aec2b52500e4a Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 24 Jul 2024 15:35:46 -0700 Subject: [PATCH 1/3] Remove sync compat setting --- docs/3.0rc/api-ref/rest-api/server/schema.json | 5 ----- src/prefect/settings.py | 5 ----- src/prefect/utilities/asyncutils.py | 5 +---- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/docs/3.0rc/api-ref/rest-api/server/schema.json b/docs/3.0rc/api-ref/rest-api/server/schema.json index 855c4413560f..afa2a117f84e 100644 --- a/docs/3.0rc/api-ref/rest-api/server/schema.json +++ b/docs/3.0rc/api-ref/rest-api/server/schema.json @@ -22381,11 +22381,6 @@ "title": "Prefect Task Scheduling Pending Task Timeout", "default": "PT0S" }, - "PREFECT_EXPERIMENTAL_DISABLE_SYNC_COMPAT": { - "type": "boolean", - "title": "Prefect Experimental Disable Sync Compat", - "default": false - }, "PREFECT_EXPERIMENTAL_ENABLE_SCHEDULE_CONCURRENCY": { "type": "boolean", "title": "Prefect Experimental Enable Schedule Concurrency", diff --git a/src/prefect/settings.py b/src/prefect/settings.py index c7d133909dc7..4a5653f8ddc5 100644 --- a/src/prefect/settings.py +++ b/src/prefect/settings.py @@ -1438,11 +1438,6 @@ def default_cloud_ui_url(settings, value): PENDING for a while is a sign that the task worker may have crashed. """ -PREFECT_EXPERIMENTAL_DISABLE_SYNC_COMPAT = Setting(bool, default=False) -""" -Whether or not to disable the sync_compatible decorator utility. -""" - PREFECT_EXPERIMENTAL_ENABLE_SCHEDULE_CONCURRENCY = Setting(bool, default=False) # Defaults ----------------------------------------------------------------------------- diff --git a/src/prefect/utilities/asyncutils.py b/src/prefect/utilities/asyncutils.py index 99aa5cfd5b3e..5832fd3440aa 100644 --- a/src/prefect/utilities/asyncutils.py +++ b/src/prefect/utilities/asyncutils.py @@ -354,11 +354,8 @@ def coroutine_wrapper( *args: Any, _sync: Optional[bool] = None, **kwargs: Any ) -> Union[R, Coroutine[Any, Any, R]]: from prefect.context import MissingContextError, get_run_context - from prefect.settings import ( - PREFECT_EXPERIMENTAL_DISABLE_SYNC_COMPAT, - ) - if PREFECT_EXPERIMENTAL_DISABLE_SYNC_COMPAT or _sync is False: + if _sync is False: return async_fn(*args, **kwargs) is_async = True From 73eb448f7d84a8a552b1ebb3d7963ec6121a64be Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 24 Jul 2024 15:57:36 -0700 Subject: [PATCH 2/3] Remove extra entrypoints --- docs/3.0rc/api-ref/rest-api/server/schema.json | 5 ----- src/prefect/settings.py | 12 ------------ 2 files changed, 17 deletions(-) diff --git a/docs/3.0rc/api-ref/rest-api/server/schema.json b/docs/3.0rc/api-ref/rest-api/server/schema.json index afa2a117f84e..6434d946620e 100644 --- a/docs/3.0rc/api-ref/rest-api/server/schema.json +++ b/docs/3.0rc/api-ref/rest-api/server/schema.json @@ -21688,11 +21688,6 @@ "title": "Prefect Home", "default": "~/.prefect" }, - "PREFECT_EXTRA_ENTRYPOINTS": { - "type": "string", - "title": "Prefect Extra Entrypoints", - "default": "" - }, "PREFECT_DEBUG_MODE": { "type": "boolean", "title": "Prefect Debug Mode", diff --git a/src/prefect/settings.py b/src/prefect/settings.py index 4a5653f8ddc5..11d36a85ad0f 100644 --- a/src/prefect/settings.py +++ b/src/prefect/settings.py @@ -481,18 +481,6 @@ def default_cloud_ui_url(settings, value): directory may be created automatically when required. """ -PREFECT_EXTRA_ENTRYPOINTS = Setting( - str, - default="", -) -""" -Modules for Prefect to import when Prefect is imported. - -Values should be separated by commas, e.g. `my_module,my_other_module`. -Objects within modules may be specified by a ':' partition, e.g. `my_module:my_object`. -If a callable object is provided, it will be called with no arguments on import. -""" - PREFECT_DEBUG_MODE = Setting( bool, default=False, From 68e0759fbe25bf541221bb121248a5bebd0fe684 Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 24 Jul 2024 16:10:35 -0700 Subject: [PATCH 3/3] Remove test for stale setting --- tests/utilities/test_asyncutils.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/utilities/test_asyncutils.py b/tests/utilities/test_asyncutils.py index 26a7046e94a4..a331eacdb37f 100644 --- a/tests/utilities/test_asyncutils.py +++ b/tests/utilities/test_asyncutils.py @@ -1,5 +1,4 @@ import asyncio -import inspect import threading import uuid from contextlib import asynccontextmanager, contextmanager @@ -11,10 +10,6 @@ from prefect._internal.concurrency.threads import get_run_sync_loop from prefect.context import ContextModel -from prefect.settings import ( - PREFECT_EXPERIMENTAL_DISABLE_SYNC_COMPAT, - temporary_settings, -) from prefect.utilities.asyncutils import ( GatherIncomplete, LazySemaphore, @@ -223,12 +218,6 @@ async def test_sync_compatible_call_from_async(fn): assert await fn(1, y=2) == 6 -@pytest.mark.parametrize("fn", SYNC_COMPAT_TEST_CASES) -def test_sync_compatible_is_disabled_by_flag(fn): - with temporary_settings({PREFECT_EXPERIMENTAL_DISABLE_SYNC_COMPAT: True}): - assert inspect.isawaitable(fn(1, y=2)) - - async def test_sync_compatible_call_from_sync_in_async_thread(): # Here we are in the async main thread