Skip to content

Commit 538d0dd

Browse files
committed
merge
2 parents 6bba912 + fcc5326 commit 538d0dd

File tree

1,235 files changed

+81023
-4215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,235 files changed

+81023
-4215
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
changeKind: fix
3+
packages:
4+
- "@autorest/python"
5+
- "@azure-tools/typespec-python"
6+
---
7+
8+
Fix import error about apiversion validation for nested operation groups
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
changeKind: dependencies
3+
packages:
4+
- "@autorest/python"
5+
- "@azure-tools/typespec-python"
6+
---
7+
8+
Bump generated code's dependency on `azure-core` to `1.37.0`
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
changeKind: internal
3+
packages:
4+
- "@autorest/python"
5+
- "@azure-tools/typespec-python"
6+
---
7+
8+
bump dev version of azure-http-specs to fix nightly build failure
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
changeKind: fix
3+
packages:
4+
- "@autorest/python"
5+
- "@azure-tools/typespec-python"
6+
---
7+
8+
Fix syntax error when model property is named "list" by using type alias to avoid naming conflicts
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
3+
changeKind: feature
4+
packages:
5+
- "@autorest/python"
6+
- "@azure-tools/typespec-python"
7+
---
8+
9+
Support multi-service scenario.

.chronus/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ changeKinds:
3434
versionPolicies:
3535
- name: python-generator
3636
type: lockstep
37-
step: minor
37+
step: patch
3838
packages:
3939
- "@azure-tools/typespec-python"
4040
- "@autorest/python"

packages/autorest.python/CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11
# Release
22

3+
## 6.45.1
4+
5+
### Bug Fixes
6+
7+
- [#3284](https://github.com/Azure/autorest.python/pull/3284) Persist mutations to mutable properties when accessed via attribute syntax
8+
9+
10+
## 6.45.0
11+
12+
### Features
13+
14+
- [#3280](https://github.com/Azure/autorest.python/pull/3280) Support encode for array of string in serialization and deserialization
15+
16+
### Bug Fixes
17+
18+
- [#3279](https://github.com/Azure/autorest.python/pull/3279) Fix bad indent
19+
20+
21+
## 6.44.0
22+
23+
### Features
24+
25+
- [#3246](https://github.com/Azure/autorest.python/pull/3246) Support SDK users defined customized serialization/deserialization function for external models
26+
27+
### Bug Fixes
28+
29+
- [#3264](https://github.com/Azure/autorest.python/pull/3264) Keep original client name for backcompat reasons when the name is only padded for tsp generations
30+
- [#3271](https://github.com/Azure/autorest.python/pull/3271) Fix for optional properties in flatten model to keep compatibility
31+
- [#3276](https://github.com/Azure/autorest.python/pull/3276) Fix multipart when files part is optional
32+
- [#3274](https://github.com/Azure/autorest.python/pull/3274) Fix serialization name for multipart
33+
34+
35+
## 6.43.0
36+
37+
### Features
38+
39+
- [#3268](https://github.com/Azure/autorest.python/pull/3268) Support customized http method to call next link for paging operation
40+
41+
### Bug Fixes
42+
43+
- [#3267](https://github.com/Azure/autorest.python/pull/3267) fix logic about which scenario to add msrest as dependency
44+
- [#3266](https://github.com/Azure/autorest.python/pull/3266) Fix @override to avoid duplicated subscriptionId or api-version signatures
45+
46+
347
## 6.42.2
448

549
### Bump dependencies

packages/autorest.python/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@autorest/python",
3-
"version": "6.42.2",
3+
"version": "6.45.1",
44
"description": "The Python extension for generators in AutoRest.",
55
"scripts": {
66
"start": "node ./scripts/run-python3.js ./scripts/start.py",
@@ -29,7 +29,7 @@
2929
},
3030
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
3131
"dependencies": {
32-
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTU4NDM4MS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.20.3.tgz",
32+
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTcwMDIzNS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.23.1.tgz",
3333
"@autorest/system-requirements": "~1.0.2",
3434
"fs-extra": "~11.2.0",
3535
"tsx": "~4.19.1"

packages/autorest.python/samples/specification/azure-mgmt-pyproject/test/azure-mgmt-pyproject/azure/mgmt/pyproject/_utils/serialization.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -821,13 +821,20 @@ def serialize_basic(cls, data, data_type, **kwargs):
821821
:param str data_type: Type of object in the iterable.
822822
:rtype: str, int, float, bool
823823
:return: serialized object
824+
:raises TypeError: raise if data_type is not one of str, int, float, bool.
824825
"""
825826
custom_serializer = cls._get_custom_serializers(data_type, **kwargs)
826827
if custom_serializer:
827828
return custom_serializer(data)
828829
if data_type == "str":
829830
return cls.serialize_unicode(data)
830-
return eval(data_type)(data) # nosec # pylint: disable=eval-used
831+
if data_type == "int":
832+
return int(data)
833+
if data_type == "float":
834+
return float(data)
835+
if data_type == "bool":
836+
return bool(data)
837+
raise TypeError("Unknown basic data type: {}".format(data_type))
831838

832839
@classmethod
833840
def serialize_unicode(cls, data):
@@ -1757,7 +1764,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return
17571764
:param str data_type: deserialization data type.
17581765
:return: Deserialized basic type.
17591766
:rtype: str, int, float or bool
1760-
:raises TypeError: if string format is not valid.
1767+
:raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool.
17611768
"""
17621769
# If we're here, data is supposed to be a basic type.
17631770
# If it's still an XML node, take the text
@@ -1783,7 +1790,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return
17831790

17841791
if data_type == "str":
17851792
return self.deserialize_unicode(attr)
1786-
return eval(data_type)(attr) # nosec # pylint: disable=eval-used
1793+
if data_type == "int":
1794+
return int(attr)
1795+
if data_type == "float":
1796+
return float(attr)
1797+
raise TypeError("Unknown basic data type: {}".format(data_type))
17871798

17881799
@staticmethod
17891800
def deserialize_unicode(data):

packages/autorest.python/samples/specification/azure-mgmt-pyproject/test/azure-mgmt-pyproject/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ requires-python = ">=3.9"
3131
keywords = ["azure", "azure sdk"]
3232

3333
dependencies = [
34-
"msrest>=0.7.1",
34+
"isodate>=0.6.1",
3535
"azure-mgmt-core>=1.6.0",
3636
"typing-extensions>=4.6.0",
3737
]

0 commit comments

Comments
 (0)