@autorest/python 6.34.1 → 6.34.2
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.
- package/generator/build/lib/pygen/codegen/models/operation_group.py +13 -1
- package/generator/build/lib/pygen/codegen/models/paging_operation.py +4 -0
- package/generator/build/lib/pygen/codegen/serializers/builder_serializer.py +11 -0
- package/generator/build/lib/pygen/codegen/templates/operation_group.py.jinja2 +2 -2
- package/generator/build/lib/pygen/codegen/templates/operation_groups_container.py.jinja2 +0 -1
- package/generator/component-detection-pip-report.json +8 -13
- package/generator/dist/pygen-0.1.0-py3-none-any.whl +0 -0
- package/generator/pygen/codegen/models/operation_group.py +13 -1
- package/generator/pygen/codegen/models/paging_operation.py +4 -0
- package/generator/pygen/codegen/serializers/builder_serializer.py +11 -0
- package/generator/pygen/codegen/templates/operation_group.py.jinja2 +2 -2
- package/generator/pygen/codegen/templates/operation_groups_container.py.jinja2 +0 -1
- package/package.json +2 -2
- package/scripts/__pycache__/venvtools.cpython-310.pyc +0 -0
|
@@ -64,7 +64,9 @@ class OperationGroup(BaseModel):
|
|
|
64
64
|
)
|
|
65
65
|
|
|
66
66
|
def base_class(self, async_mode: bool) -> str:
|
|
67
|
-
pipeline_client =
|
|
67
|
+
pipeline_client = (
|
|
68
|
+
f"{'Async' if async_mode else ''}PipelineClient[HttpRequest, {'Async' if async_mode else ''}HttpResponse]"
|
|
69
|
+
)
|
|
68
70
|
base_classes: List[str] = []
|
|
69
71
|
if self.is_mixin:
|
|
70
72
|
base_classes.append(f"ClientMixinABC[{pipeline_client}, {self.client.name}Configuration]")
|
|
@@ -166,6 +168,16 @@ class OperationGroup(BaseModel):
|
|
|
166
168
|
"ClientMixinABC",
|
|
167
169
|
ImportType.LOCAL,
|
|
168
170
|
)
|
|
171
|
+
file_import.add_submodule_import(
|
|
172
|
+
"rest",
|
|
173
|
+
"HttpRequest",
|
|
174
|
+
ImportType.SDKCORE,
|
|
175
|
+
)
|
|
176
|
+
file_import.add_submodule_import(
|
|
177
|
+
"rest",
|
|
178
|
+
f"{'Async' if async_mode else ''}HttpResponse",
|
|
179
|
+
ImportType.SDKCORE,
|
|
180
|
+
)
|
|
169
181
|
else:
|
|
170
182
|
file_import.add_msrest_import(
|
|
171
183
|
serialize_namespace=kwargs.get("serialize_namespace", self.code_model.namespace),
|
|
@@ -16,6 +16,7 @@ from .imports import ImportType, FileImport, TypingSection
|
|
|
16
16
|
from .parameter_list import ParameterList
|
|
17
17
|
from .model_type import ModelType
|
|
18
18
|
from .list_type import ListType
|
|
19
|
+
from .parameter import Parameter
|
|
19
20
|
|
|
20
21
|
if TYPE_CHECKING:
|
|
21
22
|
from .code_model import CodeModel
|
|
@@ -59,6 +60,9 @@ class PagingOperationBase(OperationBase[PagingResponseType]):
|
|
|
59
60
|
self.pager_sync: str = yaml_data.get("pagerSync") or f"{self.code_model.core_library}.paging.ItemPaged"
|
|
60
61
|
self.pager_async: str = yaml_data.get("pagerAsync") or f"{self.code_model.core_library}.paging.AsyncItemPaged"
|
|
61
62
|
self.continuation_token: Dict[str, Any] = yaml_data.get("continuationToken", {})
|
|
63
|
+
self.next_link_reinjected_parameters: List[Parameter] = [
|
|
64
|
+
Parameter.from_yaml(p, code_model) for p in yaml_data.get("nextLinkReInjectedParameters", [])
|
|
65
|
+
]
|
|
62
66
|
|
|
63
67
|
@property
|
|
64
68
|
def has_continuation_token(self) -> bool:
|
|
@@ -1276,6 +1276,17 @@ class _PagingOperationSerializer(_OperationSerializer[PagingOperationType]):
|
|
|
1276
1276
|
else api_version_param.full_client_name
|
|
1277
1277
|
)
|
|
1278
1278
|
retval.append(f'_next_request_params["api-version"] = {api_version}')
|
|
1279
|
+
if builder.next_link_reinjected_parameters:
|
|
1280
|
+
for param in builder.next_link_reinjected_parameters:
|
|
1281
|
+
if param.location == ParameterLocation.QUERY:
|
|
1282
|
+
retval.extend(
|
|
1283
|
+
self.parameter_serializer.serialize_query_header(
|
|
1284
|
+
param,
|
|
1285
|
+
"next_request_params",
|
|
1286
|
+
self.serializer_name,
|
|
1287
|
+
self.code_model.is_legacy,
|
|
1288
|
+
)
|
|
1289
|
+
)
|
|
1279
1290
|
query_str = ", params=_next_request_params"
|
|
1280
1291
|
next_link_str = "urllib.parse.urljoin(next_link, _parsed_next_link.path)"
|
|
1281
1292
|
except StopIteration:
|
|
@@ -29,7 +29,7 @@ class {{ operation_group.class_name }}: {{ operation_group.pylint_disable() }}
|
|
|
29
29
|
models = _models
|
|
30
30
|
|
|
31
31
|
{% endif %}
|
|
32
|
-
def __init__(self, *args, **kwargs)
|
|
32
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
33
33
|
input_args = list(args)
|
|
34
34
|
self._client: {{ 'Async' if async_mode else ''}}PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
35
35
|
self._config: {{ operation_group.client.name }}Configuration = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
@@ -48,7 +48,7 @@ class {{ operation_group.class_name }}: {{ operation_group.pylint_disable() }}
|
|
|
48
48
|
{{ check_abstract_methods() }}
|
|
49
49
|
{% elif operation_group.has_abstract_operations %}
|
|
50
50
|
|
|
51
|
-
def __init__(self)
|
|
51
|
+
def __init__(self) -> None:
|
|
52
52
|
{{ check_abstract_methods() }}
|
|
53
53
|
{% endif %}
|
|
54
54
|
{% if operation_group.is_mixin and code_model.options["multiapi"] %}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{% import 'operation_tools.jinja2' as op_tools %}
|
|
2
2
|
{% set operations_description = "async operations" if async_mode else "operations" %}
|
|
3
|
-
{% set return_none_type_annotation = " -> None" if async_mode else "" %}
|
|
4
3
|
# coding=utf-8
|
|
5
4
|
{% if code_model.license_header %}
|
|
6
5
|
{{ code_model.license_header }}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1",
|
|
3
|
-
"pip_version": "25.
|
|
3
|
+
"pip_version": "25.1.1",
|
|
4
4
|
"install": [
|
|
5
5
|
{
|
|
6
6
|
"download_info": {
|
|
7
|
-
"url": "https://files.pythonhosted.org/packages/
|
|
7
|
+
"url": "https://files.pythonhosted.org/packages/53/7e/5d8af3317ddbf9519b687bd1c39d8737fde07d97f54df65553faca5cffb1/setuptools-80.3.1-py3-none-any.whl",
|
|
8
8
|
"archive_info": {
|
|
9
|
-
"hash": "sha256=
|
|
9
|
+
"hash": "sha256=ea8e00d7992054c4c592aeb892f6ad51fe1b4d90cc6947cc45c45717c40ec537",
|
|
10
10
|
"hashes": {
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "ea8e00d7992054c4c592aeb892f6ad51fe1b4d90cc6947cc45c45717c40ec537"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
},
|
|
@@ -18,10 +18,7 @@
|
|
|
18
18
|
"metadata": {
|
|
19
19
|
"metadata_version": "2.4",
|
|
20
20
|
"name": "setuptools",
|
|
21
|
-
"version": "
|
|
22
|
-
"dynamic": [
|
|
23
|
-
"license-file"
|
|
24
|
-
],
|
|
21
|
+
"version": "80.3.1",
|
|
25
22
|
"summary": "Easily download, build, install, upgrade, and uninstall Python packages",
|
|
26
23
|
"description_content_type": "text/x-rst",
|
|
27
24
|
"keywords": [
|
|
@@ -33,9 +30,7 @@
|
|
|
33
30
|
"management"
|
|
34
31
|
],
|
|
35
32
|
"author_email": "Python Packaging Authority <distutils-sig@python.org>",
|
|
36
|
-
"
|
|
37
|
-
"LICENSE"
|
|
38
|
-
],
|
|
33
|
+
"license_expression": "MIT",
|
|
39
34
|
"classifier": [
|
|
40
35
|
"Development Status :: 5 - Production/Stable",
|
|
41
36
|
"Intended Audience :: Developers",
|
|
@@ -125,9 +120,9 @@
|
|
|
125
120
|
"implementation_version": "3.9.21",
|
|
126
121
|
"os_name": "posix",
|
|
127
122
|
"platform_machine": "x86_64",
|
|
128
|
-
"platform_release": "5.15.0-
|
|
123
|
+
"platform_release": "5.15.0-1088-azure",
|
|
129
124
|
"platform_system": "Linux",
|
|
130
|
-
"platform_version": "#
|
|
125
|
+
"platform_version": "#97~20.04.1-Ubuntu SMP Wed Apr 23 13:25:03 UTC 2025",
|
|
131
126
|
"python_full_version": "3.9.21",
|
|
132
127
|
"platform_python_implementation": "CPython",
|
|
133
128
|
"python_version": "3.9",
|
|
Binary file
|
|
@@ -64,7 +64,9 @@ class OperationGroup(BaseModel):
|
|
|
64
64
|
)
|
|
65
65
|
|
|
66
66
|
def base_class(self, async_mode: bool) -> str:
|
|
67
|
-
pipeline_client =
|
|
67
|
+
pipeline_client = (
|
|
68
|
+
f"{'Async' if async_mode else ''}PipelineClient[HttpRequest, {'Async' if async_mode else ''}HttpResponse]"
|
|
69
|
+
)
|
|
68
70
|
base_classes: List[str] = []
|
|
69
71
|
if self.is_mixin:
|
|
70
72
|
base_classes.append(f"ClientMixinABC[{pipeline_client}, {self.client.name}Configuration]")
|
|
@@ -166,6 +168,16 @@ class OperationGroup(BaseModel):
|
|
|
166
168
|
"ClientMixinABC",
|
|
167
169
|
ImportType.LOCAL,
|
|
168
170
|
)
|
|
171
|
+
file_import.add_submodule_import(
|
|
172
|
+
"rest",
|
|
173
|
+
"HttpRequest",
|
|
174
|
+
ImportType.SDKCORE,
|
|
175
|
+
)
|
|
176
|
+
file_import.add_submodule_import(
|
|
177
|
+
"rest",
|
|
178
|
+
f"{'Async' if async_mode else ''}HttpResponse",
|
|
179
|
+
ImportType.SDKCORE,
|
|
180
|
+
)
|
|
169
181
|
else:
|
|
170
182
|
file_import.add_msrest_import(
|
|
171
183
|
serialize_namespace=kwargs.get("serialize_namespace", self.code_model.namespace),
|
|
@@ -16,6 +16,7 @@ from .imports import ImportType, FileImport, TypingSection
|
|
|
16
16
|
from .parameter_list import ParameterList
|
|
17
17
|
from .model_type import ModelType
|
|
18
18
|
from .list_type import ListType
|
|
19
|
+
from .parameter import Parameter
|
|
19
20
|
|
|
20
21
|
if TYPE_CHECKING:
|
|
21
22
|
from .code_model import CodeModel
|
|
@@ -59,6 +60,9 @@ class PagingOperationBase(OperationBase[PagingResponseType]):
|
|
|
59
60
|
self.pager_sync: str = yaml_data.get("pagerSync") or f"{self.code_model.core_library}.paging.ItemPaged"
|
|
60
61
|
self.pager_async: str = yaml_data.get("pagerAsync") or f"{self.code_model.core_library}.paging.AsyncItemPaged"
|
|
61
62
|
self.continuation_token: Dict[str, Any] = yaml_data.get("continuationToken", {})
|
|
63
|
+
self.next_link_reinjected_parameters: List[Parameter] = [
|
|
64
|
+
Parameter.from_yaml(p, code_model) for p in yaml_data.get("nextLinkReInjectedParameters", [])
|
|
65
|
+
]
|
|
62
66
|
|
|
63
67
|
@property
|
|
64
68
|
def has_continuation_token(self) -> bool:
|
|
@@ -1276,6 +1276,17 @@ class _PagingOperationSerializer(_OperationSerializer[PagingOperationType]):
|
|
|
1276
1276
|
else api_version_param.full_client_name
|
|
1277
1277
|
)
|
|
1278
1278
|
retval.append(f'_next_request_params["api-version"] = {api_version}')
|
|
1279
|
+
if builder.next_link_reinjected_parameters:
|
|
1280
|
+
for param in builder.next_link_reinjected_parameters:
|
|
1281
|
+
if param.location == ParameterLocation.QUERY:
|
|
1282
|
+
retval.extend(
|
|
1283
|
+
self.parameter_serializer.serialize_query_header(
|
|
1284
|
+
param,
|
|
1285
|
+
"next_request_params",
|
|
1286
|
+
self.serializer_name,
|
|
1287
|
+
self.code_model.is_legacy,
|
|
1288
|
+
)
|
|
1289
|
+
)
|
|
1279
1290
|
query_str = ", params=_next_request_params"
|
|
1280
1291
|
next_link_str = "urllib.parse.urljoin(next_link, _parsed_next_link.path)"
|
|
1281
1292
|
except StopIteration:
|
|
@@ -29,7 +29,7 @@ class {{ operation_group.class_name }}: {{ operation_group.pylint_disable() }}
|
|
|
29
29
|
models = _models
|
|
30
30
|
|
|
31
31
|
{% endif %}
|
|
32
|
-
def __init__(self, *args, **kwargs)
|
|
32
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
33
33
|
input_args = list(args)
|
|
34
34
|
self._client: {{ 'Async' if async_mode else ''}}PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
35
35
|
self._config: {{ operation_group.client.name }}Configuration = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
@@ -48,7 +48,7 @@ class {{ operation_group.class_name }}: {{ operation_group.pylint_disable() }}
|
|
|
48
48
|
{{ check_abstract_methods() }}
|
|
49
49
|
{% elif operation_group.has_abstract_operations %}
|
|
50
50
|
|
|
51
|
-
def __init__(self)
|
|
51
|
+
def __init__(self) -> None:
|
|
52
52
|
{{ check_abstract_methods() }}
|
|
53
53
|
{% endif %}
|
|
54
54
|
{% if operation_group.is_mixin and code_model.options["multiapi"] %}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{% import 'operation_tools.jinja2' as op_tools %}
|
|
2
2
|
{% set operations_description = "async operations" if async_mode else "operations" %}
|
|
3
|
-
{% set return_none_type_annotation = " -> None" if async_mode else "" %}
|
|
4
3
|
# coding=utf-8
|
|
5
4
|
{% if code_model.license_header %}
|
|
6
5
|
{{ code_model.license_header }}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autorest/python",
|
|
3
|
-
"version": "6.34.
|
|
3
|
+
"version": "6.34.2",
|
|
4
4
|
"description": "The Python extension for generators in AutoRest.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@typespec/http-client-python": "~0.11.
|
|
22
|
+
"@typespec/http-client-python": "~0.11.3",
|
|
23
23
|
"@autorest/system-requirements": "~1.0.2",
|
|
24
24
|
"fs-extra": "~11.2.0",
|
|
25
25
|
"tsx": "~4.19.1"
|
|
Binary file
|