diff --git a/.chronus/changes/auto-microsoft-update-root-namespace-2025-2-24-17-7-15.md b/.chronus/changes/auto-microsoft-update-root-namespace-2025-2-24-17-7-15.md deleted file mode 100644 index 9e5e04415f8..00000000000 --- a/.chronus/changes/auto-microsoft-update-root-namespace-2025-2-24-17-7-15.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -changeKind: feature -packages: - - "@autorest/python" - - "@azure-tools/typespec-python" ---- - -Always respect namespace from TCGC \ No newline at end of file diff --git a/packages/autorest.python/CHANGELOG.md b/packages/autorest.python/CHANGELOG.md index fda666e890d..e2ea225b5cf 100644 --- a/packages/autorest.python/CHANGELOG.md +++ b/packages/autorest.python/CHANGELOG.md @@ -1,5 +1,13 @@ # Release +## 6.31.0 + +### Features + +- [#3057](https://github.com/Azure/autorest.python/pull/3057) Always respect namespace from TCGC +- [#3060](https://github.com/Azure/autorest.python/pull/3060) Refine emitter options + + ## 6.30.0 ### Bump dependencies diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index fbf7e093acc..cd0b1a45737 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -1,6 +1,6 @@ { "name": "@autorest/python", - "version": "6.30.0", + "version": "6.31.0", "description": "The Python extension for generators in AutoRest.", "scripts": { "start": "node ./scripts/run-python3.js ./scripts/start.py", @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "~0.9.0-dev.1", + "@typespec/http-client-python": "~0.8.2", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/CHANGELOG.md b/packages/typespec-python/CHANGELOG.md index 42baca6aad0..1a7261816fb 100644 --- a/packages/typespec-python/CHANGELOG.md +++ b/packages/typespec-python/CHANGELOG.md @@ -1,5 +1,13 @@ # Release +## 0.41.0 + +### Features + +- [#3057](https://github.com/Azure/autorest.python/pull/3057) Always respect namespace from TCGC +- [#3060](https://github.com/Azure/autorest.python/pull/3060) Refine emitter options + + ## 0.40.0 ### Bump dependencies diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 71caf5fd160..43b7ff9acbe 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-python", - "version": "0.40.0", + "version": "0.41.0", "author": "Microsoft Corporation", "description": "TypeSpec emitter for Python SDKs", "homepage": "https://github.com/Azure/autorest.python", @@ -60,7 +60,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "~0.9.0-dev.1", + "@typespec/http-client-python": "~0.8.2", "fs-extra": "~11.2.0" }, "devDependencies": { diff --git a/packages/typespec-python/scripts/eng/regenerate.ts b/packages/typespec-python/scripts/eng/regenerate.ts index e56cb6906d2..0fbbf7dabe6 100644 --- a/packages/typespec-python/scripts/eng/regenerate.ts +++ b/packages/typespec-python/scripts/eng/regenerate.ts @@ -29,10 +29,6 @@ const AZURE_EMITTER_OPTIONS: Record | Record | Record) { +export async function $onEmit(context: EmitContext) { // set flavor to azure if not set for python azure emitter if (context.options.flavor === undefined) { context.options.flavor = "azure"; diff --git a/packages/typespec-python/src/lib.ts b/packages/typespec-python/src/lib.ts index 1984ed65d27..c38f50cf0f2 100644 --- a/packages/typespec-python/src/lib.ts +++ b/packages/typespec-python/src/lib.ts @@ -1,52 +1,48 @@ import { SdkContext, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core"; import { createTypeSpecLibrary, JSONSchemaType } from "@typespec/compiler"; +import { PythonEmitterOptions, PythonEmitterOptionsSchema } from "@typespec/http-client-python"; -export interface PythonEmitterOptions { - "package-version"?: string; - "package-name"?: string; - "output-dir"?: string; - "generate-packaging-files"?: boolean; - "packaging-files-dir"?: string; - "packaging-files-config"?: object; - "package-pprint-name"?: string; - "head-as-boolean"?: boolean; +export interface PythonAzureEmitterOptions extends PythonEmitterOptions { + "flavor"?: "azure"; "models-mode"?: string; - "tracing"?: boolean; - "company-name"?: string; + "generate-sample"?: boolean; "generate-test"?: boolean; - "debug"?: boolean; - "flavor"?: "azure"; - "examples-dir"?: string; - // If true, package namespace will respect the typespec namespace. Otherwise, - // package namespace is always aligned with package name. - "enable-typespec-namespace"?: boolean; } export interface PythonSdkContext - extends SdkContext { + extends SdkContext { __endpointPathParameters: Record[]; } -const EmitterOptionsSchema: JSONSchemaType = { +const PythonAzureEmitterOptionsSchema: JSONSchemaType = { type: "object", additionalProperties: true, properties: { - "package-version": { type: "string", nullable: true }, - "package-name": { type: "string", nullable: true }, - "output-dir": { type: "string", nullable: true }, - "generate-packaging-files": { type: "boolean", nullable: true }, - "packaging-files-dir": { type: "string", nullable: true }, - "packaging-files-config": { type: "object", nullable: true }, - "package-pprint-name": { type: "string", nullable: true }, - "head-as-boolean": { type: "boolean", nullable: true }, - "models-mode": { type: "string", nullable: true }, - "tracing": { type: "boolean", nullable: true }, - "company-name": { type: "string", nullable: true }, - "generate-test": { type: "boolean", nullable: true }, - "debug": { type: "boolean", nullable: true }, - "flavor": { type: "string", nullable: true }, - "examples-dir": { type: "string", nullable: true, format: "absolute-path" }, - "enable-typespec-namespace": { type: "boolean", nullable: true }, + "flavor": { + type: "string", + nullable: true, + description: "The flavor of the SDK.", + }, + "models-mode": { + type: "string", + nullable: true, + enum: ["dpg", "none"], + description: + "What kind of models to generate. If you pass in `none`, we won't generate models. `dpg` models are the default models we generate.", + }, + "generate-sample": { + type: "boolean", + nullable: true, + description: + "Whether to generate sample files, for basic samples of your generated sdks. Defaults to `false`.", + }, + "generate-test": { + type: "boolean", + nullable: true, + description: + "Whether to generate test files, for basic testing of your generated sdks. Defaults to `false`.", + }, + ...PythonEmitterOptionsSchema.properties, }, required: [], }; @@ -55,7 +51,7 @@ const libDef = { name: "@azure-tools/typespec-python", diagnostics: {}, emitter: { - options: EmitterOptionsSchema as JSONSchemaType, + options: PythonAzureEmitterOptionsSchema, }, } as const; diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/CHANGELOG.md b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/CHANGELOG.md similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/CHANGELOG.md rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/CHANGELOG.md diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/LICENSE b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/LICENSE similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/LICENSE rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/LICENSE diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/MANIFEST.in new file mode 100644 index 00000000000..63285154616 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/MANIFEST.in @@ -0,0 +1,9 @@ +include *.md +include LICENSE +include specs/azure/core/lro/rpc/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include specs/__init__.py +include specs/azure/__init__.py +include specs/azure/core/__init__.py +include specs/azure/core/lro/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/README.md b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/README.md similarity index 91% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/README.md rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/README.md index b3fbc9ac0b1..91f94f0957a 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/README.md +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/README.md @@ -1,4 +1,4 @@ -# Azurecore Lro Rpc client library for Python +# Specs Azure Core Lro Rpc client library for Python ## Getting started @@ -6,14 +6,14 @@ ### Install the package ```bash -python -m pip install azurecore-lro-rpc +python -m pip install specs-azure-core-lro-rpc ``` #### Prequisites - Python 3.8 or later is required to use this package. - You need an [Azure subscription][azure_sub] to use this package. -- An existing Azurecore Lro Rpc instance. +- An existing Specs Azure Core Lro Rpc instance. ## Contributing diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/apiview-properties.json b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/apiview-properties.json new file mode 100644 index 00000000000..b47ef6efd5e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/apiview-properties.json @@ -0,0 +1,8 @@ +{ + "CrossLanguagePackageId": "_Specs_.Azure.Core.Lro.Rpc", + "CrossLanguageDefinitionId": { + "specs.azure.core.lro.rpc.models.GenerationOptions": "_Specs_.Azure.Core.Lro.Rpc.GenerationOptions", + "specs.azure.core.lro.rpc.models.GenerationResult": "_Specs_.Azure.Core.Lro.Rpc.GenerationResult", + "specs.azure.core.lro.rpc.RpcClient.begin_long_running_rpc": "_Specs_.Azure.Core.Lro.Rpc.longRunningRpc" + } +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/dev_requirements.txt b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/dev_requirements.txt similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/dev_requirements.txt rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/dev_requirements.txt diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/generated_tests/conftest.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/generated_tests/conftest.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/generated_tests/conftest.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/generated_tests/conftest.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/generated_tests/test_rpc.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/generated_tests/test_rpc.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/generated_tests/test_rpc.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/generated_tests/test_rpc.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/generated_tests/test_rpc_async.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/generated_tests/test_rpc_async.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/generated_tests/test_rpc_async.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/generated_tests/test_rpc_async.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/generated_tests/testpreparer.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/generated_tests/testpreparer.py similarity index 95% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/generated_tests/testpreparer.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/generated_tests/testpreparer.py index b3da2928846..284ccba204e 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/generated_tests/testpreparer.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/generated_tests/testpreparer.py @@ -5,9 +5,9 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from azurecore.lro.rpc import RpcClient from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer import functools +from specs.azure.core.lro.rpc import RpcClient class RpcClientTestBase(AzureRecordedTestCase): diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/generated_tests/testpreparer_async.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/generated_tests/testpreparer_async.py similarity index 94% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/generated_tests/testpreparer_async.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/generated_tests/testpreparer_async.py index c9b185a7228..b004f72dc92 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/generated_tests/testpreparer_async.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/generated_tests/testpreparer_async.py @@ -5,8 +5,8 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from azurecore.lro.rpc.aio import RpcClient from devtools_testutils import AzureRecordedTestCase +from specs.azure.core.lro.rpc.aio import RpcClient class RpcClientTestBaseAsync(AzureRecordedTestCase): diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/setup.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/setup.py similarity index 89% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/setup.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/setup.py index 6b2ced72468..3bb57e327ab 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/setup.py @@ -12,8 +12,8 @@ from setuptools import setup, find_packages -PACKAGE_NAME = "azurecore-lro-rpc" -PACKAGE_PPRINT_NAME = "Azurecore Lro Rpc" +PACKAGE_NAME = "specs-azure-core-lro-rpc" +PACKAGE_PPRINT_NAME = "Specs Azure Core Lro Rpc" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace("-", "/") @@ -54,13 +54,15 @@ exclude=[ "tests", # Exclude packages that will be covered by PEP420 or nspkg - "azurecore", - "azurecore.lro", + "specs", + "specs.azure", + "specs.azure.core", + "specs.azure.core.lro", ] ), include_package_data=True, package_data={ - "azurecore.lro.rpc": ["py.typed"], + "specs.azure.core.lro.rpc": ["py.typed"], }, install_requires=[ "isodate>=0.6.1", diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/__init__.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/__init__.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/__init__.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/__init__.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/__init__.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/__init__.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/__init__.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/__init__.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_client.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_client.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_client.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_client.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_configuration.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_configuration.py similarity index 96% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_configuration.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_configuration.py index 6cbeafd1a36..d5ff502241c 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_configuration.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_configuration.py @@ -32,7 +32,7 @@ def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> No self.endpoint = endpoint self.api_version = api_version - kwargs.setdefault("sdk_moniker", "azurecore-lro-rpc/{}".format(VERSION)) + kwargs.setdefault("sdk_moniker", "specs-azure-core-lro-rpc/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_model_base.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_model_base.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_model_base.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_model_base.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_operations/_operations.py similarity index 94% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_operations.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_operations/_operations.py index 3e3fd504125..ee881ae0645 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_operations/_operations.py @@ -138,13 +138,13 @@ def begin_long_running_rpc( Generate data. :param body: The body parameter. Required. - :type body: ~azurecore.lro.rpc.models.GenerationOptions + :type body: ~specs.azure.core.lro.rpc.models.GenerationOptions :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns GenerationResult. The GenerationResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azurecore.lro.rpc.models.GenerationResult] + :rtype: ~azure.core.polling.LROPoller[~specs.azure.core.lro.rpc.models.GenerationResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -163,7 +163,7 @@ def begin_long_running_rpc( :paramtype content_type: str :return: An instance of LROPoller that returns GenerationResult. The GenerationResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azurecore.lro.rpc.models.GenerationResult] + :rtype: ~azure.core.polling.LROPoller[~specs.azure.core.lro.rpc.models.GenerationResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -182,7 +182,7 @@ def begin_long_running_rpc( :paramtype content_type: str :return: An instance of LROPoller that returns GenerationResult. The GenerationResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azurecore.lro.rpc.models.GenerationResult] + :rtype: ~azure.core.polling.LROPoller[~specs.azure.core.lro.rpc.models.GenerationResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -196,10 +196,10 @@ def begin_long_running_rpc( :param body: The body parameter. Is one of the following types: GenerationOptions, JSON, IO[bytes] Required. - :type body: ~azurecore.lro.rpc.models.GenerationOptions or JSON or IO[bytes] + :type body: ~specs.azure.core.lro.rpc.models.GenerationOptions or JSON or IO[bytes] :return: An instance of LROPoller that returns GenerationResult. The GenerationResult is compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azurecore.lro.rpc.models.GenerationResult] + :rtype: ~azure.core.polling.LROPoller[~specs.azure.core.lro.rpc.models.GenerationResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_patch.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_patch.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_serialization.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_serialization.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_serialization.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_serialization.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_vendor.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_vendor.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_vendor.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_vendor.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_version.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_version.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/_version.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/_version.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/__init__.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_client.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_client.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_client.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_client.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_configuration.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_configuration.py similarity index 96% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_configuration.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_configuration.py index b010d5150c8..9c42b1e48ff 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_configuration.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_configuration.py @@ -32,7 +32,7 @@ def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> No self.endpoint = endpoint self.api_version = api_version - kwargs.setdefault("sdk_moniker", "azurecore-lro-rpc/{}".format(VERSION)) + kwargs.setdefault("sdk_moniker", "specs-azure-core-lro-rpc/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_operations/_operations.py similarity index 94% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_operations.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_operations/_operations.py index 0dfcbc34b98..ade3e4d2ee4 100644 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_operations/_operations.py @@ -114,13 +114,13 @@ async def begin_long_running_rpc( Generate data. :param body: The body parameter. Required. - :type body: ~azurecore.lro.rpc.models.GenerationOptions + :type body: ~specs.azure.core.lro.rpc.models.GenerationOptions :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns GenerationResult. The GenerationResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azurecore.lro.rpc.models.GenerationResult] + :rtype: ~azure.core.polling.AsyncLROPoller[~specs.azure.core.lro.rpc.models.GenerationResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -139,7 +139,7 @@ async def begin_long_running_rpc( :paramtype content_type: str :return: An instance of AsyncLROPoller that returns GenerationResult. The GenerationResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azurecore.lro.rpc.models.GenerationResult] + :rtype: ~azure.core.polling.AsyncLROPoller[~specs.azure.core.lro.rpc.models.GenerationResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -158,7 +158,7 @@ async def begin_long_running_rpc( :paramtype content_type: str :return: An instance of AsyncLROPoller that returns GenerationResult. The GenerationResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azurecore.lro.rpc.models.GenerationResult] + :rtype: ~azure.core.polling.AsyncLROPoller[~specs.azure.core.lro.rpc.models.GenerationResult] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -172,10 +172,10 @@ async def begin_long_running_rpc( :param body: The body parameter. Is one of the following types: GenerationOptions, JSON, IO[bytes] Required. - :type body: ~azurecore.lro.rpc.models.GenerationOptions or JSON or IO[bytes] + :type body: ~specs.azure.core.lro.rpc.models.GenerationOptions or JSON or IO[bytes] :return: An instance of AsyncLROPoller that returns GenerationResult. The GenerationResult is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azurecore.lro.rpc.models.GenerationResult] + :rtype: ~azure.core.polling.AsyncLROPoller[~specs.azure.core.lro.rpc.models.GenerationResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_patch.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_patch.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_vendor.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_vendor.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/aio/_vendor.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/aio/_vendor.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/models/__init__.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/models/_models.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/models/_models.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/models/_models.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/models/_models.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/models/_patch.py b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/models/_patch.py rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/py.typed b/packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/py.typed similarity index 100% rename from packages/typespec-python/test/azure/generated/azurecore-lro-rpc/azurecore/lro/rpc/py.typed rename to packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/rpc/py.typed diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/MANIFEST.in b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/MANIFEST.in deleted file mode 100644 index 0e0b6259b7f..00000000000 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include *.md -include LICENSE -include azurecore/lro/rpc/py.typed -recursive-include tests *.py -recursive-include samples *.py *.md -include azurecore/__init__.py -include azurecore/lro/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/apiview-properties.json b/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/apiview-properties.json deleted file mode 100644 index 23a0276aa3e..00000000000 --- a/packages/typespec-python/test/azure/generated/azurecore-lro-rpc/apiview-properties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "CrossLanguagePackageId": "_Specs_.Azure.Core.Lro.Rpc", - "CrossLanguageDefinitionId": { - "azurecore.lro.rpc.models.GenerationOptions": "_Specs_.Azure.Core.Lro.Rpc.GenerationOptions", - "azurecore.lro.rpc.models.GenerationResult": "_Specs_.Azure.Core.Lro.Rpc.GenerationResult", - "azurecore.lro.rpc.RpcClient.begin_long_running_rpc": "_Specs_.Azure.Core.Lro.Rpc.longRunningRpc" - } -} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_core_lro_rpc_async.py b/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_core_lro_rpc_async.py index 9845640649a..bc572bf298b 100644 --- a/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_core_lro_rpc_async.py +++ b/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_core_lro_rpc_async.py @@ -4,8 +4,8 @@ # license information. # -------------------------------------------------------------------------- import pytest -from azurecore.lro.rpc.aio import RpcClient -from azurecore.lro.rpc import models +from specs.azure.core.lro.rpc.aio import RpcClient +from specs.azure.core.lro.rpc import models @pytest.fixture diff --git a/packages/typespec-python/test/azure/mock_api_tests/test_azure_core_lro_rpc.py b/packages/typespec-python/test/azure/mock_api_tests/test_azure_core_lro_rpc.py index 094f58b7747..7710fd9eb6f 100644 --- a/packages/typespec-python/test/azure/mock_api_tests/test_azure_core_lro_rpc.py +++ b/packages/typespec-python/test/azure/mock_api_tests/test_azure_core_lro_rpc.py @@ -4,7 +4,7 @@ # license information. # -------------------------------------------------------------------------- import pytest -from azurecore.lro.rpc import RpcClient, models +from specs.azure.core.lro.rpc import RpcClient, models @pytest.fixture diff --git a/packages/typespec-python/test/azure/requirements.txt b/packages/typespec-python/test/azure/requirements.txt index 3e0ceececf2..435ab8357ce 100644 --- a/packages/typespec-python/test/azure/requirements.txt +++ b/packages/typespec-python/test/azure/requirements.txt @@ -10,7 +10,7 @@ azure-mgmt-core==1.3.2 -e ./generated/azure-client-generator-core-flatten-property -e ./generated/azure-core-basic -e ./generated/azure-core-scalar --e ./generated/azurecore-lro-rpc +-e ./generated/azure-core-lro-rpc -e ./generated/azure-core-lro-standard -e ./generated/azure-core-model -e ./generated/azure-core-traits diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 57ae98610f7..ae5e0f9caba 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: ~0.9.0-dev.1 - version: 0.9.0-dev.1(na5sqrbfiqe26rpjh3d3zww5om) + specifier: ~0.8.2 + version: 0.8.2(na5sqrbfiqe26rpjh3d3zww5om) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: ~0.9.0-dev.1 - version: 0.9.0-dev.1(tbepisicnniwwh5yfhvlwsftvu) + specifier: ~0.8.2 + version: 0.8.2(tbepisicnniwwh5yfhvlwsftvu) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -556,6 +556,7 @@ packages: '@effect/schema@0.71.1': resolution: {integrity: sha512-XvFttkuBUL3s4ofZ+OVE4Pagb4wsPG8laSS8iO5lVI9Yt1zIM49uxlYIA2BJ45jjS3MdplUepC0NilotKnjU2A==} + deprecated: this package has been merged into the main effect package peerDependencies: effect: ^3.6.5 @@ -1535,8 +1536,8 @@ packages: peerDependencies: '@typespec/compiler': ^0.67.1 - '@typespec/http-client-python@0.9.0-dev.1': - resolution: {integrity: sha512-Bch/zdt2wol6e4sBHbfruXVexubKfp1oM9jY8GXDGBvXKoSgMVDwVahExrf58JSrMeLFN2rcEL+BH2BTLJCd/w==} + '@typespec/http-client-python@0.8.2': + resolution: {integrity: sha512-ex/bBbEv3q6/5g4OGFlJ1CpAwVRN57lFCEfZTcCWdzdgtBxR7XUwBricBuiOqdrWqsJl81ilKoIgMD0qf6KqhA==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.53.0 <1.0.0' @@ -6143,7 +6144,7 @@ snapshots: dependencies: '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http-client-python@0.9.0-dev.1(na5sqrbfiqe26rpjh3d3zww5om)': + '@typespec/http-client-python@0.8.2(na5sqrbfiqe26rpjh3d3zww5om)': dependencies: '@azure-tools/typespec-autorest': 0.53.0(wjegnqrrlroq36cedwihs7fwdy) '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) @@ -6164,7 +6165,7 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-client-python@0.9.0-dev.1(tbepisicnniwwh5yfhvlwsftvu)': + '@typespec/http-client-python@0.8.2(tbepisicnniwwh5yfhvlwsftvu)': dependencies: '@azure-tools/typespec-autorest': 0.53.0(e3cfoxkazmlklhsfsyiqwpleoq) '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))))