Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT Remove wrapt dependency #1973

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ wrapt==1.15.0
# via
# aiobotocore
# deprecated
# flytekit
# tensorflow
yarl==1.9.2
# via aiohttp
Expand Down
1 change: 0 additions & 1 deletion doc-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,6 @@ wrapt==1.15.0
# aiobotocore
# astroid
# deprecated
# flytekit
# pandera
# tensorflow
xarray==2023.8.0
Expand Down
21 changes: 17 additions & 4 deletions flytekit/exceptions/scopes.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,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=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ wrapt==1.15.0
# via
# aiobotocore
# deprecated
# flytekit
yarl==1.9.2
# via aiohttp
zipp==3.16.2
Expand Down
Loading