@autorest/python 6.48.3 → 6.49.1
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.py +5 -1
- package/generator/build/lib/pygen/codegen/models/paging_operation.py +5 -1
- package/generator/component-detection-pip-report.json +7 -7
- package/generator/dist/pygen-0.1.0-py3-none-any.whl +0 -0
- package/generator/pygen/codegen/models/operation.py +5 -1
- package/generator/pygen/codegen/models/paging_operation.py +5 -1
- package/package.json +2 -2
- package/scripts/__pycache__/venvtools.cpython-310.pyc +0 -0
|
@@ -284,6 +284,10 @@ class OperationBase( # pylint: disable=too-many-public-methods,too-many-instanc
|
|
|
284
284
|
def need_deserialize(self) -> bool:
|
|
285
285
|
return any(r.type and not isinstance(r.type, BinaryIteratorType) for r in self.responses)
|
|
286
286
|
|
|
287
|
+
@property
|
|
288
|
+
def enable_import_deserialize_xml(self) -> bool:
|
|
289
|
+
return any(xml_serializable(str(r.default_content_type)) for r in self.responses + self.exceptions)
|
|
290
|
+
|
|
287
291
|
def imports( # pylint: disable=too-many-branches, disable=too-many-statements
|
|
288
292
|
self, async_mode: bool, **kwargs: Any
|
|
289
293
|
) -> FileImport:
|
|
@@ -443,7 +447,7 @@ class OperationBase( # pylint: disable=too-many-public-methods,too-many-instanc
|
|
|
443
447
|
ImportType.LOCAL,
|
|
444
448
|
)
|
|
445
449
|
file_import.add_import("json", ImportType.STDLIB)
|
|
446
|
-
if
|
|
450
|
+
if self.enable_import_deserialize_xml:
|
|
447
451
|
file_import.add_submodule_import(relative_path, "_deserialize_xml", ImportType.LOCAL)
|
|
448
452
|
elif self.need_deserialize:
|
|
449
453
|
file_import.add_submodule_import(relative_path, "_deserialize", ImportType.LOCAL)
|
|
@@ -17,6 +17,7 @@ from .parameter_list import ParameterList
|
|
|
17
17
|
from .model_type import ModelType
|
|
18
18
|
from .list_type import ListType
|
|
19
19
|
from .parameter import Parameter
|
|
20
|
+
from ...utils import xml_serializable
|
|
20
21
|
|
|
21
22
|
if TYPE_CHECKING:
|
|
22
23
|
from .code_model import CodeModel
|
|
@@ -135,6 +136,10 @@ class PagingOperationBase(OperationBase[PagingResponseType]):
|
|
|
135
136
|
def has_optional_return_type(self) -> bool:
|
|
136
137
|
return False
|
|
137
138
|
|
|
139
|
+
@property
|
|
140
|
+
def enable_import_deserialize_xml(self):
|
|
141
|
+
return any(xml_serializable(str(r.default_content_type)) for r in self.exceptions)
|
|
142
|
+
|
|
138
143
|
def imports(self, async_mode: bool, **kwargs: Any) -> FileImport:
|
|
139
144
|
if self.abstract:
|
|
140
145
|
return FileImport(self.code_model)
|
|
@@ -185,7 +190,6 @@ class PagingOperationBase(OperationBase[PagingResponseType]):
|
|
|
185
190
|
file_import.add_submodule_import(relative_path, "_deserialize", ImportType.LOCAL)
|
|
186
191
|
if self.is_xml_paging:
|
|
187
192
|
file_import.add_submodule_import("xml.etree", "ElementTree", ImportType.STDLIB, alias="ET")
|
|
188
|
-
file_import.add_submodule_import(relative_path, "_convert_element", ImportType.LOCAL)
|
|
189
193
|
return file_import
|
|
190
194
|
|
|
191
195
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1",
|
|
3
|
-
"pip_version": "26.0",
|
|
3
|
+
"pip_version": "26.0.1",
|
|
4
4
|
"install": [
|
|
5
5
|
{
|
|
6
6
|
"download_info": {
|
|
7
|
-
"url": "https://files.pythonhosted.org/packages/
|
|
7
|
+
"url": "https://files.pythonhosted.org/packages/e1/c6/76dc613121b793286a3f91621d7b75a2b493e0390ddca50f11993eadf192/setuptools-82.0.0-py3-none-any.whl",
|
|
8
8
|
"archive_info": {
|
|
9
|
-
"hash": "sha256=
|
|
9
|
+
"hash": "sha256=70b18734b607bd1da571d097d236cfcfacaf01de45717d59e6e04b96877532e0",
|
|
10
10
|
"hashes": {
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "70b18734b607bd1da571d097d236cfcfacaf01de45717d59e6e04b96877532e0"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
},
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"metadata": {
|
|
19
19
|
"metadata_version": "2.4",
|
|
20
20
|
"name": "setuptools",
|
|
21
|
-
"version": "
|
|
21
|
+
"version": "82.0.0",
|
|
22
22
|
"dynamic": [
|
|
23
23
|
"license-file"
|
|
24
24
|
],
|
|
@@ -93,11 +93,11 @@
|
|
|
93
93
|
"more_itertools; extra == \"core\"",
|
|
94
94
|
"pytest-checkdocs>=2.4; extra == \"check\"",
|
|
95
95
|
"pytest-ruff>=0.2.1; sys_platform != \"cygwin\" and extra == \"check\"",
|
|
96
|
-
"ruff>=0.
|
|
96
|
+
"ruff>=0.13.0; sys_platform != \"cygwin\" and extra == \"check\"",
|
|
97
97
|
"pytest-cov; extra == \"cover\"",
|
|
98
98
|
"pytest-enabler>=2.2; extra == \"enabler\"",
|
|
99
99
|
"pytest-mypy; extra == \"type\"",
|
|
100
|
-
"mypy==1.
|
|
100
|
+
"mypy==1.18.*; extra == \"type\"",
|
|
101
101
|
"importlib_metadata>=7.0.2; python_version < \"3.10\" and extra == \"type\"",
|
|
102
102
|
"jaraco.develop>=7.21; sys_platform != \"cygwin\" and extra == \"type\""
|
|
103
103
|
],
|
|
Binary file
|
|
@@ -284,6 +284,10 @@ class OperationBase( # pylint: disable=too-many-public-methods,too-many-instanc
|
|
|
284
284
|
def need_deserialize(self) -> bool:
|
|
285
285
|
return any(r.type and not isinstance(r.type, BinaryIteratorType) for r in self.responses)
|
|
286
286
|
|
|
287
|
+
@property
|
|
288
|
+
def enable_import_deserialize_xml(self) -> bool:
|
|
289
|
+
return any(xml_serializable(str(r.default_content_type)) for r in self.responses + self.exceptions)
|
|
290
|
+
|
|
287
291
|
def imports( # pylint: disable=too-many-branches, disable=too-many-statements
|
|
288
292
|
self, async_mode: bool, **kwargs: Any
|
|
289
293
|
) -> FileImport:
|
|
@@ -443,7 +447,7 @@ class OperationBase( # pylint: disable=too-many-public-methods,too-many-instanc
|
|
|
443
447
|
ImportType.LOCAL,
|
|
444
448
|
)
|
|
445
449
|
file_import.add_import("json", ImportType.STDLIB)
|
|
446
|
-
if
|
|
450
|
+
if self.enable_import_deserialize_xml:
|
|
447
451
|
file_import.add_submodule_import(relative_path, "_deserialize_xml", ImportType.LOCAL)
|
|
448
452
|
elif self.need_deserialize:
|
|
449
453
|
file_import.add_submodule_import(relative_path, "_deserialize", ImportType.LOCAL)
|
|
@@ -17,6 +17,7 @@ from .parameter_list import ParameterList
|
|
|
17
17
|
from .model_type import ModelType
|
|
18
18
|
from .list_type import ListType
|
|
19
19
|
from .parameter import Parameter
|
|
20
|
+
from ...utils import xml_serializable
|
|
20
21
|
|
|
21
22
|
if TYPE_CHECKING:
|
|
22
23
|
from .code_model import CodeModel
|
|
@@ -135,6 +136,10 @@ class PagingOperationBase(OperationBase[PagingResponseType]):
|
|
|
135
136
|
def has_optional_return_type(self) -> bool:
|
|
136
137
|
return False
|
|
137
138
|
|
|
139
|
+
@property
|
|
140
|
+
def enable_import_deserialize_xml(self):
|
|
141
|
+
return any(xml_serializable(str(r.default_content_type)) for r in self.exceptions)
|
|
142
|
+
|
|
138
143
|
def imports(self, async_mode: bool, **kwargs: Any) -> FileImport:
|
|
139
144
|
if self.abstract:
|
|
140
145
|
return FileImport(self.code_model)
|
|
@@ -185,7 +190,6 @@ class PagingOperationBase(OperationBase[PagingResponseType]):
|
|
|
185
190
|
file_import.add_submodule_import(relative_path, "_deserialize", ImportType.LOCAL)
|
|
186
191
|
if self.is_xml_paging:
|
|
187
192
|
file_import.add_submodule_import("xml.etree", "ElementTree", ImportType.STDLIB, alias="ET")
|
|
188
|
-
file_import.add_submodule_import(relative_path, "_convert_element", ImportType.LOCAL)
|
|
189
193
|
return file_import
|
|
190
194
|
|
|
191
195
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autorest/python",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.49.1",
|
|
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.
|
|
22
|
+
"@typespec/http-client-python": "~0.27.1",
|
|
23
23
|
"@autorest/system-requirements": "~1.0.2",
|
|
24
24
|
"fs-extra": "~11.2.0",
|
|
25
25
|
"tsx": "~4.19.1"
|
|
Binary file
|