Skip to content
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
7 changes: 0 additions & 7 deletions .chronus/changes/add-testcases-2025-7-12-11-57-37.md

This file was deleted.

7 changes: 0 additions & 7 deletions .chronus/changes/update_subdir_test-2025-7-6-16-49-1.md

This file was deleted.

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

## 6.38.2

### Bug Fixes

- [#3173](https://github.com/Azure/autorest.python/pull/3173) fix generated output folder for packaging files
- [#3173](https://github.com/Azure/autorest.python/pull/3173) keep declaration of pyproject.toml same with existing setup.py of ARM SDK


## 6.38.1

### Bump dependencies
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.38.1",
"version": "6.38.2",
"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.15.1",
"@typespec/http-client-python": "~0.15.2",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "~4.19.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This file is to check whether standard [readme.python.md](https://github.com/Azu
### Settings

``` yaml $(python)
input-file: ../../../node_modules/@microsoft.azure/autorest.testserver/swagger/body-array.json
input-file: ../../../node_modules/@microsoft.azure/autorest.testserver/swagger/head.json
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
package-name: azure-mgmt-test
Expand All @@ -15,6 +15,9 @@ clear-output-folder: true
version-tolerant: false
package-mode: azure-mgmt
keep-setup-py: true
generate-test: true
generate-sample: true
include-x-ms-examples-original-file: true
```

``` yaml $(python)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"CrossLanguagePackageId": null,
"CrossLanguageDefinitionId": {
"azure.mgmt.test.operations.HttpSuccessOperations.head200": null,
"azure.mgmt.test.aio.operations.HttpSuccessOperations.head200": null,
"azure.mgmt.test.operations.HttpSuccessOperations.head204": null,
"azure.mgmt.test.aio.operations.HttpSuccessOperations.head204": null,
"azure.mgmt.test.operations.HttpSuccessOperations.head404": null,
"azure.mgmt.test.aio.operations.HttpSuccessOperations.head404": null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._auto_rest_swagger_bat_array_service import AutoRestSwaggerBATArrayService # type: ignore
from ._auto_rest_head_test_service import AutoRestHeadTestService # type: ignore
from ._version import VERSION

__version__ = VERSION
Expand All @@ -25,7 +25,7 @@
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"AutoRestSwaggerBATArrayService",
"AutoRestHeadTestService",
]
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, Optional, TYPE_CHECKING, cast
from typing import Any, Dict, Optional, TYPE_CHECKING, cast
from typing_extensions import Self

from azure.core.pipeline import policies
Expand All @@ -17,20 +17,19 @@
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
from azure.mgmt.core.tools import get_arm_endpoints

from . import models as _models
from ._configuration import AutoRestSwaggerBATArrayServiceConfiguration
from ._configuration import AutoRestHeadTestServiceConfiguration
from ._utils.serialization import Deserializer, Serializer
from .operations import ArrayOperations
from .operations import HttpSuccessOperations

if TYPE_CHECKING:
from azure.core.credentials import TokenCredential


class AutoRestSwaggerBATArrayService: # pylint: disable=client-accepts-api-version-keyword
"""Test Infrastructure for AutoRest Swagger BAT.
class AutoRestHeadTestService: # pylint: disable=client-accepts-api-version-keyword
"""Test Infrastructure for AutoRest.

:ivar array: ArrayOperations operations
:vartype array: azure.mgmt.test.operations.ArrayOperations
:ivar http_success: HttpSuccessOperations operations
:vartype http_success: azure.mgmt.test.operations.HttpSuccessOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param base_url: Service URL. Default value is None.
Expand All @@ -43,7 +42,7 @@ def __init__(self, credential: "TokenCredential", base_url: Optional[str] = None
if not base_url:
base_url = _endpoints["resource_manager"]
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
self._config = AutoRestSwaggerBATArrayServiceConfiguration(
self._config = AutoRestHeadTestServiceConfiguration(
credential=credential, credential_scopes=credential_scopes, **kwargs
)

Expand All @@ -67,11 +66,11 @@ def __init__(self, credential: "TokenCredential", base_url: Optional[str] = None
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
client_models: Dict[str, Any] = {}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.array = ArrayOperations(self._client, self._config, self._serialize, self._deserialize)
self.http_success = HttpSuccessOperations(self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from azure.core.credentials import TokenCredential


class AutoRestSwaggerBATArrayServiceConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for AutoRestSwaggerBATArrayService.
class AutoRestHeadTestServiceConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for AutoRestHeadTestService.

Note that all parameters used to create this instance are saved as instance
attributes.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------
"""Customize generated code here.

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._auto_rest_swagger_bat_array_service import AutoRestSwaggerBATArrayService # type: ignore
from ._auto_rest_head_test_service import AutoRestHeadTestService # type: ignore

try:
from ._patch import __all__ as _patch_all
Expand All @@ -22,7 +22,7 @@
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"AutoRestSwaggerBATArrayService",
"AutoRestHeadTestService",
]
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast
from typing import Any, Awaitable, Dict, Optional, TYPE_CHECKING, cast
from typing_extensions import Self

from azure.core.pipeline import policies
Expand All @@ -17,20 +17,19 @@
from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy
from azure.mgmt.core.tools import get_arm_endpoints

from .. import models as _models
from .._utils.serialization import Deserializer, Serializer
from ._configuration import AutoRestSwaggerBATArrayServiceConfiguration
from .operations import ArrayOperations
from ._configuration import AutoRestHeadTestServiceConfiguration
from .operations import HttpSuccessOperations

if TYPE_CHECKING:
from azure.core.credentials_async import AsyncTokenCredential


class AutoRestSwaggerBATArrayService: # pylint: disable=client-accepts-api-version-keyword
"""Test Infrastructure for AutoRest Swagger BAT.
class AutoRestHeadTestService: # pylint: disable=client-accepts-api-version-keyword
"""Test Infrastructure for AutoRest.

:ivar array: ArrayOperations operations
:vartype array: azure.mgmt.test.aio.operations.ArrayOperations
:ivar http_success: HttpSuccessOperations operations
:vartype http_success: azure.mgmt.test.aio.operations.HttpSuccessOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param base_url: Service URL. Default value is None.
Expand All @@ -43,7 +42,7 @@ def __init__(self, credential: "AsyncTokenCredential", base_url: Optional[str] =
if not base_url:
base_url = _endpoints["resource_manager"]
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
self._config = AutoRestSwaggerBATArrayServiceConfiguration(
self._config = AutoRestHeadTestServiceConfiguration(
credential=credential, credential_scopes=credential_scopes, **kwargs
)

Expand All @@ -69,11 +68,11 @@ def __init__(self, credential: "AsyncTokenCredential", base_url: Optional[str] =
base_url=cast(str, base_url), policies=_policies, **kwargs
)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
client_models: Dict[str, Any] = {}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.array = ArrayOperations(self._client, self._config, self._serialize, self._deserialize)
self.http_success = HttpSuccessOperations(self._client, self._config, self._serialize, self._deserialize)

def _send_request(
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from azure.core.credentials_async import AsyncTokenCredential


class AutoRestSwaggerBATArrayServiceConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for AutoRestSwaggerBATArrayService.
class AutoRestHeadTestServiceConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for AutoRestHeadTestService.

Note that all parameters used to create this instance are saved as instance
attributes.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------
"""Customize generated code here.

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._array_operations import ArrayOperations # type: ignore
from ._http_success_operations import HttpSuccessOperations # type: ignore

from ._patch import __all__ as _patch_all
from ._patch import *
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"ArrayOperations",
"HttpSuccessOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
Loading
Loading