polyapi-python 0.3.12.dev1__tar.gz → 0.3.13.dev1__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.12.dev1/polyapi_python.egg-info → polyapi_python-0.3.13.dev1}/PKG-INFO +1 -1
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/config.py +2 -1
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/deployables.py +2 -1
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/parser.py +13 -3
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1/polyapi_python.egg-info}/PKG-INFO +1 -1
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/pyproject.toml +4 -6
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/LICENSE +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/README.md +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/__init__.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/__main__.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/api.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/auth.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/cli.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/client.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/constants.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/error_handler.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/exceptions.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/execute.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/function_cli.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/generate.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/poly_schemas.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/poly_tables.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/prepare.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/py.typed +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/rendered_spec.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/schema.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/server.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/sync.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/typedefs.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/utils.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/variables.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi/webhook.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi_python.egg-info/SOURCES.txt +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi_python.egg-info/dependency_links.txt +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi_python.egg-info/requires.txt +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi_python.egg-info/top_level.txt +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/setup.cfg +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/tests/test_api.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/tests/test_auth.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/tests/test_deployables.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/tests/test_generate.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/tests/test_parser.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/tests/test_rendered_spec.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/tests/test_schema.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/tests/test_server.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/tests/test_tabi.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/tests/test_utils.py +0 -0
- {polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/tests/test_variables.py +0 -0
|
@@ -96,7 +96,8 @@ def initialize_config(force=False):
|
|
|
96
96
|
if not key:
|
|
97
97
|
key = input("? Poly App Key or User Key: ").strip()
|
|
98
98
|
else:
|
|
99
|
-
|
|
99
|
+
display_key = '*' * 8 + key[-4:]
|
|
100
|
+
key_input = input(f"? Poly App Key or User Key ({display_key}): ").strip()
|
|
100
101
|
key = key_input if key_input else key
|
|
101
102
|
|
|
102
103
|
if url and key:
|
|
@@ -6,6 +6,7 @@ import json
|
|
|
6
6
|
import hashlib
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from typing import TypedDict, List, Dict, Tuple, Optional, Any, Union
|
|
9
|
+
from typing_extensions import Required
|
|
9
10
|
from subprocess import check_output, CalledProcessError
|
|
10
11
|
|
|
11
12
|
|
|
@@ -54,7 +55,7 @@ class DeployableRecord(ParsedDeployableConfig, total=False):
|
|
|
54
55
|
gitRevision: str
|
|
55
56
|
fileRevision: str
|
|
56
57
|
file: str
|
|
57
|
-
types: DeployableFunctionTypes
|
|
58
|
+
types: Required[DeployableFunctionTypes]
|
|
58
59
|
typeSchemas: Dict[str, Any]
|
|
59
60
|
dependencies: List[str]
|
|
60
61
|
deployments: List[Deployment]
|
|
@@ -3,7 +3,7 @@ import json
|
|
|
3
3
|
import types
|
|
4
4
|
import sys
|
|
5
5
|
import re
|
|
6
|
-
from typing import Dict, List, Mapping, Optional, Tuple, Any
|
|
6
|
+
from typing import Dict, List, Mapping, Optional, Tuple, Any, Union
|
|
7
7
|
from typing import _TypedDictMeta as BaseTypedDict # type: ignore
|
|
8
8
|
from typing_extensions import _TypedDictMeta, cast # type: ignore
|
|
9
9
|
from stdlib_list import stdlib_list
|
|
@@ -390,7 +390,7 @@ def parse_function_code(code: str, name: Optional[str] = "", context: Optional[s
|
|
|
390
390
|
deployable["config"] = _parse_dict(node.value)
|
|
391
391
|
self._name = deployable["config"]["name"]
|
|
392
392
|
|
|
393
|
-
def _extract_docstring_from_function(self, node: ast.FunctionDef):
|
|
393
|
+
def _extract_docstring_from_function(self, node: Union[ast.FunctionDef, ast.AsyncFunctionDef]):
|
|
394
394
|
start_lineno = (node.body[0].lineno if node.body else node.lineno) - 1
|
|
395
395
|
start_offset = self._line_offsets[start_lineno]
|
|
396
396
|
end_offset = start_offset
|
|
@@ -452,15 +452,19 @@ def parse_function_code(code: str, name: Optional[str] = "", context: Optional[s
|
|
|
452
452
|
for name in node.names:
|
|
453
453
|
req = _get_req_name_if_not_in_base(name.name, pip_name_lookup)
|
|
454
454
|
if req:
|
|
455
|
+
if "dependencies" not in deployable or deployable["dependencies"] is None:
|
|
456
|
+
deployable["dependencies"] = []
|
|
455
457
|
deployable["dependencies"].append(req)
|
|
456
458
|
|
|
457
459
|
def visit_ImportFrom(self, node: ast.ImportFrom):
|
|
458
460
|
if node.module:
|
|
459
461
|
req = _get_req_name_if_not_in_base(node.module, pip_name_lookup)
|
|
460
462
|
if req:
|
|
463
|
+
if "dependencies" not in deployable or deployable["dependencies"] is None:
|
|
464
|
+
deployable["dependencies"] = []
|
|
461
465
|
deployable["dependencies"].append(req)
|
|
462
466
|
|
|
463
|
-
def
|
|
467
|
+
def _handle_function_def(self, node: Union[ast.FunctionDef, ast.AsyncFunctionDef]):
|
|
464
468
|
if node.name == self._name:
|
|
465
469
|
# Parse docstring which may contain param types and descriptions
|
|
466
470
|
self._extract_docstring_from_function(node)
|
|
@@ -506,6 +510,12 @@ def parse_function_code(code: str, name: Optional[str] = "", context: Optional[s
|
|
|
506
510
|
else:
|
|
507
511
|
deployable["types"]["returns"]["type"] = "Any"
|
|
508
512
|
|
|
513
|
+
def visit_FunctionDef(self, node: ast.FunctionDef):
|
|
514
|
+
self._handle_function_def(node)
|
|
515
|
+
|
|
516
|
+
def visit_AsyncFunctionDef(self, node: ast.AsyncFunctionDef):
|
|
517
|
+
self._handle_function_def(node)
|
|
518
|
+
|
|
509
519
|
def generic_visit(self, node):
|
|
510
520
|
if hasattr(node, 'lineno') and hasattr(node, 'col_offset'):
|
|
511
521
|
self._current_offset = self._line_offsets[node.lineno - 1] + node.col_offset
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
[build-system]
|
|
2
2
|
requires = ["setuptools>=61.2", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
3
4
|
|
|
4
5
|
[project]
|
|
5
6
|
name = "polyapi-python"
|
|
6
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.13.dev1" # bump
|
|
7
8
|
description = "The Python Client for PolyAPI, the IPaaS by Developers for Developers"
|
|
8
9
|
authors = [{ name = "Dan Fellin", email = "dan@polyapi.io" }]
|
|
9
10
|
dependencies = [
|
|
@@ -23,14 +24,11 @@ requires-python = ">=3.10"
|
|
|
23
24
|
[project.urls]
|
|
24
25
|
Homepage = "https://github.com/polyapi/polyapi-python"
|
|
25
26
|
|
|
26
|
-
[tool.setuptools]
|
|
27
|
-
packages = ["polyapi"]
|
|
28
|
-
|
|
29
|
-
[tools.setuptools.packages.find]
|
|
27
|
+
[tool.setuptools.packages.find]
|
|
30
28
|
include = ["polyapi"]
|
|
31
29
|
exclude = ["polyapi/poly*", "polyapi/vari*", "polyapi/.config.env", "polyapi/cached_deployables*", "polyapi/deployments_revision"] # exclude the generated libraries from builds
|
|
32
30
|
|
|
33
31
|
[tool.mypy]
|
|
34
32
|
# for now redef errors happen sometimes, we will clean this up in the future!
|
|
35
33
|
disable_error_code = "no-redef,name-defined"
|
|
36
|
-
implicit_optional = true
|
|
34
|
+
implicit_optional = true
|
|
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.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi_python.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/polyapi_python.egg-info/requires.txt
RENAMED
|
File without changes
|
{polyapi_python-0.3.12.dev1 → polyapi_python-0.3.13.dev1}/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
|