polyapi-python 0.2.3.dev6__tar.gz → 0.2.3.dev7__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.2.3.dev6/polyapi_python.egg-info → polyapi-python-0.2.3.dev7}/PKG-INFO +1 -1
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/cli.py +3 -2
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/function_cli.py +6 -2
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7/polyapi_python.egg-info}/PKG-INFO +1 -1
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/pyproject.toml +1 -1
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/tests/test_function_cli.py +2 -2
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/LICENSE +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/README.md +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/__init__.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/__main__.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/api.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/auth.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/client.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/config.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/constants.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/error_handler.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/exceptions.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/execute.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/generate.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/py.typed +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/schema.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/server.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/typedefs.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/utils.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/variables.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi/webhook.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi_python.egg-info/SOURCES.txt +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi_python.egg-info/dependency_links.txt +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi_python.egg-info/requires.txt +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi_python.egg-info/top_level.txt +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/setup.cfg +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/tests/test_api.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/tests/test_auth.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/tests/test_server.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/tests/test_utils.py +0 -0
- {polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/tests/test_variables.py +0 -0
|
@@ -23,7 +23,8 @@ def execute_from_cli():
|
|
|
23
23
|
)
|
|
24
24
|
parser.add_argument("--context", required=False, default="")
|
|
25
25
|
parser.add_argument("--description", required=False, default="")
|
|
26
|
-
parser.add_argument("--
|
|
26
|
+
parser.add_argument("--client", action="store_true", help="Pass --client when adding function to add a client function.")
|
|
27
|
+
parser.add_argument("--server", action="store_true", help="Pass --server when adding function to add a server function.")
|
|
27
28
|
parser.add_argument("--logs", action="store_true", help="Pass --logs when adding function if you want to store and see the function logs.")
|
|
28
29
|
parser.add_argument("command", choices=CLI_COMMANDS)
|
|
29
30
|
parser.add_argument("subcommands", nargs="*")
|
|
@@ -47,4 +48,4 @@ def execute_from_cli():
|
|
|
47
48
|
print("Clearing the generated library...")
|
|
48
49
|
clear()
|
|
49
50
|
elif command == "function":
|
|
50
|
-
function_add_or_update(args.context, args.description, args.server, args.logs, args.subcommands)
|
|
51
|
+
function_add_or_update(args.context, args.description, args.client, args.server, args.logs, args.subcommands)
|
|
@@ -175,7 +175,7 @@ def _func_already_exists(context: str, function_name: str) -> bool:
|
|
|
175
175
|
|
|
176
176
|
|
|
177
177
|
def function_add_or_update(
|
|
178
|
-
context: str, description: str, server: bool, logs_enabled: bool, subcommands: List
|
|
178
|
+
context: str, description: str, client: bool, server: bool, logs_enabled: bool, subcommands: List
|
|
179
179
|
):
|
|
180
180
|
parser = argparse.ArgumentParser()
|
|
181
181
|
parser.add_argument("subcommand", choices=["add"])
|
|
@@ -223,8 +223,12 @@ def function_add_or_update(
|
|
|
223
223
|
assert api_key
|
|
224
224
|
if server:
|
|
225
225
|
url = f"{api_url}/functions/server"
|
|
226
|
-
|
|
226
|
+
elif client:
|
|
227
227
|
url = f"{api_url}/functions/client"
|
|
228
|
+
else:
|
|
229
|
+
print_red("ERROR")
|
|
230
|
+
print("Please specify type of function with --client or --server")
|
|
231
|
+
sys.exit(1)
|
|
228
232
|
|
|
229
233
|
headers = get_auth_headers(api_key)
|
|
230
234
|
resp = requests.post(url, headers=headers, json=data)
|
|
@@ -79,12 +79,12 @@ class T(unittest.TestCase):
|
|
|
79
79
|
def test_parse_import_basic(self):
|
|
80
80
|
code = "import flask\n\n\ndef foobar(n: int) -> int:\n return 9\n"
|
|
81
81
|
_, _, _, additional_requirements = _parse_code(code, "foobar")
|
|
82
|
-
self.assertEqual(additional_requirements, ["
|
|
82
|
+
self.assertEqual(additional_requirements, ["Flask"])
|
|
83
83
|
|
|
84
84
|
def test_parse_import_from(self):
|
|
85
85
|
code = "from flask import Request, Response\n\n\ndef foobar(n: int) -> int:\n return 9\n"
|
|
86
86
|
_, _, _, additional_requirements = _parse_code(code, "foobar")
|
|
87
|
-
self.assertEqual(additional_requirements, ["
|
|
87
|
+
self.assertEqual(additional_requirements, ["Flask"])
|
|
88
88
|
|
|
89
89
|
def test_parse_import_base(self):
|
|
90
90
|
code = "import requests\n\n\ndef foobar(n: int) -> int:\n return 9\n"
|
|
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.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/polyapi_python.egg-info/requires.txt
RENAMED
|
File without changes
|
{polyapi-python-0.2.3.dev6 → polyapi-python-0.2.3.dev7}/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
|