Skip to content

Commit 80a8b25

Browse files
msyycl0lawrence
authored andcommitted
update (Azure#38220)
1 parent 94e295a commit 80a8b25

File tree

1 file changed

+4
-54
lines changed

1 file changed

+4
-54
lines changed

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

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -58,49 +58,6 @@ def extract_sdk_folder(python_md: List[str]) -> str:
5858
return ""
5959

6060

61-
@return_origin_path
62-
def multiapi_combiner(sdk_code_path: str, package_name: str):
63-
os.chdir(sdk_code_path)
64-
_LOGGER.info(f"start to combine multiapi package: {package_name}")
65-
check_call(
66-
f"python {str(Path('../../../tools/azure-sdk-tools/packaging_tools/multiapi_combiner.py'))} --pkg-path={os.getcwd()}",
67-
shell=True,
68-
)
69-
check_call("pip install -e .", shell=True)
70-
71-
72-
@return_origin_path
73-
def after_multiapi_combiner(sdk_code_path: str, package_name: str, folder_name: str):
74-
toml_file = Path(sdk_code_path) / CONF_NAME
75-
# do not package code of v20XX_XX_XX
76-
exclude = lambda x: x.replace("-", ".") + ".v20*"
77-
if toml_file.exists():
78-
with open(toml_file, "rb") as file_in:
79-
content = toml.load(file_in)
80-
if package_name != "azure-mgmt-resource":
81-
content["packaging"]["exclude_folders"] = exclude(package_name)
82-
else:
83-
# azure-mgmt-resource has subfolders
84-
subfolder_path = Path(sdk_code_path) / package_name.replace("-", "/")
85-
subfolders_name = [s.name for s in subfolder_path.iterdir() if s.is_dir() and not s.name.startswith("_")]
86-
content["packaging"]["exclude_folders"] = ",".join(
87-
[exclude(f"{package_name}-{s}") for s in subfolders_name]
88-
)
89-
90-
with open(toml_file, "wb") as file_out:
91-
tomlw.dump(content, file_out)
92-
call_build_config(package_name, folder_name)
93-
94-
# remove .egg-info to reinstall package
95-
for item in Path(sdk_code_path).iterdir():
96-
if item.suffix == ".egg-info":
97-
shutil.rmtree(str(item))
98-
os.chdir(sdk_code_path)
99-
check_call("pip install -e .", shell=True)
100-
else:
101-
_LOGGER.info(f"do not find {toml_file}")
102-
103-
10461
# readme: ../azure-rest-api-specs/specification/paloaltonetworks/resource-manager/readme.md or absolute path
10562
def get_readme_python_content(readme: str) -> List[str]:
10663
python_readme = Path(readme).parent / "readme.python.md"
@@ -359,17 +316,10 @@ def main(generate_input, generate_output):
359316
)
360317

361318
# check whether multiapi package has only one api-version in per subfolder
362-
# skip check for network for https://github.com/Azure/azure-sdk-for-python/issues/30556#issuecomment-1571341309
363-
if "azure-mgmt-network" not in sdk_code_path:
364-
check_api_version_in_subfolder(sdk_code_path)
365-
366-
# use multiapi combiner to combine multiapi package
367-
if package_name in ("azure-mgmt-network"):
368-
multiapi_combiner(sdk_code_path, package_name)
369-
after_multiapi_combiner(sdk_code_path, package_name, folder_name)
370-
result[package_name]["afterMultiapiCombiner"] = True
371-
else:
372-
result[package_name]["afterMultiapiCombiner"] = False
319+
check_api_version_in_subfolder(sdk_code_path)
320+
321+
# could be removed in the short future
322+
result[package_name]["afterMultiapiCombiner"] = False
373323
except Exception as e:
374324
_LOGGER.error(f"fail to setup package: {str(e)}")
375325

0 commit comments

Comments
 (0)