Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: fix
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Fix TypeSpec `numeric` scalar type being emitted as `int` in Python; it is now emitted as `float`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: internal
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

add baseline of generated code before regenerate to contain necessary customized code for some specific test cases
2 changes: 1 addition & 1 deletion packages/autorest.python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
"dependencies": {
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjI0NjE0NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjI3ODUxMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "^4.21.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/typespec-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@typespec/xml": ">=0.81.0 <1.0.0"
},
"dependencies": {
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjI0NjE0NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjI3ODUxMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
"fs-extra": "~11.2.0",
"js-yaml": "~4.1.0",
"semver": "~7.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ class Geometry(_Model):
:ivar type: Required.
:vartype type: str
:ivar coordinates: Required.
:vartype coordinates: list[int]
:vartype coordinates: list[float]
"""

type: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
"""Required."""
coordinates: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
coordinates: list[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
"""Required."""

@overload
def __init__(
self,
*,
type: str,
coordinates: list[int],
coordinates: list[float],
) -> None: ...

@overload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ async def client():
yield client


# will reopen after bug fixed
# @pytest.mark.asyncio
# async def test_put_model_property(client: ClientDefaultValueClient):
# """Test case 1: @clientDefaultValue for model property."""
# body = ModelWithDefaultValues(name="test")
# result = await client.put_model_property(body=body)
# assert result.name == "test"
# assert result.timeout == 30
# assert result.tier == "standard"
# assert result.retry is True
@pytest.mark.asyncio
async def test_put_model_property(client: ClientDefaultValueClient):
"""Test case 1: @clientDefaultValue for model property."""
body = ModelWithDefaultValues(name="test")
result = await client.put_model_property(body=body)
assert result.name == "test"
assert result.timeout == 30
assert result.tier == "standard"
assert result.retry is True


@pytest.mark.asyncio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ def client():
yield client


# will reopen after bug fixed
# def test_put_model_property(client: ClientDefaultValueClient):
# """Test case 1: @clientDefaultValue for model property."""
# body = ModelWithDefaultValues(name="test")
# result = client.put_model_property(body=body)
# assert result.name == "test"
# assert result.timeout == 30
# assert result.tier == "standard"
# assert result.retry is True
def test_put_model_property(client: ClientDefaultValueClient):
"""Test case 1: @clientDefaultValue for model property."""
body = ModelWithDefaultValues(name="test")
result = client.put_model_property(body=body)
assert result.name == "test"
assert result.timeout == 30
assert result.tier == "standard"
assert result.retry is True


def test_get_operation_parameter(client: ClientDefaultValueClient):
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading