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 8
8
"version-tolerant" : false ,
9
9
"include-x-ms-examples-original-file" : true ,
10
10
"generate-sample" : true ,
11
- "generate-test" : true
11
+ "generate-test" : true ,
12
+ "keep-setup-py" : true
12
13
},
13
14
"advanced_options" : {
14
15
"create_sdk_pull_requests" : true ,
Original file line number Diff line number Diff line change 2
2
import logging
3
3
import os
4
4
import re
5
+
5
6
try :
6
7
# py 311 adds this library natively
7
8
import tomllib as toml
@@ -461,11 +462,13 @@ def gen_typespec(
461
462
tsp_dir = (Path (spec_folder ) / typespec_relative_path ).resolve ()
462
463
repo_url = rest_repo_url .replace ("https://github.com/" , "" )
463
464
tspconfig = tsp_dir / "tspconfig.yaml"
464
- if api_version and tspconfig .exists ():
465
+ if tspconfig .exists ():
465
466
with open (tspconfig , "r" ) as file_in :
466
467
content = yaml .safe_load (file_in )
467
468
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
469
472
with open (tspconfig , "w" ) as file_out :
470
473
yaml .dump (content , file_out )
471
474
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