Skip to content

Commit 6b74ff1

Browse files
authored
[pipeline] keep setup.py for now (#42353)
* temp config * update * update
1 parent 695cef4 commit 6b74ff1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

swagger_to_sdk_config_autorest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"version-tolerant": false,
99
"include-x-ms-examples-original-file": true,
1010
"generate-sample": true,
11-
"generate-test": true
11+
"generate-test": true,
12+
"keep-setup-py": true
1213
},
1314
"advanced_options": {
1415
"create_sdk_pull_requests": true,

tools/azure-sdk-tools/packaging_tools/generate_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import os
44
import re
5+
56
try:
67
# py 311 adds this library natively
78
import tomllib as toml
@@ -461,11 +462,13 @@ def gen_typespec(
461462
tsp_dir = (Path(spec_folder) / typespec_relative_path).resolve()
462463
repo_url = rest_repo_url.replace("https://github.com/", "")
463464
tspconfig = tsp_dir / "tspconfig.yaml"
464-
if api_version and tspconfig.exists():
465+
if tspconfig.exists():
465466
with open(tspconfig, "r") as file_in:
466467
content = yaml.safe_load(file_in)
467468
if content.get("options", {}).get("@azure-tools/typespec-python"):
468-
content["options"]["@azure-tools/typespec-python"]["api-version"] = api_version
469+
content["options"]["@azure-tools/typespec-python"]["keep-setup-py"] = True
470+
if api_version:
471+
content["options"]["@azure-tools/typespec-python"]["api-version"] = api_version
469472
with open(tspconfig, "w") as file_out:
470473
yaml.dump(content, file_out)
471474
cmd = f"tsp-client init --tsp-config {tsp_dir} --local-spec-repo {tsp_dir} --commit {head_sha} --repo {repo_url}"

0 commit comments

Comments
 (0)