@autorest/python 6.37.1 → 6.37.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/serializers/__init__.py +7 -3
- package/generator/build/lib/pygen/codegen/serializers/model_serializer.py +1 -1
- package/generator/component-detection-pip-report.json +1 -1
- package/generator/dist/pygen-0.1.0-py3-none-any.whl +0 -0
- package/generator/pygen/codegen/serializers/__init__.py +7 -3
- package/generator/pygen/codegen/serializers/model_serializer.py +1 -1
- package/package.json +2 -2
- package/scripts/__pycache__/venvtools.cpython-310.pyc +0 -0
|
@@ -228,8 +228,8 @@ class JinjaSerializer(ReaderAndWriter):
|
|
|
228
228
|
file = template_name.replace(".jinja2", "")
|
|
229
229
|
output_name = root_of_sdk / file
|
|
230
230
|
if not self.read_file(output_name) or file in _REGENERATE_FILES:
|
|
231
|
-
if self.keep_version_file and file == "setup.py":
|
|
232
|
-
# don't regenerate setup.py file if the version file is more up to date
|
|
231
|
+
if self.keep_version_file and file == "setup.py" and not self.code_model.options["azure-arm"]:
|
|
232
|
+
# don't regenerate setup.py file if the version file is more up to date for data-plane
|
|
233
233
|
continue
|
|
234
234
|
self.write_file(
|
|
235
235
|
output_name,
|
|
@@ -487,7 +487,11 @@ class JinjaSerializer(ReaderAndWriter):
|
|
|
487
487
|
|
|
488
488
|
# pylint: disable=line-too-long
|
|
489
489
|
def exec_path(self, namespace: str) -> Path:
|
|
490
|
-
if
|
|
490
|
+
if (
|
|
491
|
+
self.code_model.options["no-namespace-folders"]
|
|
492
|
+
and not self.code_model.options["multiapi"]
|
|
493
|
+
and not self.code_model.options["azure-arm"]
|
|
494
|
+
):
|
|
491
495
|
# when output folder contains parts different from the namespace, we fall back to current folder directly.
|
|
492
496
|
# (e.g. https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-callautomation/swagger/SWAGGER.md)
|
|
493
497
|
return Path(".")
|
|
@@ -266,7 +266,7 @@ class DpgModelSerializer(_ModelSerializer):
|
|
|
266
266
|
)
|
|
267
267
|
if model.is_polymorphic:
|
|
268
268
|
file_import.add_submodule_import("typing", "Dict", ImportType.STDLIB)
|
|
269
|
-
if
|
|
269
|
+
if self.need_init(model):
|
|
270
270
|
file_import.add_submodule_import("typing", "overload", ImportType.STDLIB)
|
|
271
271
|
file_import.add_submodule_import("typing", "Mapping", ImportType.STDLIB)
|
|
272
272
|
file_import.add_submodule_import("typing", "Any", ImportType.STDLIB)
|
|
Binary file
|
|
@@ -228,8 +228,8 @@ class JinjaSerializer(ReaderAndWriter):
|
|
|
228
228
|
file = template_name.replace(".jinja2", "")
|
|
229
229
|
output_name = root_of_sdk / file
|
|
230
230
|
if not self.read_file(output_name) or file in _REGENERATE_FILES:
|
|
231
|
-
if self.keep_version_file and file == "setup.py":
|
|
232
|
-
# don't regenerate setup.py file if the version file is more up to date
|
|
231
|
+
if self.keep_version_file and file == "setup.py" and not self.code_model.options["azure-arm"]:
|
|
232
|
+
# don't regenerate setup.py file if the version file is more up to date for data-plane
|
|
233
233
|
continue
|
|
234
234
|
self.write_file(
|
|
235
235
|
output_name,
|
|
@@ -487,7 +487,11 @@ class JinjaSerializer(ReaderAndWriter):
|
|
|
487
487
|
|
|
488
488
|
# pylint: disable=line-too-long
|
|
489
489
|
def exec_path(self, namespace: str) -> Path:
|
|
490
|
-
if
|
|
490
|
+
if (
|
|
491
|
+
self.code_model.options["no-namespace-folders"]
|
|
492
|
+
and not self.code_model.options["multiapi"]
|
|
493
|
+
and not self.code_model.options["azure-arm"]
|
|
494
|
+
):
|
|
491
495
|
# when output folder contains parts different from the namespace, we fall back to current folder directly.
|
|
492
496
|
# (e.g. https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-callautomation/swagger/SWAGGER.md)
|
|
493
497
|
return Path(".")
|
|
@@ -266,7 +266,7 @@ class DpgModelSerializer(_ModelSerializer):
|
|
|
266
266
|
)
|
|
267
267
|
if model.is_polymorphic:
|
|
268
268
|
file_import.add_submodule_import("typing", "Dict", ImportType.STDLIB)
|
|
269
|
-
if
|
|
269
|
+
if self.need_init(model):
|
|
270
270
|
file_import.add_submodule_import("typing", "overload", ImportType.STDLIB)
|
|
271
271
|
file_import.add_submodule_import("typing", "Mapping", ImportType.STDLIB)
|
|
272
272
|
file_import.add_submodule_import("typing", "Any", ImportType.STDLIB)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autorest/python",
|
|
3
|
-
"version": "6.37.
|
|
3
|
+
"version": "6.37.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.14.
|
|
22
|
+
"@typespec/http-client-python": "~0.14.2",
|
|
23
23
|
"@autorest/system-requirements": "~1.0.2",
|
|
24
24
|
"fs-extra": "~11.2.0",
|
|
25
25
|
"tsx": "~4.19.1"
|
|
Binary file
|