polyapi-python 0.3.3.dev2__py3-none-any.whl → 0.3.3.dev4__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/cli.py CHANGED
@@ -47,9 +47,7 @@ def execute_from_cli():
47
47
 
48
48
  def generate_command(args):
49
49
  initialize_config()
50
- print("Generating Poly Python SDK...", end="")
51
50
  generate()
52
- print_green("DONE")
53
51
 
54
52
  generate_parser.set_defaults(command=generate_command)
55
53
 
polyapi/function_cli.py CHANGED
@@ -1,7 +1,7 @@
1
1
  import sys
2
2
  from typing import Any, List, Optional
3
3
  import requests
4
- from polyapi.generate import cache_specs, generate_functions, get_specs, parse_function_specs
4
+ from polyapi.generate import generate as generate_library
5
5
  from polyapi.config import get_api_key_and_url
6
6
  from polyapi.utils import get_auth_headers, print_green, print_red, print_yellow
7
7
  from polyapi.parser import parse_function_code, get_jsonschema_type
@@ -87,13 +87,7 @@ def function_add_or_update(
87
87
  function_id = resp.json()["id"]
88
88
  print(f"Function ID: {function_id}")
89
89
  if generate:
90
- print("Generating new custom function...", end="")
91
- # TODO do something more efficient here rather than regetting ALL the specs again
92
- specs = get_specs()
93
- cache_specs(specs)
94
- functions = parse_function_specs(specs)
95
- generate_functions(functions)
96
- print_green("DONE")
90
+ generate_library()
97
91
  else:
98
92
  print("Error adding function.")
99
93
  print(resp.status_code)
polyapi/generate.py CHANGED
@@ -4,16 +4,15 @@ import os
4
4
  import shutil
5
5
  from typing import List, cast
6
6
 
7
- from polyapi import schema
8
- from polyapi.auth import render_auth_function
9
- from polyapi.client import render_client_function
10
- from polyapi.poly_schemas import generate_schemas
11
- from polyapi.webhook import render_webhook_handle
7
+ from .auth import render_auth_function
8
+ from .client import render_client_function
9
+ from .poly_schemas import generate_schemas
10
+ from .webhook import render_webhook_handle
12
11
 
13
12
  from .typedefs import PropertySpecification, SchemaSpecDto, SpecificationDto, VariableSpecDto
14
13
  from .api import render_api_function
15
14
  from .server import render_server_function
16
- from .utils import add_import_to_init, get_auth_headers, init_the_init, to_func_namespace
15
+ from .utils import add_import_to_init, get_auth_headers, init_the_init, print_green, to_func_namespace
17
16
  from .variables import generate_variables
18
17
  from .config import get_api_key_and_url
19
18
 
@@ -83,8 +82,8 @@ def replace_poly_refs_in_functions(specs: List[SpecificationDto], schema_index):
83
82
  try:
84
83
  spec["function"] = resolve_poly_refs(func, schema_index)
85
84
  except Exception:
86
- print()
87
- print(f"{spec['context']}.{spec['name']} (id: {spec['id']}) failed to resolve poly refs, skipping!")
85
+ # print()
86
+ # print(f"{spec['context']}.{spec['name']} (id: {spec['id']}) failed to resolve poly refs, skipping!")
88
87
  spec_idxs_to_remove.append(idx)
89
88
 
90
89
  # reverse the list so we pop off later indexes first
@@ -175,7 +174,7 @@ def remove_old_library():
175
174
 
176
175
 
177
176
  def generate() -> None:
178
-
177
+ print("Generating Poly Python SDK...", end="", flush=True)
179
178
  remove_old_library()
180
179
 
181
180
  limit_ids: List[str] = [] # useful for narrowing down generation to a single function to debug
@@ -208,6 +207,8 @@ def generate() -> None:
208
207
  file_path = os.path.join(os.getcwd(), ".polyapi-python")
209
208
  open(file_path, "w").close()
210
209
 
210
+ print_green("DONE")
211
+
211
212
 
212
213
  def clear() -> None:
213
214
  base = os.path.dirname(os.path.abspath(__file__))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.3.dev2
3
+ Version: 0.3.3.dev4
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
@@ -2,7 +2,7 @@ polyapi/__init__.py,sha256=a1Poy1kaTncYnUg6nWRcTjVm-R1CUQk12UX7VYQ9d5k,616
2
2
  polyapi/__main__.py,sha256=V4zhAh_YGxno5f_KSrlkELxcuDh9bR3WSd0n-2r-qQQ,93
3
3
  polyapi/api.py,sha256=8gXypLOgySjg3fWD_K192idYWPNLBU09c9N35b8irxA,1878
4
4
  polyapi/auth.py,sha256=zrIGatjba5GwUTNjKj1GHQWTEDP9B-HrSzCKbLFoqvc,5336
5
- polyapi/cli.py,sha256=bTTEj8n0w-CrkkXuOqxC60iCIWKIGWyPiIuFZbspG6Q,8322
5
+ polyapi/cli.py,sha256=AKsWVHZPKGnypOdnzIpoZOsTuwcAuDGQajXhLe9OQKI,8239
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
@@ -10,8 +10,8 @@ polyapi/deployables.py,sha256=WVcNNB6W5ZW_-ukf_kK3moRcnwIkC-O4te6vLepjcco,11936
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
- polyapi/function_cli.py,sha256=IYihaDrTcPQDbuXmNn_5iEjSjRbOe--kRqVZ-svJ5zY,4340
14
- polyapi/generate.py,sha256=-U4KZRUeptuahxnEZUmjNDQGG3PFgfqyUYG5voPPztc,10398
13
+ polyapi/function_cli.py,sha256=htgmcx_dPmw4_5NKRgIivcwS7D8bkOsxCTOrJhzV3pU,3989
14
+ polyapi/generate.py,sha256=FEw0cNdv8bwvNf21qGElQrFqEfdLhlQ-bmvQdTzKp4U,10447
15
15
  polyapi/parser.py,sha256=Dqkg7cy9yae9HP4WcPtNzyZxrUrtDsGshFYW-vPvTzE,20263
16
16
  polyapi/poly_schemas.py,sha256=malK9s0DB_am0tMOZ0bwyjXZmABAQ1WnZpP-IJhpb2g,1845
17
17
  polyapi/prepare.py,sha256=Q8CWV4kmZ2dbXYVsud34AgJkj5ymcQ_IcYhLuikc9yk,6659
@@ -24,8 +24,8 @@ polyapi/typedefs.py,sha256=KniVl7vwcDOhgAJmHSgTJKkP0rKWvSLIPOGsWuf9jRU,2239
24
24
  polyapi/utils.py,sha256=Y2qMy3mf-1FNif2_IHV-ZD00OZlNmKhHN_7aPyqeWP0,8296
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.dev2.dist-info/licenses/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
28
- polyapi_python-0.3.3.dev2.dist-info/METADATA,sha256=spqoWLsjo2r_dusdwKtxb9HOIlSlhSLD40nHXbRitbU,5580
29
- polyapi_python-0.3.3.dev2.dist-info/WHEEL,sha256=L0N565qmK-3nM2eBoMNFszYJ_MTx03_tQ0CQu1bHLYo,91
30
- polyapi_python-0.3.3.dev2.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
31
- polyapi_python-0.3.3.dev2.dist-info/RECORD,,
27
+ polyapi_python-0.3.3.dev4.dist-info/licenses/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
28
+ polyapi_python-0.3.3.dev4.dist-info/METADATA,sha256=2fZGhUNKe3n3RPaeEz6YU_RWmD3DYXnzFMvcNmk6mXk,5580
29
+ polyapi_python-0.3.3.dev4.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
30
+ polyapi_python-0.3.3.dev4.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
31
+ polyapi_python-0.3.3.dev4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.0.1)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5