Skip to content

Commit

Permalink
open apiview for mgmt sdk (Azure#38143)
Browse files Browse the repository at this point in the history
  • Loading branch information
msyyc authored and allenkim0129 committed Nov 5, 2024
1 parent e6f9bc1 commit c328607
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions tools/azure-sdk-tools/packaging_tools/sdk_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,27 @@ def main(generate_input, generate_output):
package["artifacts"] = [str(dist_path / package_file) for package_file in os.listdir(dist_path)]
package["result"] = "succeeded"
# Generate api stub File
if "azure-mgmt-" not in package_name:
try:
package_path = Path(sdk_folder, folder_name, package_name)
check_call(
[
"python",
"-m" "pip",
"install",
"-r",
"../../../eng/apiview_reqs.txt",
"--index-url=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi"
"/simple/",
],
cwd=package_path,
timeout=300,
)
check_call(["apistubgen", "--pkg-path", "."], cwd=package_path, timeout=600)
for file in os.listdir(package_path):
if "_python.json" in file and package_name in file:
package["apiViewArtifact"] = str(Path(package_path, file))
except Exception as e:
_LOGGER.error(f"Fail to generate ApiView token file for {package_name}: {e}")
try:
package_path = Path(sdk_folder, folder_name, package_name)
check_call(
[
"python",
"-m" "pip",
"install",
"-r",
"../../../eng/apiview_reqs.txt",
"--index-url=https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi"
"/simple/",
],
cwd=package_path,
timeout=600,
)
check_call(["apistubgen", "--pkg-path", "."], cwd=package_path, timeout=600)
for file in os.listdir(package_path):
if "_python.json" in file and package_name in file:
package["apiViewArtifact"] = str(Path(package_path, file))
except Exception as e:
_LOGGER.error(f"Fail to generate ApiView token file for {package_name}: {e}")
# Installation package
package["installInstructions"] = {
"full": "You can install the use using pip install of the artifacts.",
Expand Down

0 comments on commit c328607

Please sign in to comment.