diff --git a/dev-requirements.txt b/dev-requirements.txt index 59b2aa462f..8a00c9588f 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -556,7 +556,6 @@ wheel==0.41.3 wrapt==1.15.0 # via # aiobotocore - # flytekit # tensorflow yarl==1.9.2 # via aiohttp diff --git a/doc-requirements.txt b/doc-requirements.txt index 99bc515900..5336cfe0d3 100644 --- a/doc-requirements.txt +++ b/doc-requirements.txt @@ -1434,7 +1434,6 @@ wrapt==1.15.0 # via # aiobotocore # astroid - # flytekit # pandera # tensorflow xarray==2023.8.0 diff --git a/flytekit/exceptions/scopes.py b/flytekit/exceptions/scopes.py index bdfb2ba182..f0a0f02189 100644 --- a/flytekit/exceptions/scopes.py +++ b/flytekit/exceptions/scopes.py @@ -1,8 +1,7 @@ +from functools import wraps as _wraps from sys import exc_info as _exc_info from traceback import format_tb as _format_tb -from wrapt import decorator as _decorator - from flytekit.exceptions import base as _base_exceptions from flytekit.exceptions import system as _system_exceptions from flytekit.exceptions import user as _user_exceptions @@ -134,8 +133,22 @@ def _is_base_context(): return _CONTEXT_STACK[-2] == _NULL_CONTEXT +def _decorator(outer_f): + """Decorate a function with signature func(wrapped, args, kwargs).""" + + @_wraps(outer_f) + def inner_decorator(inner_f): + @_wraps(inner_f) + def f(*args, **kwargs): + return outer_f(inner_f, args, kwargs) + + return f + + return inner_decorator + + @_decorator -def system_entry_point(wrapped, instance, args, kwargs): +def system_entry_point(wrapped, args, kwargs): """ The reason these two (see the user one below) decorators exist is to categorize non-Flyte exceptions at arbitrary locations. For example, while there is a separate ecosystem of Flyte-defined user and system exceptions @@ -178,7 +191,7 @@ def system_entry_point(wrapped, instance, args, kwargs): @_decorator -def user_entry_point(wrapped, instance, args, kwargs): +def user_entry_point(wrapped, args, kwargs): """ See the comment for the system_entry_point above as well. diff --git a/setup.py b/setup.py index 171250cef4..fc8e971670 100644 --- a/setup.py +++ b/setup.py @@ -69,7 +69,6 @@ "typing_extensions", "urllib3>=1.22,<2.0.0", "wheel>=0.30.0,<1.0.0", - "wrapt>=1.0.0,<2.0.0", ], extras_require=extras_require, scripts=[ diff --git a/tests/flytekit/integration/remote/mock_flyte_repo/workflows/requirements.txt b/tests/flytekit/integration/remote/mock_flyte_repo/workflows/requirements.txt index 2519e945f0..08cc149161 100644 --- a/tests/flytekit/integration/remote/mock_flyte_repo/workflows/requirements.txt +++ b/tests/flytekit/integration/remote/mock_flyte_repo/workflows/requirements.txt @@ -348,7 +348,6 @@ wrapt==1.15.0 # via # aiobotocore # deprecated - # flytekit yarl==1.9.2 # via aiohttp zipp==3.16.2