File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
tools/azure-sdk-tools/packaging_tools Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 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 ,
Original file line number Diff line number Diff line change 22import logging
33import os
44import re
5+
56try :
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 } "
You can’t perform that action at this time.
0 commit comments