payi 0.1.0a5__tar.gz → 0.1.0a6__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.
Potentially problematic release.
This version of payi might be problematic. Click here for more details.
- {payi-0.1.0a5 → payi-0.1.0a6}/.gitignore +1 -0
- payi-0.1.0a6/.release-please-manifest.json +3 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/CHANGELOG.md +8 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/PKG-INFO +1 -1
- {payi-0.1.0a5 → payi-0.1.0a6}/pyproject.toml +1 -1
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_utils/__init__.py +4 -1
- payi-0.1.0a6/src/payi/_utils/_reflection.py +42 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_version.py +1 -1
- payi-0.1.0a6/src/payi/lib/helpers.py +32 -0
- payi-0.1.0a5/.release-please-manifest.json +0 -3
- payi-0.1.0a5/src/payi/_utils/_reflection.py +0 -8
- {payi-0.1.0a5 → payi-0.1.0a6}/CONTRIBUTING.md +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/LICENSE +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/README.md +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/SECURITY.md +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/api.md +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/bin/check-release-environment +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/bin/publish-pypi +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/examples/.keep +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/mypy.ini +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/noxfile.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/release-please-config.json +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/requirements-dev.lock +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/requirements.lock +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/__init__.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_base_client.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_client.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_compat.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_constants.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_exceptions.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_files.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_models.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_qs.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_resource.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_response.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_streaming.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_types.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_utils/_logs.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_utils/_proxy.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_utils/_streams.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_utils/_sync.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_utils/_transform.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_utils/_typing.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/_utils/_utils.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/lib/.keep +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/py.typed +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/resources/__init__.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/resources/budgets/__init__.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/resources/budgets/budgets.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/resources/budgets/tags.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/resources/ingest.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/__init__.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budget_create_params.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budget_history_response.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budget_list_params.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budget_response.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budget_update_params.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budgets/__init__.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budgets/budget_tags_response.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budgets/tag_create_params.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budgets/tag_create_response.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budgets/tag_delete_response.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budgets/tag_list_response.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budgets/tag_remove_params.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budgets/tag_remove_response.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budgets/tag_update_params.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/budgets/tag_update_response.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/default_response.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/ingest_units_params.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/paged_budget_list.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/src/payi/types/successful_proxy_result.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/__init__.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/api_resources/__init__.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/api_resources/budgets/__init__.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/api_resources/budgets/test_tags.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/api_resources/test_budgets.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/api_resources/test_ingest.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/conftest.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/sample_file.txt +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/test_client.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/test_deepcopy.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/test_extract_files.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/test_files.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/test_models.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/test_qs.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/test_required_args.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/test_response.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/test_streaming.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/test_transform.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/test_utils/test_proxy.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/test_utils/test_typing.py +0 -0
- {payi-0.1.0a5 → payi-0.1.0a6}/tests/utils.py +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.6 (2024-06-30)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** update via SDK Studio ([#21](https://github.com/Pay-i/pay-i-python/issues/21)) ([daa4259](https://github.com/Pay-i/pay-i-python/commit/daa4259dc2156dd84843d3264362a6a53ee842c4))
|
|
10
|
+
|
|
3
11
|
## 0.1.0-alpha.5 (2024-06-28)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/Pay-i/pay-i-python/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)
|
|
@@ -49,4 +49,7 @@ from ._transform import (
|
|
|
49
49
|
maybe_transform as maybe_transform,
|
|
50
50
|
async_maybe_transform as async_maybe_transform,
|
|
51
51
|
)
|
|
52
|
-
from ._reflection import
|
|
52
|
+
from ._reflection import (
|
|
53
|
+
function_has_argument as function_has_argument,
|
|
54
|
+
assert_signatures_in_sync as assert_signatures_in_sync,
|
|
55
|
+
)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import inspect
|
|
4
|
+
from typing import Any, Callable
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def function_has_argument(func: Callable[..., Any], arg_name: str) -> bool:
|
|
8
|
+
"""Returns whether or not the given function has a specific parameter"""
|
|
9
|
+
sig = inspect.signature(func)
|
|
10
|
+
return arg_name in sig.parameters
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def assert_signatures_in_sync(
|
|
14
|
+
source_func: Callable[..., Any],
|
|
15
|
+
check_func: Callable[..., Any],
|
|
16
|
+
*,
|
|
17
|
+
exclude_params: set[str] = set(),
|
|
18
|
+
) -> None:
|
|
19
|
+
"""Ensure that the signature of the second function matches the first."""
|
|
20
|
+
|
|
21
|
+
check_sig = inspect.signature(check_func)
|
|
22
|
+
source_sig = inspect.signature(source_func)
|
|
23
|
+
|
|
24
|
+
errors: list[str] = []
|
|
25
|
+
|
|
26
|
+
for name, source_param in source_sig.parameters.items():
|
|
27
|
+
if name in exclude_params:
|
|
28
|
+
continue
|
|
29
|
+
|
|
30
|
+
custom_param = check_sig.parameters.get(name)
|
|
31
|
+
if not custom_param:
|
|
32
|
+
errors.append(f"the `{name}` param is missing")
|
|
33
|
+
continue
|
|
34
|
+
|
|
35
|
+
if custom_param.annotation != source_param.annotation:
|
|
36
|
+
errors.append(
|
|
37
|
+
f"types for the `{name}` param are do not match; source={repr(source_param.annotation)} checking={repr(source_param.annotation)}"
|
|
38
|
+
)
|
|
39
|
+
continue
|
|
40
|
+
|
|
41
|
+
if errors:
|
|
42
|
+
raise AssertionError(f"{len(errors)} errors encountered when comparing signatures:\n\n" + "\n\n".join(errors))
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Step 1: Define the new methods outside of the Payi class definition
|
|
2
|
+
from typing import Dict, List, Union
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def create_budget_header_from_ids(budget_ids: List[str]) -> Dict[str, str]:
|
|
6
|
+
if not isinstance(budget_ids, list): # type: ignore
|
|
7
|
+
raise TypeError("budget_ids must be a list")
|
|
8
|
+
|
|
9
|
+
valid_ids = [id.strip() for id in budget_ids if isinstance(id, str) and id.strip()] # type: ignore
|
|
10
|
+
|
|
11
|
+
return {"xProxy-Budget-IDs": ",".join(valid_ids)} if valid_ids else {}
|
|
12
|
+
|
|
13
|
+
def create_request_header_from_tags(request_tags: List[str]) -> Dict[str, str]:
|
|
14
|
+
if not isinstance(request_tags, list): # type: ignore
|
|
15
|
+
raise TypeError("request_tags must be a list")
|
|
16
|
+
|
|
17
|
+
valid_tags = [tag.strip() for tag in request_tags if isinstance(tag, str) and tag.strip()] # type: ignore
|
|
18
|
+
|
|
19
|
+
return {"xProxy-Request-Tags": ",".join(valid_tags)} if valid_tags else {}
|
|
20
|
+
|
|
21
|
+
def create_headers(
|
|
22
|
+
budget_ids: Union[List[str], None] = None,
|
|
23
|
+
request_tags: Union[List[str], None] = None
|
|
24
|
+
) -> Dict[str, str]:
|
|
25
|
+
headers: Dict[str, str] = {}
|
|
26
|
+
|
|
27
|
+
if budget_ids:
|
|
28
|
+
headers.update(create_budget_header_from_ids(budget_ids))
|
|
29
|
+
if request_tags:
|
|
30
|
+
headers.update(create_request_header_from_tags(request_tags))
|
|
31
|
+
|
|
32
|
+
return headers
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import inspect
|
|
2
|
-
from typing import Any, Callable
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def function_has_argument(func: Callable[..., Any], arg_name: str) -> bool:
|
|
6
|
-
"""Returns whether or not the given function has a specific parameter"""
|
|
7
|
-
sig = inspect.signature(func)
|
|
8
|
-
return arg_name in sig.parameters
|
|
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
|
|
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
|
|
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
|