polyapi-python 0.3.18.dev7__tar.gz → 0.3.19.dev0__tar.gz
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_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/PKG-INFO +1 -1
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/cli.py +6 -4
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/function_cli.py +16 -7
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/PKG-INFO +1 -1
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/pyproject.toml +1 -1
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/LICENSE +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/README.md +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/__init__.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/__main__.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/api.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/auth.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/cli_constants.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/client.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/config.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/constants.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/deployables.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/error_handler.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/exceptions.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/execute.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/generate.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/http_client.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/parser.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/poly_schemas.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/poly_tables.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/prepare.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/py.typed +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/rendered_spec.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/schema.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/server.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/sync.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/typedefs.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/utils.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/variables.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi/webhook.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/SOURCES.txt +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/dependency_links.txt +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/requires.txt +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/top_level.txt +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/setup.cfg +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_api.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_async_proof.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_auth.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_dependency_pins.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_deployables.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_generate.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_parser.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_poly_custom.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_poly_schemas.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_rendered_spec.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_schema.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_server.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_tabi.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_utils.py +0 -0
- {polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/tests/test_variables.py +0 -0
|
@@ -45,8 +45,8 @@ def execute_from_cli():
|
|
|
45
45
|
|
|
46
46
|
# Add global --version/-v flag
|
|
47
47
|
parser.add_argument('-v', '--version', action='version',
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
version=_get_version_string(),
|
|
49
|
+
help="Show version information")
|
|
50
50
|
|
|
51
51
|
subparsers = parser.add_subparsers(help="Available commands")
|
|
52
52
|
|
|
@@ -95,7 +95,7 @@ def execute_from_cli():
|
|
|
95
95
|
# overwrite all cached values with the values passed in from the command line
|
|
96
96
|
final_contexts = contexts
|
|
97
97
|
final_names = names
|
|
98
|
-
final_ids = ids
|
|
98
|
+
# final_ids = ids
|
|
99
99
|
final_no_types = no_types
|
|
100
100
|
|
|
101
101
|
# cache the values used for this explicit generate command
|
|
@@ -127,6 +127,7 @@ def execute_from_cli():
|
|
|
127
127
|
fn_add_parser.add_argument("--logs", choices=["enabled", "disabled"], default=None, help="Enable or disable logs for the function.")
|
|
128
128
|
fn_add_parser.add_argument("--execution-api-key", required=False, default="", help="API key for execution (for server functions only).")
|
|
129
129
|
fn_add_parser.add_argument("--skip-generate", action="store_true", help="Skip running generate after function add command, especially useful if you are deploying a bunch of functions at once. Run generate manually at the end!")
|
|
130
|
+
fn_add_parser.add_argument("--skip-toolkit-build", action="store_true", help="Skip rebuilding the toolkit after adding/updating the function")
|
|
130
131
|
fn_add_parser.add_argument("--generate-contexts", type=str, help="Server function only – only include certain contexts to speed up function execution")
|
|
131
132
|
fn_add_parser.add_argument("--visibility", type=str, default="environment", help="Specifies the visibility of a function. Options: PUBLIC, TENANT, ENVIRONMENT. Case insensitive")
|
|
132
133
|
|
|
@@ -162,7 +163,8 @@ def execute_from_cli():
|
|
|
162
163
|
generate=not args.skip_generate,
|
|
163
164
|
execution_api_key=args.execution_api_key,
|
|
164
165
|
generate_contexts=args.generate_contexts,
|
|
165
|
-
visibility=visibility
|
|
166
|
+
visibility=visibility,
|
|
167
|
+
skip_toolkit_build=args.skip_toolkit_build
|
|
166
168
|
)
|
|
167
169
|
|
|
168
170
|
fn_add_parser.set_defaults(command=add_function)
|
|
@@ -26,7 +26,8 @@ def function_add_or_update(
|
|
|
26
26
|
generate_contexts: Optional[str],
|
|
27
27
|
visibility: Optional[str],
|
|
28
28
|
generate: bool = True,
|
|
29
|
-
execution_api_key: str = ""
|
|
29
|
+
execution_api_key: str = "",
|
|
30
|
+
skip_toolkit_build: bool = False,
|
|
30
31
|
):
|
|
31
32
|
verb = "Updating" if _func_already_exists(context, name) else "Adding"
|
|
32
33
|
ftype = "server" if server else "client"
|
|
@@ -39,11 +40,12 @@ def function_add_or_update(
|
|
|
39
40
|
parsed = parse_function_code(code, name, context)
|
|
40
41
|
return_type = parsed["types"]["returns"]["type"]
|
|
41
42
|
|
|
43
|
+
if "dependencies" not in parsed:
|
|
44
|
+
parsed["dependencies"] = []
|
|
45
|
+
|
|
42
46
|
if not return_type:
|
|
43
47
|
print_red("ERROR")
|
|
44
|
-
print(
|
|
45
|
-
f"Function {name} not found as top-level function in {name}"
|
|
46
|
-
)
|
|
48
|
+
print(f"Function {name} not found as top-level function in {name}")
|
|
47
49
|
sys.exit(1)
|
|
48
50
|
|
|
49
51
|
if logs_enabled is None:
|
|
@@ -57,13 +59,19 @@ def function_add_or_update(
|
|
|
57
59
|
"language": "python",
|
|
58
60
|
"visibility": visibility or "ENVIRONMENT",
|
|
59
61
|
"returnType": get_jsonschema_type(return_type),
|
|
60
|
-
"arguments": [
|
|
61
|
-
|
|
62
|
+
"arguments": [
|
|
63
|
+
{**p, "key": p["name"], "type": get_jsonschema_type(p["type"])}
|
|
64
|
+
for p in parsed["types"]["params"]
|
|
65
|
+
],
|
|
66
|
+
"logsEnabled": logs_enabled
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
if generate_contexts:
|
|
65
70
|
data["generateContexts"] = generate_contexts.split(",")
|
|
66
71
|
|
|
72
|
+
if server:
|
|
73
|
+
data["skipToolkitBuild"] = skip_toolkit_build
|
|
74
|
+
|
|
67
75
|
if server and parsed["dependencies"]:
|
|
68
76
|
print_yellow(
|
|
69
77
|
"\nPlease note that deploying your functions will take a few minutes because it makes use of libraries other than polyapi."
|
|
@@ -94,6 +102,7 @@ def function_add_or_update(
|
|
|
94
102
|
if generate:
|
|
95
103
|
# Use cached generate arguments when regenerating after function deployment
|
|
96
104
|
from polyapi.generate import generate_from_cache
|
|
105
|
+
|
|
97
106
|
generate_from_cache()
|
|
98
107
|
else:
|
|
99
108
|
print("Error adding function.")
|
|
@@ -126,4 +135,4 @@ def spec_delete(function_type: str, function_id: str):
|
|
|
126
135
|
sys.exit(1)
|
|
127
136
|
headers = get_auth_headers(api_key)
|
|
128
137
|
resp = http_client.delete(url, headers=headers)
|
|
129
|
-
return resp
|
|
138
|
+
return resp
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "polyapi-python"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.19.dev0"
|
|
8
8
|
description = "The Python Client for PolyAPI, the IPaaS by Developers for Developers"
|
|
9
9
|
authors = [{ name = "PolyAPI", email = "support@polyapi.io" }]
|
|
10
10
|
dependencies = [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/requires.txt
RENAMED
|
File without changes
|
{polyapi_python-0.3.18.dev7 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|