Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump tsp 0.67.0 #3058

Merged
merged 9 commits into from
Mar 20, 2025
Merged
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

This file was deleted.

7 changes: 0 additions & 7 deletions .chronus/changes/update-reqs-2025-2-18-11-17-24.md

This file was deleted.

11 changes: 11 additions & 0 deletions packages/autorest.python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Release

## 6.30.0

### Bump dependencies

- [#3058](https://github.com/Azure/autorest.python/pull/3058) Bump `@typespec/*` 0.67

### Features

- [#3050](https://github.com/Azure/autorest.python/pull/3050) Support continuation token for paging


## 6.29.1

No changes, version bump only.
Expand Down
4 changes: 2 additions & 2 deletions packages/autorest.python/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@autorest/python",
"version": "6.29.1",
"version": "6.30.0",
"description": "The Python extension for generators in AutoRest.",
"scripts": {
"start": "node ./scripts/run-python3.js ./scripts/start.py",
Expand Down Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
"dependencies": {
"@typespec/http-client-python": "~0.8.0",
"@typespec/http-client-python": "~0.8.1",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "~4.19.1"
Expand Down
11 changes: 11 additions & 0 deletions packages/typespec-python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Release

## 0.40.0

### Bump dependencies

- [#3058](https://github.com/Azure/autorest.python/pull/3058) Bump `@typespec/*` 0.67

### Features

- [#3050](https://github.com/Azure/autorest.python/pull/3050) Support continuation token for paging


## 0.39.1

### Bug Fixes
Expand Down
48 changes: 24 additions & 24 deletions packages/typespec-python/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure-tools/typespec-python",
"version": "0.39.1",
"version": "0.40.0",
"author": "Microsoft Corporation",
"description": "TypeSpec emitter for Python SDKs",
"homepage": "https://github.com/Azure/autorest.python",
Expand Down Expand Up @@ -45,37 +45,37 @@
"generator/**"
],
"peerDependencies": {
"@typespec/compiler": ">=0.66.0 <1.0.0",
"@typespec/http": ">=0.66.0 <1.0.0",
"@typespec/rest": ">=0.66.0 <1.0.0",
"@typespec/versioning": ">=0.66.0 <1.0.0",
"@typespec/openapi": ">=0.66.0 <1.0.0",
"@azure-tools/typespec-azure-core": ">=0.52.0 <1.0.0",
"@azure-tools/typespec-azure-resource-manager": ">=0.52.0 <1.0.0",
"@azure-tools/typespec-autorest": ">=0.52.0 <1.0.0",
"@azure-tools/typespec-azure-rulesets": ">=0.52.0 <3.0.0",
"@azure-tools/typespec-client-generator-core": ">=0.52.0 <1.0.0"
"@typespec/compiler": ">=0.67.0 <1.0.0",
"@typespec/http": ">=0.67.0 <1.0.0",
"@typespec/rest": ">=0.67.0 <1.0.0",
"@typespec/versioning": ">=0.67.0 <1.0.0",
"@typespec/openapi": ">=0.67.0 <1.0.0",
"@azure-tools/typespec-azure-core": ">=0.53.0 <1.0.0",
"@azure-tools/typespec-azure-resource-manager": ">=0.53.0 <1.0.0",
"@azure-tools/typespec-autorest": ">=0.53.0 <1.0.0",
"@azure-tools/typespec-azure-rulesets": ">=0.53.0 <3.0.0",
"@azure-tools/typespec-client-generator-core": ">=0.53.0 <1.0.0"
},
"dependencies": {
"js-yaml": "~4.1.0",
"semver": "~7.6.2",
"tsx": "~4.19.1",
"@typespec/http-client-python": "~0.8.0",
"@typespec/http-client-python": "~0.8.1",
"fs-extra": "~11.2.0"
},
"devDependencies": {
"@typespec/compiler": "~0.66.0",
"@typespec/http": "~0.66.0",
"@typespec/rest": "~0.66.0",
"@typespec/versioning": "~0.66.0",
"@typespec/openapi": "~0.66.0",
"@azure-tools/typespec-azure-resource-manager": "~0.52.0",
"@azure-tools/typespec-azure-core": "~0.52.0",
"@azure-tools/typespec-azure-rulesets": "~0.52.0",
"@azure-tools/typespec-autorest": "~0.52.0",
"@azure-tools/typespec-client-generator-core": "~0.52.0",
"@azure-tools/azure-http-specs": "0.1.0-alpha.7",
"@typespec/http-specs": "0.1.0-alpha.11",
"@typespec/compiler": "~0.67.0",
"@typespec/http": "~0.67.0",
"@typespec/rest": "~0.67.0",
"@typespec/versioning": "~0.67.0",
"@typespec/openapi": "~0.67.0",
"@azure-tools/typespec-azure-resource-manager": "~0.53.0",
"@azure-tools/typespec-azure-core": "~0.53.0",
"@azure-tools/typespec-azure-rulesets": "~0.53.0",
"@azure-tools/typespec-autorest": "~0.53.0",
"@azure-tools/typespec-client-generator-core": "~0.53.0",
"@azure-tools/azure-http-specs": "0.1.0-alpha.10",
"@typespec/http-specs": "0.1.0-alpha.15-dev.3",
"@types/js-yaml": "~4.0.5",
"@types/node": "~22.5.4",
"@types/yargs": "~17.0.33",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"specs.azure.clientgenerator.core.usage.models.RoundTripModel": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.RoundTripModel",
"specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.input_to_input_output": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.inputToInputOutput",
"specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.output_to_input_output": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.outputToInputOutput",
"specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.model_in_read_only_property": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.modelInReadOnlyProperty"
"specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.model_in_read_only_property": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.modelInReadOnlyProperty",
"specs.azure.clientgenerator.core.usage.UsageClient.model_in_operation.orphan_model_serializable": "_Specs_.Azure.ClientGenerator.Core.Usage.ModelInOperation.orphanModelSerializable"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,15 @@ def test_model_in_operation_model_in_read_only_property(self, usage_endpoint):

# please add some check logic here by yourself
# ...

@UsagePreparer()
@recorded_by_proxy
def test_model_in_operation_orphan_model_serializable(self, usage_endpoint):
client = self.create_client(endpoint=usage_endpoint)
response = client.model_in_operation.orphan_model_serializable(
body={},
content_type="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@ async def test_model_in_operation_model_in_read_only_property(self, usage_endpoi

# please add some check logic here by yourself
# ...

@UsagePreparer()
@recorded_by_proxy_async
async def test_model_in_operation_orphan_model_serializable(self, usage_endpoint):
client = self.create_async_client(endpoint=usage_endpoint)
response = await client.model_in_operation.orphan_model_serializable(
body={},
content_type="str",
)

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from ...operations._operations import (
build_model_in_operation_input_to_input_output_request,
build_model_in_operation_model_in_read_only_property_request,
build_model_in_operation_orphan_model_serializable_request,
build_model_in_operation_output_to_input_output_request,
)
from .._configuration import UsageClientConfiguration
Expand Down Expand Up @@ -435,3 +436,63 @@ async def model_in_read_only_property(
return cls(pipeline_response, deserialized, {}) # type: ignore

return deserialized # type: ignore

@distributed_trace_async
async def orphan_model_serializable(self, body: Any, **kwargs: Any) -> None:
"""Serialize the 'OrphanModel' as request body.

Expected body parameter:

.. code-block:: json

{
"name": "name",
"desc": "desc"
}.

:param body: Required.
:type body: any
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = kwargs.pop("params", {}) or {}

content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json"))
cls: ClsType[None] = kwargs.pop("cls", None)

_content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_model_in_operation_orphan_model_serializable_request(
content_type=content_type,
content=_content,
headers=_headers,
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)

_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)

response = pipeline_response.http_response

if response.status_code not in [204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response)

if cls:
return cls(pipeline_response, None, {}) # type: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,23 @@ class OrphanModel(_model_base.Model):
"""Not used anywhere, but access is override to public so still need to be generated and exported
with serialization.

:ivar name: Required.
:vartype name: str
:ivar model_name: Required.
:vartype model_name: str
:ivar description: Required.
:vartype description: str
"""

name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
model_name: str = rest_field(name="modelName", visibility=["read", "create", "update", "delete", "query"])
"""Required."""
description: str = rest_field(name="desc", visibility=["read", "create", "update", "delete", "query"])
"""Required."""

@overload
def __init__(
self,
*,
name: str,
model_name: str,
description: str,
) -> None: ...

@overload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ def build_model_in_operation_model_in_read_only_property_request( # pylint: dis
return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs)


def build_model_in_operation_orphan_model_serializable_request( # pylint: disable=name-too-long
**kwargs: Any,
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})

content_type: str = kwargs.pop("content_type")
# Construct URL
_url = "/azure/client-generator-core/usage/orphanModelSerializable"

# Construct headers
_headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")

return HttpRequest(method="PUT", url=_url, headers=_headers, **kwargs)


class ModelInOperationOperations:
"""
.. warning::
Expand Down Expand Up @@ -484,3 +499,65 @@ def model_in_read_only_property(
return cls(pipeline_response, deserialized, {}) # type: ignore

return deserialized # type: ignore

@distributed_trace
def orphan_model_serializable( # pylint: disable=inconsistent-return-statements
self, body: Any, **kwargs: Any
) -> None:
"""Serialize the 'OrphanModel' as request body.

Expected body parameter:

.. code-block:: json

{
"name": "name",
"desc": "desc"
}.

:param body: Required.
:type body: any
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = kwargs.pop("params", {}) or {}

content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json"))
cls: ClsType[None] = kwargs.pop("cls", None)

_content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore

_request = build_model_in_operation_orphan_model_serializable_request(
content_type=content_type,
content=_content,
headers=_headers,
params=_params,
)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
}
_request.url = self._client.format_url(_request.url, **path_format_arguments)

_stream = False
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
_request, stream=_stream, **kwargs
)

response = pipeline_response.http_response

if response.status_code not in [204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response)

if cls:
return cls(pipeline_response, None, {}) # type: ignore
Loading
Loading