polyapi-python 0.3.18.dev6__tar.gz → 0.3.19.dev0__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 (54) hide show
  1. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/PKG-INFO +2 -2
  2. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/cli.py +6 -4
  3. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/function_cli.py +16 -7
  4. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/PKG-INFO +2 -2
  5. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/SOURCES.txt +1 -0
  6. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/requires.txt +1 -1
  7. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/pyproject.toml +2 -2
  8. polyapi_python-0.3.19.dev0/tests/test_dependency_pins.py +33 -0
  9. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/LICENSE +0 -0
  10. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/README.md +0 -0
  11. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/__init__.py +0 -0
  12. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/__main__.py +0 -0
  13. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/api.py +0 -0
  14. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/auth.py +0 -0
  15. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/cli_constants.py +0 -0
  16. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/client.py +0 -0
  17. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/config.py +0 -0
  18. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/constants.py +0 -0
  19. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/deployables.py +0 -0
  20. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/error_handler.py +0 -0
  21. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/exceptions.py +0 -0
  22. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/execute.py +0 -0
  23. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/generate.py +0 -0
  24. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/http_client.py +0 -0
  25. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/parser.py +0 -0
  26. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/poly_schemas.py +0 -0
  27. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/poly_tables.py +0 -0
  28. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/prepare.py +0 -0
  29. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/py.typed +0 -0
  30. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/rendered_spec.py +0 -0
  31. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/schema.py +0 -0
  32. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/server.py +0 -0
  33. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/sync.py +0 -0
  34. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/typedefs.py +0 -0
  35. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/utils.py +0 -0
  36. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/variables.py +0 -0
  37. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi/webhook.py +0 -0
  38. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/dependency_links.txt +0 -0
  39. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/polyapi_python.egg-info/top_level.txt +0 -0
  40. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/setup.cfg +0 -0
  41. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_api.py +0 -0
  42. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_async_proof.py +0 -0
  43. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_auth.py +0 -0
  44. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_deployables.py +0 -0
  45. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_generate.py +0 -0
  46. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_parser.py +0 -0
  47. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_poly_custom.py +0 -0
  48. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_poly_schemas.py +0 -0
  49. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_rendered_spec.py +0 -0
  50. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_schema.py +0 -0
  51. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_server.py +0 -0
  52. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_tabi.py +0 -0
  53. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_utils.py +0 -0
  54. {polyapi_python-0.3.18.dev6 → polyapi_python-0.3.19.dev0}/tests/test_variables.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.18.dev6
3
+ Version: 0.3.19.dev0
4
4
  Summary: The Python Client for PolyAPI, the IPaaS by Developers for Developers
5
5
  Author-email: PolyAPI <support@polyapi.io>
6
6
  License: MIT License
@@ -35,7 +35,7 @@ Requires-Dist: pydantic==2.8.0
35
35
  Requires-Dist: stdlib_list==0.11.1
36
36
  Requires-Dist: colorama==0.4.4
37
37
  Requires-Dist: python-socketio[asyncio_client]==5.11.1
38
- Requires-Dist: truststore==0.8.0
38
+ Requires-Dist: truststore==0.9.1
39
39
  Requires-Dist: httpx==0.28.1
40
40
  Dynamic: license-file
41
41
 
@@ -45,8 +45,8 @@ def execute_from_cli():
45
45
 
46
46
  # Add global --version/-v flag
47
47
  parser.add_argument('-v', '--version', action='version',
48
- version=_get_version_string(),
49
- help="Show version information")
48
+ version=_get_version_string(),
49
+ help="Show version information")
50
50
 
51
51
  subparsers = parser.add_subparsers(help="Available commands")
52
52
 
@@ -95,7 +95,7 @@ def execute_from_cli():
95
95
  # overwrite all cached values with the values passed in from the command line
96
96
  final_contexts = contexts
97
97
  final_names = names
98
- final_ids = ids
98
+ # final_ids = ids
99
99
  final_no_types = no_types
100
100
 
101
101
  # cache the values used for this explicit generate command
@@ -127,6 +127,7 @@ def execute_from_cli():
127
127
  fn_add_parser.add_argument("--logs", choices=["enabled", "disabled"], default=None, help="Enable or disable logs for the function.")
128
128
  fn_add_parser.add_argument("--execution-api-key", required=False, default="", help="API key for execution (for server functions only).")
129
129
  fn_add_parser.add_argument("--skip-generate", action="store_true", help="Skip running generate after function add command, especially useful if you are deploying a bunch of functions at once. Run generate manually at the end!")
130
+ fn_add_parser.add_argument("--skip-toolkit-build", action="store_true", help="Skip rebuilding the toolkit after adding/updating the function")
130
131
  fn_add_parser.add_argument("--generate-contexts", type=str, help="Server function only – only include certain contexts to speed up function execution")
131
132
  fn_add_parser.add_argument("--visibility", type=str, default="environment", help="Specifies the visibility of a function. Options: PUBLIC, TENANT, ENVIRONMENT. Case insensitive")
132
133
 
@@ -162,7 +163,8 @@ def execute_from_cli():
162
163
  generate=not args.skip_generate,
163
164
  execution_api_key=args.execution_api_key,
164
165
  generate_contexts=args.generate_contexts,
165
- visibility=visibility
166
+ visibility=visibility,
167
+ skip_toolkit_build=args.skip_toolkit_build
166
168
  )
167
169
 
168
170
  fn_add_parser.set_defaults(command=add_function)
@@ -26,7 +26,8 @@ def function_add_or_update(
26
26
  generate_contexts: Optional[str],
27
27
  visibility: Optional[str],
28
28
  generate: bool = True,
29
- execution_api_key: str = ""
29
+ execution_api_key: str = "",
30
+ skip_toolkit_build: bool = False,
30
31
  ):
31
32
  verb = "Updating" if _func_already_exists(context, name) else "Adding"
32
33
  ftype = "server" if server else "client"
@@ -39,11 +40,12 @@ def function_add_or_update(
39
40
  parsed = parse_function_code(code, name, context)
40
41
  return_type = parsed["types"]["returns"]["type"]
41
42
 
43
+ if "dependencies" not in parsed:
44
+ parsed["dependencies"] = []
45
+
42
46
  if not return_type:
43
47
  print_red("ERROR")
44
- print(
45
- f"Function {name} not found as top-level function in {name}"
46
- )
48
+ print(f"Function {name} not found as top-level function in {name}")
47
49
  sys.exit(1)
48
50
 
49
51
  if logs_enabled is None:
@@ -57,13 +59,19 @@ def function_add_or_update(
57
59
  "language": "python",
58
60
  "visibility": visibility or "ENVIRONMENT",
59
61
  "returnType": get_jsonschema_type(return_type),
60
- "arguments": [{**p, "key": p["name"], "type": get_jsonschema_type(p["type"])} for p in parsed["types"]["params"]],
61
- "logsEnabled": logs_enabled,
62
+ "arguments": [
63
+ {**p, "key": p["name"], "type": get_jsonschema_type(p["type"])}
64
+ for p in parsed["types"]["params"]
65
+ ],
66
+ "logsEnabled": logs_enabled
62
67
  }
63
68
 
64
69
  if generate_contexts:
65
70
  data["generateContexts"] = generate_contexts.split(",")
66
71
 
72
+ if server:
73
+ data["skipToolkitBuild"] = skip_toolkit_build
74
+
67
75
  if server and parsed["dependencies"]:
68
76
  print_yellow(
69
77
  "\nPlease note that deploying your functions will take a few minutes because it makes use of libraries other than polyapi."
@@ -94,6 +102,7 @@ def function_add_or_update(
94
102
  if generate:
95
103
  # Use cached generate arguments when regenerating after function deployment
96
104
  from polyapi.generate import generate_from_cache
105
+
97
106
  generate_from_cache()
98
107
  else:
99
108
  print("Error adding function.")
@@ -126,4 +135,4 @@ def spec_delete(function_type: str, function_id: str):
126
135
  sys.exit(1)
127
136
  headers = get_auth_headers(api_key)
128
137
  resp = http_client.delete(url, headers=headers)
129
- return resp
138
+ return resp
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.18.dev6
3
+ Version: 0.3.19.dev0
4
4
  Summary: The Python Client for PolyAPI, the IPaaS by Developers for Developers
5
5
  Author-email: PolyAPI <support@polyapi.io>
6
6
  License: MIT License
@@ -35,7 +35,7 @@ Requires-Dist: pydantic==2.8.0
35
35
  Requires-Dist: stdlib_list==0.11.1
36
36
  Requires-Dist: colorama==0.4.4
37
37
  Requires-Dist: python-socketio[asyncio_client]==5.11.1
38
- Requires-Dist: truststore==0.8.0
38
+ Requires-Dist: truststore==0.9.1
39
39
  Requires-Dist: httpx==0.28.1
40
40
  Dynamic: license-file
41
41
 
@@ -38,6 +38,7 @@ polyapi_python.egg-info/top_level.txt
38
38
  tests/test_api.py
39
39
  tests/test_async_proof.py
40
40
  tests/test_auth.py
41
+ tests/test_dependency_pins.py
41
42
  tests/test_deployables.py
42
43
  tests/test_generate.py
43
44
  tests/test_parser.py
@@ -5,5 +5,5 @@ pydantic==2.8.0
5
5
  stdlib_list==0.11.1
6
6
  colorama==0.4.4
7
7
  python-socketio[asyncio_client]==5.11.1
8
- truststore==0.8.0
8
+ truststore==0.9.1
9
9
  httpx==0.28.1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "polyapi-python"
7
- version = "0.3.18.dev6"
7
+ version = "0.3.19.dev0"
8
8
  description = "The Python Client for PolyAPI, the IPaaS by Developers for Developers"
9
9
  authors = [{ name = "PolyAPI", email = "support@polyapi.io" }]
10
10
  dependencies = [
@@ -15,7 +15,7 @@ dependencies = [
15
15
  "stdlib_list==0.11.1",
16
16
  "colorama==0.4.4",
17
17
  "python-socketio[asyncio_client]==5.11.1",
18
- "truststore==0.8.0",
18
+ "truststore==0.9.1",
19
19
  "httpx==0.28.1"
20
20
  ]
21
21
  readme = "README.md"
@@ -0,0 +1,33 @@
1
+ import re
2
+ import sys
3
+ from pathlib import Path
4
+
5
+
6
+ REPO_ROOT = Path(__file__).resolve().parents[1]
7
+ TRUSTSTORE_MINIMUM_PYTHON_313_VERSION = (0, 9, 1)
8
+
9
+
10
+ def _parse_requirement_version(requirement: str) -> tuple[int, ...]:
11
+ match = re.fullmatch(r"truststore==(\d+)\.(\d+)\.(\d+)", requirement)
12
+ assert match is not None
13
+ return tuple(int(part) for part in match.groups())
14
+
15
+
16
+ def test_truststore_pin_matches_between_dependency_surfaces():
17
+ requirements_lines = (REPO_ROOT / "requirements.txt").read_text(encoding="utf-8").splitlines()
18
+ requirements_pin = next(line for line in requirements_lines if line.startswith("truststore=="))
19
+
20
+ pyproject_text = (REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8")
21
+ pyproject_match = re.search(r'"(truststore==\d+\.\d+\.\d+)"', pyproject_text)
22
+ assert pyproject_match is not None
23
+ pyproject_pin = pyproject_match.group(1)
24
+
25
+ assert requirements_pin == pyproject_pin
26
+
27
+
28
+ def test_truststore_pin_supports_python_313_ssl_chain_api():
29
+ requirements_lines = (REPO_ROOT / "requirements.txt").read_text(encoding="utf-8").splitlines()
30
+ requirements_pin = next(line for line in requirements_lines if line.startswith("truststore=="))
31
+
32
+ if sys.version_info >= (3, 13):
33
+ assert _parse_requirement_version(requirements_pin) >= TRUSTSTORE_MINIMUM_PYTHON_313_VERSION