polyapi-python 0.3.8.dev4__py3-none-any.whl → 0.3.8.dev5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- polyapi/client.py +4 -4
- {polyapi_python-0.3.8.dev4.dist-info → polyapi_python-0.3.8.dev5.dist-info}/METADATA +1 -1
- {polyapi_python-0.3.8.dev4.dist-info → polyapi_python-0.3.8.dev5.dist-info}/RECORD +6 -6
- {polyapi_python-0.3.8.dev4.dist-info → polyapi_python-0.3.8.dev5.dist-info}/WHEEL +0 -0
- {polyapi_python-0.3.8.dev4.dist-info → polyapi_python-0.3.8.dev5.dist-info}/licenses/LICENSE +0 -0
- {polyapi_python-0.3.8.dev4.dist-info → polyapi_python-0.3.8.dev5.dist-info}/top_level.txt +0 -0
polyapi/client.py
CHANGED
|
@@ -10,7 +10,7 @@ from typing import List, Dict, Any, TypedDict
|
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
def _wrap_code_in_try_except(code: str) -> str:
|
|
13
|
+
def _wrap_code_in_try_except(function_name: str, code: str) -> str:
|
|
14
14
|
""" this is necessary because client functions with imports will blow up ALL server functions,
|
|
15
15
|
even if they don't use them.
|
|
16
16
|
because the server function will try to load all client functions when loading the library
|
|
@@ -18,8 +18,8 @@ def _wrap_code_in_try_except(code: str) -> str:
|
|
|
18
18
|
prefix = """logger = logging.getLogger("poly")
|
|
19
19
|
try:
|
|
20
20
|
"""
|
|
21
|
-
suffix = """except ImportError as e:
|
|
22
|
-
logger.
|
|
21
|
+
suffix = f"""except ImportError as e:
|
|
22
|
+
logger.warning("Failed to import client function '{function_name}', function unavailable: " + str(e))"""
|
|
23
23
|
|
|
24
24
|
lines = code.split("\n")
|
|
25
25
|
code = "\n ".join(lines)
|
|
@@ -39,6 +39,6 @@ def render_client_function(
|
|
|
39
39
|
return_type_def=return_type_def,
|
|
40
40
|
)
|
|
41
41
|
|
|
42
|
-
code = _wrap_code_in_try_except(code)
|
|
42
|
+
code = _wrap_code_in_try_except(function_name, code)
|
|
43
43
|
|
|
44
44
|
return code + "\n\n", func_type_defs
|
|
@@ -3,7 +3,7 @@ polyapi/__main__.py,sha256=V4zhAh_YGxno5f_KSrlkELxcuDh9bR3WSd0n-2r-qQQ,93
|
|
|
3
3
|
polyapi/api.py,sha256=2nds6ZdNe9OHvCba4IjOPga0CAYIsib2SbhEyDDCmd8,2188
|
|
4
4
|
polyapi/auth.py,sha256=zrIGatjba5GwUTNjKj1GHQWTEDP9B-HrSzCKbLFoqvc,5336
|
|
5
5
|
polyapi/cli.py,sha256=NcLXOUdkcXgsFboO5PXwncK4uzGLu1mIXJDUn5NUgKo,10192
|
|
6
|
-
polyapi/client.py,sha256=
|
|
6
|
+
polyapi/client.py,sha256=DW6ljG_xCwAo2yz23A9QfLooE6ZUDvSpdA4e_dCQjiQ,1418
|
|
7
7
|
polyapi/config.py,sha256=cAMv2n9tGN_BTvqt7V32o5F86qRhxAKyey_PoId2D8s,7638
|
|
8
8
|
polyapi/constants.py,sha256=sc-FnS0SngBLvSu1ZWMs0UCf9EYD1u1Yhfr-sZXGLns,607
|
|
9
9
|
polyapi/deployables.py,sha256=KjVAillK3OMNpT2F5KzmAefoTSmhDN0ZIwzEMXPCRU0,12261
|
|
@@ -24,8 +24,8 @@ polyapi/typedefs.py,sha256=MGDwWaijLNqokXF9UCHGAP-yKixOzztrH4Lsj800AJs,2328
|
|
|
24
24
|
polyapi/utils.py,sha256=1F7Dwst_PbPuUBUSxx5r8d2DHDgqHtu07QW92T_YSdw,12454
|
|
25
25
|
polyapi/variables.py,sha256=j7WWrGLr2O5SkWGxnsusnnfl25kVL3b6SQYcVGEoC8c,4277
|
|
26
26
|
polyapi/webhook.py,sha256=NTSXYOl_QqsFekWRepPyVTsV9SVkgUu0HfG1SJJDHOE,4958
|
|
27
|
-
polyapi_python-0.3.8.
|
|
28
|
-
polyapi_python-0.3.8.
|
|
29
|
-
polyapi_python-0.3.8.
|
|
30
|
-
polyapi_python-0.3.8.
|
|
31
|
-
polyapi_python-0.3.8.
|
|
27
|
+
polyapi_python-0.3.8.dev5.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
|
|
28
|
+
polyapi_python-0.3.8.dev5.dist-info/METADATA,sha256=3m0BmPbTE504NOJ1A0fl-ueXzgUlu1Oj03XDw8egBFQ,5782
|
|
29
|
+
polyapi_python-0.3.8.dev5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
30
|
+
polyapi_python-0.3.8.dev5.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
|
|
31
|
+
polyapi_python-0.3.8.dev5.dist-info/RECORD,,
|
|
File without changes
|
{polyapi_python-0.3.8.dev4.dist-info → polyapi_python-0.3.8.dev5.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|