polyapi-python 0.3.18.dev4__tar.gz → 0.3.18.dev6__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.
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/PKG-INFO +2 -2
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/cli.py +12 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/generate.py +15 -4
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi_python.egg-info/PKG-INFO +2 -2
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi_python.egg-info/requires.txt +1 -1
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/pyproject.toml +2 -2
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_poly_custom.py +18 -1
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/LICENSE +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/README.md +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/__init__.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/__main__.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/api.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/auth.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/cli_constants.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/client.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/config.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/constants.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/deployables.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/error_handler.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/exceptions.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/execute.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/function_cli.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/http_client.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/parser.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/poly_schemas.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/poly_tables.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/prepare.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/py.typed +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/rendered_spec.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/schema.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/server.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/sync.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/typedefs.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/utils.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/variables.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi/webhook.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi_python.egg-info/SOURCES.txt +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi_python.egg-info/dependency_links.txt +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi_python.egg-info/top_level.txt +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/setup.cfg +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_api.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_async_proof.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_auth.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_deployables.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_generate.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_parser.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_poly_schemas.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_rendered_spec.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_schema.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_server.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_tabi.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/tests/test_utils.py +0 -0
- {polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/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.
|
|
3
|
+
Version: 0.3.18.dev6
|
|
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
|
|
@@ -32,7 +32,7 @@ Requires-Dist: requests==2.32.3
|
|
|
32
32
|
Requires-Dist: typing_extensions==4.12.2
|
|
33
33
|
Requires-Dist: jsonschema-gentypes==2.10.0
|
|
34
34
|
Requires-Dist: pydantic==2.8.0
|
|
35
|
-
Requires-Dist: stdlib_list==0.
|
|
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
38
|
Requires-Dist: truststore==0.8.0
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import sys
|
|
3
|
+
import tempfile
|
|
2
4
|
import argparse
|
|
3
5
|
|
|
4
6
|
from polyapi.utils import print_green, print_red
|
|
@@ -23,6 +25,16 @@ def _get_version_string():
|
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
def execute_from_cli():
|
|
28
|
+
# Redirect __pycache__ out of generated dirs to avoid window file-locking
|
|
29
|
+
# failures when rmtree dels on generate.
|
|
30
|
+
if 'PYTHONPYCACHEPREFIX' not in os.environ:
|
|
31
|
+
cache_dir = os.path.join(tempfile.gettempdir(), 'polyapi_pycache')
|
|
32
|
+
os.makedirs(cache_dir, exist_ok=True)
|
|
33
|
+
# here for children just in case
|
|
34
|
+
os.environ['PYTHONPYCACHEPREFIX'] = cache_dir
|
|
35
|
+
# For the startup py_initialize issue
|
|
36
|
+
sys.pycache_prefix = cache_dir
|
|
37
|
+
|
|
26
38
|
# First we setup all our argument parsing logic
|
|
27
39
|
# Then we parse the arguments (waaay at the bottom)
|
|
28
40
|
parser = argparse.ArgumentParser(
|
|
@@ -4,6 +4,7 @@ import uuid
|
|
|
4
4
|
import shutil
|
|
5
5
|
import logging
|
|
6
6
|
import tempfile
|
|
7
|
+
import stat
|
|
7
8
|
|
|
8
9
|
from copy import deepcopy
|
|
9
10
|
from typing import Any, List, Optional, Tuple, cast
|
|
@@ -209,23 +210,33 @@ def get_tables(specs: List[SpecificationDto]) -> List[TableSpecDto]:
|
|
|
209
210
|
return [cast(TableSpecDto, spec) for spec in specs if spec["type"] == "table"]
|
|
210
211
|
|
|
211
212
|
|
|
213
|
+
def _rmtree_readonly_handler(func, path, exc):
|
|
214
|
+
# Windows marks __pycache__ .pyc files read-only; clear the bit and retry.
|
|
215
|
+
os.chmod(path, stat.S_IWRITE)
|
|
216
|
+
func(path)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def _rmtree(path):
|
|
220
|
+
shutil.rmtree(path, onerror=_rmtree_readonly_handler)
|
|
221
|
+
|
|
222
|
+
|
|
212
223
|
def remove_old_library():
|
|
213
224
|
currdir = os.path.dirname(os.path.abspath(__file__))
|
|
214
225
|
path = os.path.join(currdir, "poly")
|
|
215
226
|
if os.path.exists(path):
|
|
216
|
-
|
|
227
|
+
_rmtree(path)
|
|
217
228
|
|
|
218
229
|
path = os.path.join(currdir, "vari")
|
|
219
230
|
if os.path.exists(path):
|
|
220
|
-
|
|
231
|
+
_rmtree(path)
|
|
221
232
|
|
|
222
233
|
path = os.path.join(currdir, "schemas")
|
|
223
234
|
if os.path.exists(path):
|
|
224
|
-
|
|
235
|
+
_rmtree(path)
|
|
225
236
|
|
|
226
237
|
path = os.path.join(currdir, "tabi")
|
|
227
238
|
if os.path.exists(path):
|
|
228
|
-
|
|
239
|
+
_rmtree(path)
|
|
229
240
|
|
|
230
241
|
|
|
231
242
|
def create_empty_schemas_module():
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polyapi-python
|
|
3
|
-
Version: 0.3.18.
|
|
3
|
+
Version: 0.3.18.dev6
|
|
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
|
|
@@ -32,7 +32,7 @@ Requires-Dist: requests==2.32.3
|
|
|
32
32
|
Requires-Dist: typing_extensions==4.12.2
|
|
33
33
|
Requires-Dist: jsonschema-gentypes==2.10.0
|
|
34
34
|
Requires-Dist: pydantic==2.8.0
|
|
35
|
-
Requires-Dist: stdlib_list==0.
|
|
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
38
|
Requires-Dist: truststore==0.8.0
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "polyapi-python"
|
|
7
|
-
version = "0.3.18.
|
|
7
|
+
version = "0.3.18.dev6"
|
|
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 = [
|
|
@@ -12,7 +12,7 @@ dependencies = [
|
|
|
12
12
|
"typing_extensions==4.12.2",
|
|
13
13
|
"jsonschema-gentypes==2.10.0",
|
|
14
14
|
"pydantic==2.8.0",
|
|
15
|
-
"stdlib_list==0.
|
|
15
|
+
"stdlib_list==0.11.1",
|
|
16
16
|
"colorama==0.4.4",
|
|
17
17
|
"python-socketio[asyncio_client]==5.11.1",
|
|
18
18
|
"truststore==0.8.0",
|
|
@@ -7,7 +7,16 @@ from concurrent.futures import ThreadPoolExecutor
|
|
|
7
7
|
def _reload_polyapi():
|
|
8
8
|
sys.modules.pop("polyapi", None)
|
|
9
9
|
sys.modules.pop("polyapi.cli", None)
|
|
10
|
-
|
|
10
|
+
polyapi = importlib.import_module("polyapi")
|
|
11
|
+
|
|
12
|
+
for module_name, module in list(sys.modules.items()):
|
|
13
|
+
if not module_name.startswith("polyapi.") or module_name == "polyapi.cli":
|
|
14
|
+
continue
|
|
15
|
+
submodule_name = module_name.removeprefix("polyapi.")
|
|
16
|
+
if "." not in submodule_name:
|
|
17
|
+
setattr(polyapi, submodule_name, module)
|
|
18
|
+
|
|
19
|
+
return polyapi
|
|
11
20
|
|
|
12
21
|
|
|
13
22
|
def test_import_polyapi_does_not_import_cli():
|
|
@@ -24,6 +33,14 @@ def test_cli_constants_shared_between_runtime_and_cli():
|
|
|
24
33
|
assert tuple(cli_module.CLI_COMMANDS) == cli_constants.CLI_COMMANDS
|
|
25
34
|
|
|
26
35
|
|
|
36
|
+
def test_reload_preserves_existing_submodule_bindings():
|
|
37
|
+
rendered_spec = importlib.import_module("polyapi.rendered_spec")
|
|
38
|
+
|
|
39
|
+
polyapi = _reload_polyapi()
|
|
40
|
+
|
|
41
|
+
assert polyapi.rendered_spec is rendered_spec
|
|
42
|
+
|
|
43
|
+
|
|
27
44
|
def test_poly_custom_nested_scopes_restore_previous_state():
|
|
28
45
|
polyapi = _reload_polyapi()
|
|
29
46
|
poly_custom = polyapi.polyCustom
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi_python.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{polyapi_python-0.3.18.dev4 → polyapi_python-0.3.18.dev6}/polyapi_python.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|