Skip to content
This repository was archived by the owner on May 22, 2026. It is now read-only.

Commit e46aa6e

Browse files
authored
sync eng of http-client-python (#3437)
* Update dependencies * Sync shared files from typespec repo (2026-04-10 08:39:36) * Add changelog * Update dependencies (2026-04-10 08:40:43) * Delete .chronus/changes/python-headersFix-2026-3-9-15-51-55.md * Delete .chronus/changes/python-incorrectWireNamePadding-2026-3-9-13-17-1.md * update * format --------- Co-authored-by: AutoPrFromHttpClientPython <AutoPrFromHttpClientPython>
1 parent a240f30 commit e46aa6e

6 files changed

Lines changed: 16 additions & 54 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
changeKind: internal
3+
packages:
4+
- "@autorest/python"
5+
- "@azure-tools/typespec-python"
6+
---
7+
8+
fix ci to add lint check for generated sdk code

packages/typespec-python/eng/scripts/regenerate-common.ts

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { dirname, join, relative, resolve } from "path";
33

44
// ---- Shared constants ----
55

6-
export const SKIP_SPECS: string[] = ["type/file"];
6+
export const SKIP_SPECS: string[] = ["type/file", "service/multiple-services"];
77

88
export const SpecialFlags: Record<string, Record<string, any>> = {
99
azure: {
@@ -212,6 +212,7 @@ export const BASE_EMITTER_OPTIONS: Record<string, Record<string, string> | Recor
212212
"package-name": "generation-subdir",
213213
"namespace": "generation.subdir",
214214
"generation-subdir": "_generated",
215+
"generate-test": "false",
215216
"clear-output-folder": "true",
216217
},
217218
],
@@ -280,6 +281,7 @@ export const BASE_EMITTER_OPTIONS: Record<string, Record<string, string> | Recor
280281
{
281282
"package-name": "generation-subdir2",
282283
"namespace": "generation.subdir2",
284+
"generate-test": "false",
283285
"generation-subdir": "_generated",
284286
},
285287
],
@@ -307,11 +309,6 @@ export interface RegenerateFlags {
307309
pyodide?: boolean;
308310
}
309311

310-
export interface ProcessedEmitterOption {
311-
options: Record<string, string>;
312-
outputDir: string;
313-
}
314-
315312
export interface RegenerateConfig {
316313
azureHttpSpecs: string;
317314
httpSpecs: string;
@@ -385,48 +382,6 @@ export async function getSubdirectories(baseDir: string, flags: RegenerateFlags)
385382
return subdirectories;
386383
}
387384

388-
export function defaultPackageName(spec: string, config: RegenerateConfig): string {
389-
const specDir = spec.includes("azure") ? config.azureHttpSpecs : config.httpSpecs;
390-
return toPosix(relative(specDir, dirname(spec)))
391-
.replace(/\//g, "-")
392-
.toLowerCase();
393-
}
394-
395-
export function buildOptions(
396-
spec: string,
397-
generatedFolder: string,
398-
flags: RegenerateFlags,
399-
config: RegenerateConfig,
400-
): ProcessedEmitterOption[] {
401-
const results: ProcessedEmitterOption[] = [];
402-
for (const emitterConfig of getEmitterOption(spec, flags.flavor, config)) {
403-
const options: Record<string, string> = { ...emitterConfig };
404-
if (flags.pyodide) {
405-
options["use-pyodide"] = "true";
406-
}
407-
options["flavor"] = flags.flavor;
408-
for (const [k, v] of Object.entries(SpecialFlags[flags.flavor] ?? {})) {
409-
options[k] = v;
410-
}
411-
if (options["emitter-output-dir"] === undefined) {
412-
const packageName = options["package-name"] || defaultPackageName(spec, config);
413-
// Output to new tests/generated/<flavor>/<package> structure
414-
options["emitter-output-dir"] = toPosix(
415-
`${generatedFolder}/../tests/generated/${flags.flavor}/${packageName}`,
416-
);
417-
}
418-
if (flags.debug) {
419-
options["debug"] = "true";
420-
}
421-
options["examples-dir"] = toPosix(join(dirname(spec), "examples"));
422-
results.push({
423-
options,
424-
outputDir: options["emitter-output-dir"],
425-
});
426-
}
427-
return results;
428-
}
429-
430385
export async function runTaskPool(tasks: Array<() => Promise<void>>, poolLimit: number): Promise<void> {
431386
const executing: Set<Promise<void>> = new Set();
432387

packages/typespec-python/tests/mock_api/azure/test_clear_output_folder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ def test_clear_output_folder():
1414
assert not (folder / "to_be_deleted.py").exists(), "File to_be_deleted.py should be deleted after regeneration"
1515

1616
if (GENERATED_PATH / "generation-subdir").exists():
17-
assert (GENERATED_PATH / "generation-subdir/generated_tests").exists()
1817
assert not (GENERATED_PATH / "generation-subdir/generated_tests/to_be_deleted.py").exists()
1918

2019
assert (GENERATED_PATH / "generation-subdir/generation/subdir/_generated").exists()

packages/typespec-python/tests/mock_api/shared/asynctests/test_generation_subdir2_for_customized_code_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ async def test_v2(client: AddedClient):
3434
async def test_interface_v2(client: AddedClient):
3535
assert await client.interface_v2.v2_in_interface(
3636
ModelV2(prop="foo", enum_prop=EnumV2.ENUM_MEMBER, union_prop="bar")
37-
) == ModelV2(prop="foo", enum_prop=EnumV2.ENUM_MEMBER, union_prop="bar")
37+
) == ModelV2(prop="foo", enum_prop=EnumV2.ENUM_MEMBER, union_prop="bar")

packages/typespec-python/tests/mock_api/shared/test_generation_subdir2_for_customized_code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# license information.
55
# --------------------------------------------------------------------------
66
import pytest
7-
from generation.subdir2 import AddedClient, ModelV1, ModelV2, EnumV1, EnumV2
7+
from generation.subdir2 import AddedClient, ModelV1, ModelV2, EnumV1, EnumV2
88

99

1010
@pytest.fixture
@@ -29,4 +29,4 @@ def test_v2(client: AddedClient):
2929
def test_interface_v2(client: AddedClient):
3030
assert client.interface_v2.v2_in_interface(
3131
ModelV2(prop="foo", enum_prop=EnumV2.ENUM_MEMBER, union_prop="bar")
32-
) == ModelV2(prop="foo", enum_prop=EnumV2.ENUM_MEMBER, union_prop="bar")
32+
) == ModelV2(prop="foo", enum_prop=EnumV2.ENUM_MEMBER, union_prop="bar")
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Azure SDK dependencies
22
-r base.txt
3-
azure-core>=1.30.0
4-
azure-mgmt-core>=1.6.0
3+
azure-core>=1.37.0
4+
azure-mgmt-core==1.6.0
55
geojson>=3.0.0

0 commit comments

Comments
 (0)