Skip to content

Commit 17e58a0

Browse files
authored
[python] fix generated output folder for generated_samples/generated_tests/apiview-properties.json/_metadata.json (#3173)
* update * add test case * Update dependencies * Update dependencies (2025-08-13 04:00:32) * Regenerate for typespec-python (2025-08-13 04:05:30) * Regenerate for autorest.python (2025-08-13 04:21:44) * add changelog * bump version * fix * fix ci * update --------- Co-authored-by: AutoPrFromHttpClientPython <AutoPrFromHttpClientPython>
1 parent 4bead26 commit 17e58a0

223 files changed

Lines changed: 1014 additions & 10259 deletions

File tree

Some content is hidden

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

.chronus/changes/add-testcases-2025-7-12-11-57-37.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.chronus/changes/update_subdir_test-2025-7-6-16-49-1.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/autorest.python/CHANGELOG.md

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

3+
## 6.38.2
4+
5+
### Bug Fixes
6+
7+
- [#3173](https://github.com/Azure/autorest.python/pull/3173) fix generated output folder for packaging files
8+
- [#3173](https://github.com/Azure/autorest.python/pull/3173) keep declaration of pyproject.toml same with existing setup.py of ARM SDK
9+
10+
311
## 6.38.1
412

513
### 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.38.1",
3+
"version": "6.38.2",
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": "~0.15.1",
32+
"@typespec/http-client-python": "~0.15.2",
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-test/readme.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This file is to check whether standard [readme.python.md](https://github.com/Azu
55
### Settings
66

77
``` yaml $(python)
8-
input-file: ../../../node_modules/@microsoft.azure/autorest.testserver/swagger/body-array.json
8+
input-file: ../../../node_modules/@microsoft.azure/autorest.testserver/swagger/head.json
99
azure-arm: true
1010
license-header: MICROSOFT_MIT_NO_VERSION
1111
package-name: azure-mgmt-test
@@ -15,6 +15,9 @@ clear-output-folder: true
1515
version-tolerant: false
1616
package-mode: azure-mgmt
1717
keep-setup-py: true
18+
generate-test: true
19+
generate-sample: true
20+
include-x-ms-examples-original-file: true
1821
```
1922
2023
``` yaml $(python)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"CrossLanguagePackageId": null,
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.test.operations.HttpSuccessOperations.head200": null,
5+
"azure.mgmt.test.aio.operations.HttpSuccessOperations.head200": null,
6+
"azure.mgmt.test.operations.HttpSuccessOperations.head204": null,
7+
"azure.mgmt.test.aio.operations.HttpSuccessOperations.head204": null,
8+
"azure.mgmt.test.operations.HttpSuccessOperations.head404": null,
9+
"azure.mgmt.test.aio.operations.HttpSuccessOperations.head404": null
10+
}
11+
}

packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/mgmt/test/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
if TYPE_CHECKING:
1313
from ._patch import * # pylint: disable=unused-wildcard-import
1414

15-
from ._auto_rest_swagger_bat_array_service import AutoRestSwaggerBATArrayService # type: ignore
15+
from ._auto_rest_head_test_service import AutoRestHeadTestService # type: ignore
1616
from ._version import VERSION
1717

1818
__version__ = VERSION
@@ -25,7 +25,7 @@
2525
from ._patch import patch_sdk as _patch_sdk
2626

2727
__all__ = [
28-
"AutoRestSwaggerBATArrayService",
28+
"AutoRestHeadTestService",
2929
]
3030
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
3131

packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/mgmt/test/_auto_rest_swagger_bat_array_service.py renamed to packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/mgmt/test/_auto_rest_head_test_service.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, Optional, TYPE_CHECKING, cast
10+
from typing import Any, Dict, Optional, TYPE_CHECKING, cast
1111
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
@@ -17,20 +17,19 @@
1717
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1818
from azure.mgmt.core.tools import get_arm_endpoints
1919

20-
from . import models as _models
21-
from ._configuration import AutoRestSwaggerBATArrayServiceConfiguration
20+
from ._configuration import AutoRestHeadTestServiceConfiguration
2221
from ._utils.serialization import Deserializer, Serializer
23-
from .operations import ArrayOperations
22+
from .operations import HttpSuccessOperations
2423

2524
if TYPE_CHECKING:
2625
from azure.core.credentials import TokenCredential
2726

2827

29-
class AutoRestSwaggerBATArrayService: # pylint: disable=client-accepts-api-version-keyword
30-
"""Test Infrastructure for AutoRest Swagger BAT.
28+
class AutoRestHeadTestService: # pylint: disable=client-accepts-api-version-keyword
29+
"""Test Infrastructure for AutoRest.
3130
32-
:ivar array: ArrayOperations operations
33-
:vartype array: azure.mgmt.test.operations.ArrayOperations
31+
:ivar http_success: HttpSuccessOperations operations
32+
:vartype http_success: azure.mgmt.test.operations.HttpSuccessOperations
3433
:param credential: Credential needed for the client to connect to Azure. Required.
3534
:type credential: ~azure.core.credentials.TokenCredential
3635
:param base_url: Service URL. Default value is None.
@@ -43,7 +42,7 @@ def __init__(self, credential: "TokenCredential", base_url: Optional[str] = None
4342
if not base_url:
4443
base_url = _endpoints["resource_manager"]
4544
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
46-
self._config = AutoRestSwaggerBATArrayServiceConfiguration(
45+
self._config = AutoRestHeadTestServiceConfiguration(
4746
credential=credential, credential_scopes=credential_scopes, **kwargs
4847
)
4948

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

70-
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
69+
client_models: Dict[str, Any] = {}
7170
self._serialize = Serializer(client_models)
7271
self._deserialize = Deserializer(client_models)
7372
self._serialize.client_side_validation = False
74-
self.array = ArrayOperations(self._client, self._config, self._serialize, self._deserialize)
73+
self.http_success = HttpSuccessOperations(self._client, self._config, self._serialize, self._deserialize)
7574

7675
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
7776
"""Runs the network request through the client's chained policies.

packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/mgmt/test/_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
from azure.core.credentials import TokenCredential
1818

1919

20-
class AutoRestSwaggerBATArrayServiceConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
21-
"""Configuration for AutoRestSwaggerBATArrayService.
20+
class AutoRestHeadTestServiceConfiguration: # pylint: disable=too-many-instance-attributes
21+
"""Configuration for AutoRestHeadTestService.
2222
2323
Note that all parameters used to create this instance are saved as instance
2424
attributes.

packages/autorest.python/samples/specification/azure-mgmt-test/test/azure-mgmt-test/azure/mgmt/test/_patch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# ------------------------------------
2-
# Copyright (c) Microsoft Corporation.
3-
# Licensed under the MIT License.
4-
# ------------------------------------
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# --------------------------------------------------------------------------
56
"""Customize generated code here.
67
78
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize

0 commit comments

Comments
 (0)