polyapi-python 0.3.3.dev5__py3-none-any.whl → 0.3.3.dev6__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/parser.py +7 -6
- {polyapi_python-0.3.3.dev5.dist-info → polyapi_python-0.3.3.dev6.dist-info}/METADATA +1 -1
- {polyapi_python-0.3.3.dev5.dist-info → polyapi_python-0.3.3.dev6.dist-info}/RECORD +6 -6
- {polyapi_python-0.3.3.dev5.dist-info → polyapi_python-0.3.3.dev6.dist-info}/WHEEL +0 -0
- {polyapi_python-0.3.3.dev5.dist-info → polyapi_python-0.3.3.dev6.dist-info}/licenses/LICENSE +0 -0
- {polyapi_python-0.3.3.dev5.dist-info → polyapi_python-0.3.3.dev6.dist-info}/top_level.txt +0 -0
polyapi/parser.py
CHANGED
|
@@ -5,7 +5,7 @@ import sys
|
|
|
5
5
|
import re
|
|
6
6
|
from typing import Dict, List, Mapping, Optional, Tuple, Any
|
|
7
7
|
from typing import _TypedDictMeta as BaseTypedDict # type: ignore
|
|
8
|
-
from typing_extensions import _TypedDictMeta
|
|
8
|
+
from typing_extensions import _TypedDictMeta, cast # type: ignore
|
|
9
9
|
from stdlib_list import stdlib_list
|
|
10
10
|
from pydantic import TypeAdapter
|
|
11
11
|
from importlib.metadata import packages_distributions
|
|
@@ -318,7 +318,7 @@ def _parse_value(value):
|
|
|
318
318
|
return None
|
|
319
319
|
|
|
320
320
|
|
|
321
|
-
def parse_function_code(code: str, name: Optional[str] = "", context: Optional[str] = ""):
|
|
321
|
+
def parse_function_code(code: str, name: Optional[str] = "", context: Optional[str] = ""): # noqa: C901
|
|
322
322
|
schemas = _get_schemas(code)
|
|
323
323
|
|
|
324
324
|
# the pip name and the import name might be different
|
|
@@ -326,9 +326,9 @@ def parse_function_code(code: str, name: Optional[str] = "", context: Optional[s
|
|
|
326
326
|
# see https://stackoverflow.com/a/75144378
|
|
327
327
|
pip_name_lookup = packages_distributions()
|
|
328
328
|
|
|
329
|
-
deployable: DeployableRecord = {
|
|
330
|
-
"context": context,
|
|
331
|
-
"name": name,
|
|
329
|
+
deployable: DeployableRecord = { # type: ignore
|
|
330
|
+
"context": context, # type: ignore
|
|
331
|
+
"name": name, # type: ignore
|
|
332
332
|
"description": "",
|
|
333
333
|
"config": {},
|
|
334
334
|
"gitRevision": "",
|
|
@@ -382,7 +382,7 @@ def parse_function_code(code: str, name: Optional[str] = "", context: Optional[s
|
|
|
382
382
|
if node.annotation.id == "PolyServerFunction":
|
|
383
383
|
deployable["type"] = "server-function"
|
|
384
384
|
elif node.annotation.id == "PolyClientFunction":
|
|
385
|
-
deployable["type"] = "
|
|
385
|
+
deployable["type"] = "client-function"
|
|
386
386
|
else:
|
|
387
387
|
print_red("ERROR")
|
|
388
388
|
print(f"Unsupported polyConfig type '${node.annotation.id}'")
|
|
@@ -405,6 +405,7 @@ def parse_function_code(code: str, name: Optional[str] = "", context: Optional[s
|
|
|
405
405
|
if type(docstring) is None or (not docstring and '"""' not in self._lines[start_lineno] and "'''" not in self._lines[start_lineno]):
|
|
406
406
|
return None
|
|
407
407
|
|
|
408
|
+
docstring = cast(str, docstring)
|
|
408
409
|
|
|
409
410
|
# Support both types of triple quotation marks
|
|
410
411
|
pattern = '"""'
|
|
@@ -12,7 +12,7 @@ polyapi/exceptions.py,sha256=Zh7i7eCUhDuXEdUYjatkLFTeZkrx1BJ1P5ePgbJ9eIY,89
|
|
|
12
12
|
polyapi/execute.py,sha256=kXnvlNQ7nz9cRlV2_5gXH09UCmyiDP5zi3wiAw0uDuk,1943
|
|
13
13
|
polyapi/function_cli.py,sha256=htgmcx_dPmw4_5NKRgIivcwS7D8bkOsxCTOrJhzV3pU,3989
|
|
14
14
|
polyapi/generate.py,sha256=IIbU4Kc8Ut-N3cPI1qzgV3M4r_GHi39dgU0ngpUY86Q,10473
|
|
15
|
-
polyapi/parser.py,sha256=
|
|
15
|
+
polyapi/parser.py,sha256=5YWkZX7XT3tR3_qlUmtSNwh6bU6cf2Xly2DclfuKUiE,20376
|
|
16
16
|
polyapi/poly_schemas.py,sha256=vHHRUJUycYk4uKmjiWG6fpVQllaRw8yVUt4X_Hmoqk8,2921
|
|
17
17
|
polyapi/prepare.py,sha256=Q8CWV4kmZ2dbXYVsud34AgJkj5ymcQ_IcYhLuikc9yk,6659
|
|
18
18
|
polyapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -24,8 +24,8 @@ polyapi/typedefs.py,sha256=KniVl7vwcDOhgAJmHSgTJKkP0rKWvSLIPOGsWuf9jRU,2239
|
|
|
24
24
|
polyapi/utils.py,sha256=9OKwhte_YdnkDectgnjSkVmcxazd8FyfoiKCQtlD63o,10194
|
|
25
25
|
polyapi/variables.py,sha256=d36-trnfTL_8m2NkorMiImb4O3UrJbiFV38CHxV5i0A,4200
|
|
26
26
|
polyapi/webhook.py,sha256=LWv28c2MLz_OKBI_Nn7WR4C-gs1SWgbdXsoxIIf-9UI,4886
|
|
27
|
-
polyapi_python-0.3.3.
|
|
28
|
-
polyapi_python-0.3.3.
|
|
29
|
-
polyapi_python-0.3.3.
|
|
30
|
-
polyapi_python-0.3.3.
|
|
31
|
-
polyapi_python-0.3.3.
|
|
27
|
+
polyapi_python-0.3.3.dev6.dist-info/licenses/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
|
|
28
|
+
polyapi_python-0.3.3.dev6.dist-info/METADATA,sha256=f3rayBkYgsP7MEOkeqSgzLiQ_SdCaDYHRX1Z62UaoUY,5782
|
|
29
|
+
polyapi_python-0.3.3.dev6.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
30
|
+
polyapi_python-0.3.3.dev6.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
|
|
31
|
+
polyapi_python-0.3.3.dev6.dist-info/RECORD,,
|
|
File without changes
|
{polyapi_python-0.3.3.dev5.dist-info → polyapi_python-0.3.3.dev6.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|