polyapi-python 0.2.3.dev1__tar.gz → 0.2.3.dev3__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.2.3.dev1 → polyapi-python-0.2.3.dev3}/PKG-INFO +2 -2
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/function_cli.py +9 -1
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi_python.egg-info/PKG-INFO +2 -2
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi_python.egg-info/requires.txt +1 -1
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/pyproject.toml +2 -2
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/LICENSE +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/README.md +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/__init__.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/__main__.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/api.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/auth.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/cli.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/config.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/constants.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/error_handler.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/exceptions.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/execute.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/generate.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/py.typed +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/schema.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/server.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/typedefs.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/utils.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/variables.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi/webhook.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi_python.egg-info/SOURCES.txt +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi_python.egg-info/dependency_links.txt +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi_python.egg-info/top_level.txt +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/setup.cfg +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/tests/test_api.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/tests/test_auth.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/tests/test_function_cli.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/tests/test_server.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/tests/test_utils.py +0 -0
- {polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/tests/test_variables.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: polyapi-python
|
|
3
|
-
Version: 0.2.3.
|
|
3
|
+
Version: 0.2.3.dev3
|
|
4
4
|
Summary: The PolyAPI Python Client
|
|
5
5
|
Author-email: Dan Fellin <dan@polyapi.io>
|
|
6
6
|
License: MIT License
|
|
@@ -31,7 +31,7 @@ License-File: LICENSE
|
|
|
31
31
|
Requires-Dist: requests==2.31.0
|
|
32
32
|
Requires-Dist: typing_extensions==4.10.0
|
|
33
33
|
Requires-Dist: jsonschema-gentypes==2.4.0
|
|
34
|
-
Requires-Dist: pydantic==2.
|
|
34
|
+
Requires-Dist: pydantic==2.5.3
|
|
35
35
|
Requires-Dist: stdlib_list==0.10.0
|
|
36
36
|
Requires-Dist: colorama==0.4.4
|
|
37
37
|
Requires-Dist: python-socketio[asyncio_client]==5.11.1
|
|
@@ -8,6 +8,7 @@ from typing_extensions import _TypedDictMeta # type: ignore
|
|
|
8
8
|
import requests
|
|
9
9
|
from stdlib_list import stdlib_list
|
|
10
10
|
from pydantic import TypeAdapter
|
|
11
|
+
from importlib.metadata import packages_distributions
|
|
11
12
|
from polyapi.generate import get_functions_and_parse, generate_functions
|
|
12
13
|
from polyapi.config import get_api_key_and_url
|
|
13
14
|
from polyapi.constants import PYTHON_TO_JSONSCHEMA_TYPE_MAP
|
|
@@ -112,6 +113,12 @@ def _parse_code(code: str, function_name: str):
|
|
|
112
113
|
schemas = _get_schemas(code)
|
|
113
114
|
|
|
114
115
|
parsed_code = ast.parse(code)
|
|
116
|
+
|
|
117
|
+
# the pip name and the import name might be different
|
|
118
|
+
# e.g. kube_hunter is the import name, but the pip name is kube-hunter
|
|
119
|
+
# see https://stackoverflow.com/a/75144378
|
|
120
|
+
pip_name_lookup = packages_distributions()
|
|
121
|
+
|
|
115
122
|
for node in ast.iter_child_nodes(parsed_code):
|
|
116
123
|
if isinstance(node, ast.Import):
|
|
117
124
|
for name in node.names:
|
|
@@ -119,7 +126,8 @@ def _parse_code(code: str, function_name: str):
|
|
|
119
126
|
requirements.append(name.name)
|
|
120
127
|
elif isinstance(node, ast.ImportFrom):
|
|
121
128
|
if node.module and node.module not in BASE_REQUIREMENTS:
|
|
122
|
-
|
|
129
|
+
req = pip_name_lookup[node.module][0]
|
|
130
|
+
requirements.append(req)
|
|
123
131
|
|
|
124
132
|
elif isinstance(node, ast.FunctionDef) and node.name == function_name:
|
|
125
133
|
function_args = [arg for arg in node.args.args]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: polyapi-python
|
|
3
|
-
Version: 0.2.3.
|
|
3
|
+
Version: 0.2.3.dev3
|
|
4
4
|
Summary: The PolyAPI Python Client
|
|
5
5
|
Author-email: Dan Fellin <dan@polyapi.io>
|
|
6
6
|
License: MIT License
|
|
@@ -31,7 +31,7 @@ License-File: LICENSE
|
|
|
31
31
|
Requires-Dist: requests==2.31.0
|
|
32
32
|
Requires-Dist: typing_extensions==4.10.0
|
|
33
33
|
Requires-Dist: jsonschema-gentypes==2.4.0
|
|
34
|
-
Requires-Dist: pydantic==2.
|
|
34
|
+
Requires-Dist: pydantic==2.5.3
|
|
35
35
|
Requires-Dist: stdlib_list==0.10.0
|
|
36
36
|
Requires-Dist: colorama==0.4.4
|
|
37
37
|
Requires-Dist: python-socketio[asyncio_client]==5.11.1
|
|
@@ -3,14 +3,14 @@ requires = ["setuptools>=61.2", "wheel"]
|
|
|
3
3
|
|
|
4
4
|
[project]
|
|
5
5
|
name = "polyapi-python"
|
|
6
|
-
version = "0.2.3.
|
|
6
|
+
version = "0.2.3.dev3"
|
|
7
7
|
description = "The PolyAPI Python Client"
|
|
8
8
|
authors = [{ name = "Dan Fellin", email = "dan@polyapi.io" }]
|
|
9
9
|
dependencies = [
|
|
10
10
|
"requests==2.31.0",
|
|
11
11
|
"typing_extensions==4.10.0",
|
|
12
12
|
"jsonschema-gentypes==2.4.0",
|
|
13
|
-
"pydantic==2.
|
|
13
|
+
"pydantic==2.5.3",
|
|
14
14
|
"stdlib_list==0.10.0",
|
|
15
15
|
"colorama==0.4.4",
|
|
16
16
|
"python-socketio[asyncio_client]==5.11.1",
|
|
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.2.3.dev1 → polyapi-python-0.2.3.dev3}/polyapi_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{polyapi-python-0.2.3.dev1 → polyapi-python-0.2.3.dev3}/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
|