From 10817b20588685b1a15013987887b6abfb5abadc Mon Sep 17 00:00:00 2001 From: tadelesh Date: Fri, 21 Mar 2025 21:18:56 +0800 Subject: [PATCH 01/15] update options for azure emitter --- packages/typespec-python/package.json | 2 +- packages/typespec-python/src/emitter.ts | 4 +- packages/typespec-python/src/lib.ts | 56 +++++++++---------------- pnpm-lock.yaml | 22 ++++++++-- 4 files changed, 41 insertions(+), 43 deletions(-) diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index ea0762d84f8..ddadfd0b5a6 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -60,7 +60,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "~0.8.1", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3Mzc1OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { diff --git a/packages/typespec-python/src/emitter.ts b/packages/typespec-python/src/emitter.ts index e22dfbd8863..8ddaf87e1a7 100644 --- a/packages/typespec-python/src/emitter.ts +++ b/packages/typespec-python/src/emitter.ts @@ -1,8 +1,8 @@ import { EmitContext } from "@typespec/compiler"; -import { PythonEmitterOptions } from "./lib.js"; +import { PythonAzureEmitterOptions } from "./lib.js"; import { $onEmit as httpClientPythonOnEmit } from "@typespec/http-client-python"; -export async function $onEmit(context: EmitContext) { +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..ec4fead9752 100644 --- a/packages/typespec-python/src/lib.ts +++ b/packages/typespec-python/src/lib.ts @@ -1,52 +1,34 @@ 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; - "models-mode"?: string; - "tracing"?: boolean; - "company-name"?: string; +export interface PythonAzureEmitterOptions extends PythonEmitterOptions { + "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 }, + "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 +37,7 @@ const libDef = { name: "@azure-tools/typespec-python", diagnostics: {}, emitter: { - options: EmitterOptionsSchema as JSONSchemaType, + options: PythonAzureEmitterOptionsSchema, }, } as const; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9e1f3b2a59e..140a8880a19 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: ~0.8.1 - version: 0.8.1(z4b5mqrksjtjtkrtw4eaa2rjea) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3Mzc1OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3Mzc1OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(z4b5mqrksjtjtkrtw4eaa2rjea) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1550,6 +1550,22 @@ packages: '@typespec/rest': '>=0.67.0 <1.0.0' '@typespec/versioning': '>=0.67.0 <1.0.0' + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3Mzc1OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3Mzc1OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz} + version: 0.8.1 + engines: {node: '>=18.0.0'} + peerDependencies: + '@azure-tools/typespec-autorest': '>=0.53.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-azure-rulesets': '>=0.53.0 <3.0.0' + '@azure-tools/typespec-client-generator-core': '>=0.53.0 <1.0.0' + '@typespec/compiler': '>=0.67.0 <1.0.0' + '@typespec/http': '>=0.67.0 <1.0.0' + '@typespec/openapi': '>=0.67.0 <1.0.0' + '@typespec/rest': '>=0.67.0 <1.0.0' + '@typespec/versioning': '>=0.67.0 <1.0.0' + '@typespec/http-specs@0.1.0-alpha.15-dev.3': resolution: {integrity: sha512-pWrtceHjixwFv6SX1nkSu5WG7odm83FqnKLVzmO5Y29MD4DCgu1AhqtDM7UJ1GZgfHPbZS0zh9gj/01vxEhkdQ==} engines: {node: '>=16.0.0'} @@ -6164,7 +6180,7 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-client-python@0.8.1(z4b5mqrksjtjtkrtw4eaa2rjea)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3Mzc1OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(z4b5mqrksjtjtkrtw4eaa2rjea)': dependencies: '@azure-tools/typespec-autorest': 0.53.0(vsru7ipd7qt42slknz5aanwsou) '@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))))) From bef6a7f9273c053f17d80d01d85177b0fe94593a Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 24 Mar 2025 17:47:53 +0800 Subject: [PATCH 02/15] refine --- packages/typespec-python/src/lib.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/typespec-python/src/lib.ts b/packages/typespec-python/src/lib.ts index ec4fead9752..da4b6826df2 100644 --- a/packages/typespec-python/src/lib.ts +++ b/packages/typespec-python/src/lib.ts @@ -3,6 +3,8 @@ import { createTypeSpecLibrary, JSONSchemaType } from "@typespec/compiler"; import { PythonEmitterOptions, PythonEmitterOptionsSchema } from "@typespec/http-client-python"; export interface PythonAzureEmitterOptions extends PythonEmitterOptions { + flavor?: "azure"; + "models-mode"?: string; "generate-sample"?: boolean; "generate-test"?: boolean; } @@ -16,6 +18,18 @@ const PythonAzureEmitterOptionsSchema: JSONSchemaType type: "object", additionalProperties: true, properties: { + 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, From 71976f240fb3a8115a4fd7dab67eb538a4198af0 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 24 Mar 2025 18:45:59 +0800 Subject: [PATCH 03/15] update --- packages/typespec-python/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 71caf5fd160..eb3bbec74ce 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -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": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { From f2f5684503d995d353624191b66c4969b763cf11 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Mon, 24 Mar 2025 18:46:13 +0800 Subject: [PATCH 04/15] update --- pnpm-lock.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 528331b48f7..3e5c930a8b4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -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: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(tbepisicnniwwh5yfhvlwsftvu) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1550,16 +1550,16 @@ packages: '@typespec/rest': '>=0.67.0 <1.0.0' '@typespec/versioning': '>=0.67.0 <1.0.0' - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3Mzc1OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY3Mzc1OC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz} version: 0.8.1 - engines: {node: '>=18.0.0'} + engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.53.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-azure-rulesets': '>=0.53.0 <3.0.0' - '@azure-tools/typespec-client-generator-core': '>=0.53.0 <1.0.0' + '@azure-tools/typespec-client-generator-core': '>=0.53.1 <1.0.0' '@typespec/compiler': '>=0.67.0 <1.0.0' '@typespec/http': '>=0.67.0 <1.0.0' '@typespec/openapi': '>=0.67.0 <1.0.0' @@ -6180,7 +6180,7 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-client-python@0.9.0-dev.1(tbepisicnniwwh5yfhvlwsftvu)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(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))))) From 28b9be39d7d042bab9dcc5002f104c63362fcf9f Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Mon, 24 Mar 2025 12:39:11 +0000 Subject: [PATCH 05/15] update --- packages/typespec-python/scripts/eng/regenerate.ts | 4 ---- .../asynctests/test_azure_core_lro_rpc_async.py | 4 ++-- .../test/azure/mock_api_tests/test_azure_core_lro_rpc.py | 2 +- packages/typespec-python/test/azure/requirements.txt | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/typespec-python/scripts/eng/regenerate.ts b/packages/typespec-python/scripts/eng/regenerate.ts index e56cb6906d2..30caa9a7af7 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 Date: Mon, 24 Mar 2025 12:40:57 +0000 Subject: [PATCH 06/15] changeset --- .chronus/changes/update_options-2025-2-24-12-40-52.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .chronus/changes/update_options-2025-2-24-12-40-52.md diff --git a/.chronus/changes/update_options-2025-2-24-12-40-52.md b/.chronus/changes/update_options-2025-2-24-12-40-52.md new file mode 100644 index 00000000000..e1d99f94bdf --- /dev/null +++ b/.chronus/changes/update_options-2025-2-24-12-40-52.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@azure-tools/typespec-python" +--- + +Refine emitter options. \ No newline at end of file From f7e6186d4d63e5f05567c00e657ebf01a41cbd66 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Mon, 24 Mar 2025 13:10:50 +0000 Subject: [PATCH 07/15] format --- packages/typespec-python/src/lib.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/typespec-python/src/lib.ts b/packages/typespec-python/src/lib.ts index da4b6826df2..c38f50cf0f2 100644 --- a/packages/typespec-python/src/lib.ts +++ b/packages/typespec-python/src/lib.ts @@ -3,7 +3,7 @@ import { createTypeSpecLibrary, JSONSchemaType } from "@typespec/compiler"; import { PythonEmitterOptions, PythonEmitterOptionsSchema } from "@typespec/http-client-python"; export interface PythonAzureEmitterOptions extends PythonEmitterOptions { - flavor?: "azure"; + "flavor"?: "azure"; "models-mode"?: string; "generate-sample"?: boolean; "generate-test"?: boolean; @@ -18,7 +18,7 @@ const PythonAzureEmitterOptionsSchema: JSONSchemaType type: "object", additionalProperties: true, properties: { - flavor: { + "flavor": { type: "string", nullable: true, description: "The flavor of the SDK.", From fb9ab685b717de03f71db0a3e7c300eb1faf175e Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Mon, 24 Mar 2025 14:15:08 +0000 Subject: [PATCH 08/15] fix --- packages/typespec-python/scripts/eng/regenerate.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/typespec-python/scripts/eng/regenerate.ts b/packages/typespec-python/scripts/eng/regenerate.ts index 30caa9a7af7..0fbbf7dabe6 100644 --- a/packages/typespec-python/scripts/eng/regenerate.ts +++ b/packages/typespec-python/scripts/eng/regenerate.ts @@ -179,10 +179,6 @@ const EMITTER_OPTIONS: Record | Record Date: Mon, 24 Mar 2025 14:23:25 +0000 Subject: [PATCH 09/15] fix --- packages/autorest.python/package.json | 2 +- pnpm-lock.yaml | 22 ++++------------------ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index fbf7e093acc..c8bf8772f6b 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -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": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3e5c930a8b4..d5b10d1b11b 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: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(na5sqrbfiqe26rpjh3d3zww5om) 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,21 +1536,6 @@ packages: peerDependencies: '@typespec/compiler': ^0.67.1 - '@typespec/http-client-python@0.9.0-dev.1': - resolution: {integrity: sha512-Bch/zdt2wol6e4sBHbfruXVexubKfp1oM9jY8GXDGBvXKoSgMVDwVahExrf58JSrMeLFN2rcEL+BH2BTLJCd/w==} - engines: {node: '>=20.0.0'} - peerDependencies: - '@azure-tools/typespec-autorest': '>=0.53.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-azure-rulesets': '>=0.53.0 <3.0.0' - '@azure-tools/typespec-client-generator-core': '>=0.53.1 <1.0.0' - '@typespec/compiler': '>=0.67.0 <1.0.0' - '@typespec/http': '>=0.67.0 <1.0.0' - '@typespec/openapi': '>=0.67.0 <1.0.0' - '@typespec/rest': '>=0.67.0 <1.0.0' - '@typespec/versioning': '>=0.67.0 <1.0.0' - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz': resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz} version: 0.8.1 @@ -6159,7 +6145,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@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(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))))) From 50d655994726a0a205ce2e07c11cd19760a96e5a Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Mon, 24 Mar 2025 15:00:57 +0000 Subject: [PATCH 10/15] regen --- .../CHANGELOG.md | 0 .../LICENSE | 0 .../azure/generated/azure-core-lro-rpc/MANIFEST.in | 9 +++++++++ .../README.md | 6 +++--- .../azure-core-lro-rpc/apiview-properties.json | 8 ++++++++ .../dev_requirements.txt | 0 .../generated_tests/conftest.py | 0 .../generated_tests/test_rpc.py | 0 .../generated_tests/test_rpc_async.py | 0 .../generated_tests/testpreparer.py | 2 +- .../generated_tests/testpreparer_async.py | 2 +- .../setup.py | 12 +++++++----- .../specs}/__init__.py | 0 .../specs/azure}/__init__.py | 0 .../azure-core-lro-rpc/specs/azure/core/__init__.py | 1 + .../specs/azure/core/lro/__init__.py | 1 + .../specs/azure/core}/lro/rpc/__init__.py | 0 .../specs/azure/core}/lro/rpc/_client.py | 0 .../specs/azure/core}/lro/rpc/_configuration.py | 2 +- .../specs/azure/core}/lro/rpc/_model_base.py | 0 .../azure/core}/lro/rpc/_operations/__init__.py | 0 .../azure/core}/lro/rpc/_operations/_operations.py | 12 ++++++------ .../specs/azure/core}/lro/rpc/_operations/_patch.py | 0 .../specs/azure/core}/lro/rpc/_patch.py | 0 .../specs/azure/core}/lro/rpc/_serialization.py | 0 .../specs/azure/core}/lro/rpc/_vendor.py | 0 .../specs/azure/core}/lro/rpc/_version.py | 0 .../specs/azure/core}/lro/rpc/aio/__init__.py | 0 .../specs/azure/core}/lro/rpc/aio/_client.py | 0 .../specs/azure/core}/lro/rpc/aio/_configuration.py | 2 +- .../azure/core}/lro/rpc/aio/_operations/__init__.py | 0 .../core}/lro/rpc/aio/_operations/_operations.py | 12 ++++++------ .../azure/core}/lro/rpc/aio/_operations/_patch.py | 0 .../specs/azure/core}/lro/rpc/aio/_patch.py | 0 .../specs/azure/core}/lro/rpc/aio/_vendor.py | 0 .../specs/azure/core}/lro/rpc/models/__init__.py | 0 .../specs/azure/core}/lro/rpc/models/_models.py | 0 .../specs/azure/core}/lro/rpc/models/_patch.py | 0 .../specs/azure/core}/lro/rpc/py.typed | 0 .../azure/generated/azurecore-lro-rpc/MANIFEST.in | 7 ------- .../azurecore-lro-rpc/apiview-properties.json | 8 -------- 41 files changed, 45 insertions(+), 39 deletions(-) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc => azure-core-lro-rpc}/CHANGELOG.md (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc => azure-core-lro-rpc}/LICENSE (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-core-lro-rpc/MANIFEST.in rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc => azure-core-lro-rpc}/README.md (91%) create mode 100644 packages/typespec-python/test/azure/generated/azure-core-lro-rpc/apiview-properties.json rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc => azure-core-lro-rpc}/dev_requirements.txt (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc => azure-core-lro-rpc}/generated_tests/conftest.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc => azure-core-lro-rpc}/generated_tests/test_rpc.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc => azure-core-lro-rpc}/generated_tests/test_rpc_async.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc => azure-core-lro-rpc}/generated_tests/testpreparer.py (95%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc => azure-core-lro-rpc}/generated_tests/testpreparer_async.py (94%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc => azure-core-lro-rpc}/setup.py (89%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs}/__init__.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore/lro => azure-core-lro-rpc/specs/azure}/__init__.py (100%) create mode 100644 packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-core-lro-rpc/specs/azure/core/lro/__init__.py rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/__init__.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/_client.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/_configuration.py (96%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/_model_base.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/_operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/_operations/_operations.py (94%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/_operations/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/_serialization.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/_vendor.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/_version.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/aio/__init__.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/aio/_client.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/aio/_configuration.py (96%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/aio/_operations/__init__.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/aio/_operations/_operations.py (94%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/aio/_operations/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/aio/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/aio/_vendor.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/models/__init__.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/models/_models.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/models/_patch.py (100%) rename packages/typespec-python/test/azure/generated/{azurecore-lro-rpc/azurecore => azure-core-lro-rpc/specs/azure/core}/lro/rpc/py.typed (100%) delete mode 100644 packages/typespec-python/test/azure/generated/azurecore-lro-rpc/MANIFEST.in delete mode 100644 packages/typespec-python/test/azure/generated/azurecore-lro-rpc/apiview-properties.json 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 From e8a4c2998607c47a48e54cdf4a61566e1c1cfaeb Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Tue, 25 Mar 2025 02:55:54 +0000 Subject: [PATCH 11/15] fix --- .../asynctests/test_azure_core_lro_rpc_async.py | 4 ++-- .../test/azure/mock_api_tests/test_azure_core_lro_rpc.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 578d2ac9fb4..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 specs.azurecore.lro.rpc.aio import RpcClient -from specs.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 06bbe5f92ac..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 specs.azurecore.lro.rpc import RpcClient, models +from specs.azure.core.lro.rpc import RpcClient, models @pytest.fixture From 762521b61b5c33241ffe967906df7ab1b6bd668d Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Tue, 25 Mar 2025 03:14:51 +0000 Subject: [PATCH 12/15] changeset --- .chronus/changes/update_options-2025-2-24-12-40-52.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.chronus/changes/update_options-2025-2-24-12-40-52.md b/.chronus/changes/update_options-2025-2-24-12-40-52.md index e1d99f94bdf..b6ea1a8b81a 100644 --- a/.chronus/changes/update_options-2025-2-24-12-40-52.md +++ b/.chronus/changes/update_options-2025-2-24-12-40-52.md @@ -1,6 +1,7 @@ --- changeKind: feature packages: + - "@azure-tools/autorest-python" - "@azure-tools/typespec-python" --- From 2b8879db44c2ab3dface4e062a4e9c099c1f8e25 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Tue, 25 Mar 2025 14:15:47 +0800 Subject: [PATCH 13/15] update --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 2 +- pnpm-lock.yaml | 17 ++++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index c8bf8772f6b..e6b527d0131 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -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/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", + "@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/package.json b/packages/typespec-python/package.json index eb3bbec74ce..1f13c78d115 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -60,7 +60,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz", + "@typespec/http-client-python": "~0.8.2", "fs-extra": "~11.2.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d5b10d1b11b..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: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(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: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(tbepisicnniwwh5yfhvlwsftvu) + specifier: ~0.8.2 + version: 0.8.2(tbepisicnniwwh5yfhvlwsftvu) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1536,9 +1536,8 @@ packages: peerDependencies: '@typespec/compiler': ^0.67.1 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz} - version: 0.8.1 + '@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' @@ -6145,7 +6144,7 @@ snapshots: dependencies: '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(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))))) @@ -6166,7 +6165,7 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDY4MzY4NC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.1.tgz(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))))) From c0a2270c31a3adb75fd533eacf6493fedb0a9033 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Tue, 25 Mar 2025 14:17:39 +0800 Subject: [PATCH 14/15] update changelog --- ...-2-24-12-40-52.md => update_options-2025-2-25-14-17-28.md} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .chronus/changes/{update_options-2025-2-24-12-40-52.md => update_options-2025-2-25-14-17-28.md} (56%) diff --git a/.chronus/changes/update_options-2025-2-24-12-40-52.md b/.chronus/changes/update_options-2025-2-25-14-17-28.md similarity index 56% rename from .chronus/changes/update_options-2025-2-24-12-40-52.md rename to .chronus/changes/update_options-2025-2-25-14-17-28.md index b6ea1a8b81a..b4cca012707 100644 --- a/.chronus/changes/update_options-2025-2-24-12-40-52.md +++ b/.chronus/changes/update_options-2025-2-25-14-17-28.md @@ -1,8 +1,8 @@ --- changeKind: feature packages: - - "@azure-tools/autorest-python" + - "@autorest/python" - "@azure-tools/typespec-python" --- -Refine emitter options. \ No newline at end of file +Refine emitter options \ No newline at end of file From bdd1bc1d23937c7507af504c2dd3c102c6aef369 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Tue, 25 Mar 2025 14:19:20 +0800 Subject: [PATCH 15/15] update changelog --- ...o-microsoft-update-root-namespace-2025-2-24-17-7-15.md | 8 -------- .chronus/changes/update_options-2025-2-25-14-17-28.md | 8 -------- packages/autorest.python/CHANGELOG.md | 8 ++++++++ packages/autorest.python/package.json | 2 +- packages/typespec-python/CHANGELOG.md | 8 ++++++++ packages/typespec-python/package.json | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 .chronus/changes/auto-microsoft-update-root-namespace-2025-2-24-17-7-15.md delete mode 100644 .chronus/changes/update_options-2025-2-25-14-17-28.md 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/.chronus/changes/update_options-2025-2-25-14-17-28.md b/.chronus/changes/update_options-2025-2-25-14-17-28.md deleted file mode 100644 index b4cca012707..00000000000 --- a/.chronus/changes/update_options-2025-2-25-14-17-28.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -changeKind: feature -packages: - - "@autorest/python" - - "@azure-tools/typespec-python" ---- - -Refine emitter options \ 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 e6b527d0131..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", 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 1f13c78d115..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",