polyapi-python 0.3.1.dev9__tar.gz → 0.3.1.dev10__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.
Files changed (44) hide show
  1. {polyapi_python-0.3.1.dev9/polyapi_python.egg-info → polyapi_python-0.3.1.dev10}/PKG-INFO +1 -1
  2. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/deployables.py +1 -1
  3. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/parser.py +8 -5
  4. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/prepare.py +6 -4
  5. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/sync.py +5 -1
  6. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10/polyapi_python.egg-info}/PKG-INFO +1 -1
  7. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/pyproject.toml +1 -1
  8. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/LICENSE +0 -0
  9. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/README.md +0 -0
  10. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/__init__.py +0 -0
  11. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/__main__.py +0 -0
  12. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/api.py +0 -0
  13. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/auth.py +0 -0
  14. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/cli.py +0 -0
  15. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/client.py +0 -0
  16. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/config.py +0 -0
  17. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/constants.py +0 -0
  18. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/error_handler.py +0 -0
  19. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/exceptions.py +0 -0
  20. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/execute.py +0 -0
  21. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/function_cli.py +0 -0
  22. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/generate.py +0 -0
  23. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/py.typed +0 -0
  24. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/rendered_spec.py +0 -0
  25. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/schema.py +0 -0
  26. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/server.py +0 -0
  27. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/typedefs.py +0 -0
  28. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/utils.py +0 -0
  29. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/variables.py +0 -0
  30. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi/webhook.py +0 -0
  31. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi_python.egg-info/SOURCES.txt +0 -0
  32. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi_python.egg-info/dependency_links.txt +0 -0
  33. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi_python.egg-info/requires.txt +0 -0
  34. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/polyapi_python.egg-info/top_level.txt +0 -0
  35. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/setup.cfg +0 -0
  36. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/tests/test_api.py +0 -0
  37. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/tests/test_auth.py +0 -0
  38. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/tests/test_deployables.py +0 -0
  39. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/tests/test_parser.py +0 -0
  40. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/tests/test_rendered_spec.py +0 -0
  41. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/tests/test_schema.py +0 -0
  42. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/tests/test_server.py +0 -0
  43. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/tests/test_utils.py +0 -0
  44. {polyapi_python-0.3.1.dev9 → polyapi_python-0.3.1.dev10}/tests/test_variables.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: polyapi-python
3
- Version: 0.3.1.dev9
3
+ Version: 0.3.1.dev10
4
4
  Summary: The Python Client for PolyAPI, the IPaaS by Developers for Developers
5
5
  Author-email: Dan Fellin <dan@polyapi.io>
6
6
  License: MIT License
@@ -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}\n{file_content}"
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:
@@ -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
- type_index = next(i for i, d in enumerate(docstring_params) if d["name"] == arg.arg)
479
- if type_index >= 0:
480
- json_arg["description"] = docstring_params[type_index]["description"]
481
- if docstring_params[type_index]["type"] != python_type:
482
- deployable["dirty"] = True
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
 
@@ -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
- {**p, "description": ai_arg["description"]} if ai_arg and ai_arg.get("description") else p
65
- for p, ai_arg in zip(deployable["types"]["params"], ai_generated.get("arguments", []))
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
@@ -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 = next((d for d in deployable.get('deployments', []) if d['instance'] == instance), None)
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: polyapi-python
3
- Version: 0.3.1.dev9
3
+ Version: 0.3.1.dev10
4
4
  Summary: The Python Client for PolyAPI, the IPaaS by Developers for Developers
5
5
  Author-email: Dan Fellin <dan@polyapi.io>
6
6
  License: MIT License
@@ -3,7 +3,7 @@ requires = ["setuptools>=61.2", "wheel"]
3
3
 
4
4
  [project]
5
5
  name = "polyapi-python"
6
- version = "0.3.1.dev9"
6
+ version = "0.3.1.dev10"
7
7
  description = "The Python Client for PolyAPI, the IPaaS by Developers for Developers"
8
8
  authors = [{ name = "Dan Fellin", email = "dan@polyapi.io" }]
9
9
  dependencies = [