polyapi-python 0.3.1.dev9__py3-none-any.whl → 0.3.1.dev10__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/deployables.py +1 -1
- polyapi/parser.py +8 -5
- polyapi/prepare.py +6 -4
- polyapi/sync.py +5 -1
- {polyapi_python-0.3.1.dev9.dist-info → polyapi_python-0.3.1.dev10.dist-info}/METADATA +1 -1
- {polyapi_python-0.3.1.dev9.dist-info → polyapi_python-0.3.1.dev10.dist-info}/RECORD +9 -9
- {polyapi_python-0.3.1.dev9.dist-info → polyapi_python-0.3.1.dev10.dist-info}/LICENSE +0 -0
- {polyapi_python-0.3.1.dev9.dist-info → polyapi_python-0.3.1.dev10.dist-info}/WHEEL +0 -0
- {polyapi_python-0.3.1.dev9.dist-info → polyapi_python-0.3.1.dev10.dist-info}/top_level.txt +0 -0
polyapi/deployables.py
CHANGED
|
@@ -245,7 +245,7 @@ def update_deployment_comments(file_content: str, deployable: dict) -> str:
|
|
|
245
245
|
if deployable['deployments']:
|
|
246
246
|
deployment_comments = write_deploy_comments(deployable['deployments'])
|
|
247
247
|
deployable['deploymentCommentRanges'] = [(0, len(deployment_comments) + 1)]
|
|
248
|
-
file_content = f"{deployment_comments}
|
|
248
|
+
file_content = f"{deployment_comments}{file_content}"
|
|
249
249
|
return file_content
|
|
250
250
|
|
|
251
251
|
def update_deployable_function_comments(file_content: str, deployable: dict, disable_docs: bool = False) -> str:
|
polyapi/parser.py
CHANGED
|
@@ -475,11 +475,14 @@ def parse_function_code(code: str, name: Optional[str] = "", context: Optional[s
|
|
|
475
475
|
json_arg["typeSchema"] = json.dumps(type_schema)
|
|
476
476
|
|
|
477
477
|
if docstring_params:
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
478
|
+
try:
|
|
479
|
+
type_index = next(i for i, d in enumerate(docstring_params) if d["name"] == arg.arg)
|
|
480
|
+
if type_index >= 0:
|
|
481
|
+
json_arg["description"] = docstring_params[type_index]["description"]
|
|
482
|
+
if docstring_params[type_index]["type"] != python_type:
|
|
483
|
+
deployable["dirty"] = True
|
|
484
|
+
except:
|
|
485
|
+
pass
|
|
483
486
|
else:
|
|
484
487
|
deployable["dirty"] = True
|
|
485
488
|
|
polyapi/prepare.py
CHANGED
|
@@ -60,10 +60,12 @@ def fill_in_missing_function_details(deployable: DeployableRecord, code: str) ->
|
|
|
60
60
|
deployable["types"]["description"] = ai_generated["description"]
|
|
61
61
|
deployable["dirty"] = True
|
|
62
62
|
|
|
63
|
-
deployable["types"]["params"]
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
for i, p in enumerate(deployable["types"]["params"]):
|
|
64
|
+
ai_params = ai_generated.get("arguments", [])
|
|
65
|
+
ai_param = ai_params[i] if ai_params else None
|
|
66
|
+
if ai_param and not p.get("description"):
|
|
67
|
+
deployable["types"]["params"][i]["description"] = ai_param["description"]
|
|
68
|
+
|
|
67
69
|
except Exception as e:
|
|
68
70
|
print(f"Failed to generate descriptions due to: {str(e)}")
|
|
69
71
|
return deployable
|
polyapi/sync.py
CHANGED
|
@@ -102,7 +102,11 @@ def sync_deployables(dry_run: bool, instance: str = os.getenv('POLY_API_BASE_URL
|
|
|
102
102
|
for type_name in DEPLOY_ORDER:
|
|
103
103
|
deployables = grouped_deployables.get(type_name, [])
|
|
104
104
|
for deployable in deployables:
|
|
105
|
-
previous_deployment =
|
|
105
|
+
previous_deployment = None
|
|
106
|
+
try:
|
|
107
|
+
previous_deployment = next((d for d in deployable.get('deployments', []) if d['instance'] == instance), None)
|
|
108
|
+
except:
|
|
109
|
+
pass
|
|
106
110
|
git_revision_changed = git_revision != deployable['gitRevision']
|
|
107
111
|
file_revision_changed = not previous_deployment or previous_deployment['fileRevision'] != deployable['fileRevision']
|
|
108
112
|
|
|
@@ -6,25 +6,25 @@ polyapi/cli.py,sha256=wXR5UE73nk26WQRbE8yK69h3h5udNrZFr85ORhbPnRs,8251
|
|
|
6
6
|
polyapi/client.py,sha256=CoFDYvyKsqL4wPQbUDIr0Qb8Q5eD92xN4OEEcJEVuGQ,1296
|
|
7
7
|
polyapi/config.py,sha256=uvEvOfWYZTLmBmZX-5jJxCzWPpwzVmEOIiQIdi98P4Y,3015
|
|
8
8
|
polyapi/constants.py,sha256=sc-FnS0SngBLvSu1ZWMs0UCf9EYD1u1Yhfr-sZXGLns,607
|
|
9
|
-
polyapi/deployables.py,sha256=
|
|
9
|
+
polyapi/deployables.py,sha256=74Bs2kDhyoQhezc0I1V4pi7l-SYg7_zpYrXYPjAePMw,11954
|
|
10
10
|
polyapi/error_handler.py,sha256=I_e0iz6VM23FLVQWJljxs2NGcl_OODbi43OcbnqBlp8,2398
|
|
11
11
|
polyapi/exceptions.py,sha256=Zh7i7eCUhDuXEdUYjatkLFTeZkrx1BJ1P5ePgbJ9eIY,89
|
|
12
12
|
polyapi/execute.py,sha256=kXnvlNQ7nz9cRlV2_5gXH09UCmyiDP5zi3wiAw0uDuk,1943
|
|
13
13
|
polyapi/function_cli.py,sha256=TDoSuhj7lkx3LZfI4ndL0v1VJrKm-UNycoAO5EpZydA,4147
|
|
14
14
|
polyapi/generate.py,sha256=SIRfN7RF3Z7eQ8kSNg4H70LeT7Hmh-Mn5maibvM7kAM,7969
|
|
15
|
-
polyapi/parser.py,sha256=
|
|
16
|
-
polyapi/prepare.py,sha256=
|
|
15
|
+
polyapi/parser.py,sha256=rtI4-SR6v7mqG2vF_P6qgC-qn-M_QG-e95PJUZv92cc,20248
|
|
16
|
+
polyapi/prepare.py,sha256=Q8CWV4kmZ2dbXYVsud34AgJkj5ymcQ_IcYhLuikc9yk,6659
|
|
17
17
|
polyapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
18
|
polyapi/rendered_spec.py,sha256=uaNzBhP4cX7iGfKwzZv0dxMagWzsGeDr0cQYx_AyIhQ,2153
|
|
19
19
|
polyapi/schema.py,sha256=VVMHAT5yU47cRC7xF44BrmUSemlk5oIKSxH2HTVPaQ8,3169
|
|
20
20
|
polyapi/server.py,sha256=NzQCZFSAJK7XiRw1kiU_i9uMvgYK7i8qh7UX2xjytJU,1908
|
|
21
|
-
polyapi/sync.py,sha256=
|
|
21
|
+
polyapi/sync.py,sha256=icxMb-h8zkeN7rHZUOe-JiwkmMx2Ze5qum1ZI0bfQdk,6391
|
|
22
22
|
polyapi/typedefs.py,sha256=jmKprGFQSxmJXvwV53p-MFMcStmTp-tsgsynWjoVmU0,1986
|
|
23
23
|
polyapi/utils.py,sha256=jzCh-ivKMcgp5fIXynhYmP9UyzsISr9bGGEzdPP8n3w,7644
|
|
24
24
|
polyapi/variables.py,sha256=d36-trnfTL_8m2NkorMiImb4O3UrJbiFV38CHxV5i0A,4200
|
|
25
25
|
polyapi/webhook.py,sha256=LWv28c2MLz_OKBI_Nn7WR4C-gs1SWgbdXsoxIIf-9UI,4886
|
|
26
|
-
polyapi_python-0.3.1.
|
|
27
|
-
polyapi_python-0.3.1.
|
|
28
|
-
polyapi_python-0.3.1.
|
|
29
|
-
polyapi_python-0.3.1.
|
|
30
|
-
polyapi_python-0.3.1.
|
|
26
|
+
polyapi_python-0.3.1.dev10.dist-info/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
|
|
27
|
+
polyapi_python-0.3.1.dev10.dist-info/METADATA,sha256=Ak4c3Qle4V4-JklMxURu2N7wAQ6PwmK0U3vmCVkgpoU,5327
|
|
28
|
+
polyapi_python-0.3.1.dev10.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
|
29
|
+
polyapi_python-0.3.1.dev10.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
|
|
30
|
+
polyapi_python-0.3.1.dev10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|