From 3e235c21e9681a31035a74f4d9fce9e45081770f Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Tue, 18 Nov 2025 12:11:38 -0800 Subject: [PATCH 1/4] Address usability experience for azsdk verify-setup --- .../Configuration/RequirementsV1.json | 10 +++++----- .../Models/Responses/VerifySetupResponse.cs | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Configuration/RequirementsV1.json b/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Configuration/RequirementsV1.json index 0e81906f7eb..6aa6bd23e8b 100644 --- a/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Configuration/RequirementsV1.json +++ b/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Configuration/RequirementsV1.json @@ -9,7 +9,7 @@ { "requirement": "tsp-client >= 0.24.0", "check": ["tsp-client", "--version"], - "instructions": ["cd eng/common/tsp-client", "`npm ci`"] + "instructions": ["cd eng/common/tsp-client", "npm ci"] }, { "requirement": "tsp >= 1.0.0", @@ -104,22 +104,22 @@ { "requirement": "azpysdk", "check": ["azpysdk", "--help"], - "instructions": ["Ensure your virtual environment is activated", "python -m pip install eng/tools/azure-sdk-tools[build]", "Check that it was installed with `azpysdk --help`"] + "instructions": ["Navigate to your SDK repository root directory", "Ensure your virtual environment is activated", "python -m pip install eng/tools/azure-sdk-tools[build]", "Check that it was installed with `azpysdk --help`"] }, { "requirement": "sdk_generator", "check": ["sdk_generator", "--help"], - "instructions": ["Ensure your virtual environment is activated", "python -m pip install eng/tools/azure-sdk-tools[sdk_generator]", "Check that it was installed with `sdk_generator --help`"] + "instructions": ["Navigate to your SDK repository root directory", "Ensure your virtual environment is activated", "python -m pip install eng/tools/azure-sdk-tools[sdk_generator]", "Check that it was installed with `sdk_generator --help`"] }, { "requirement": "ghtools", "check": ["python", "-m", "pip", "show", "GitPython"], - "instructions": ["Ensure your virtual environment is activated", "python -m pip install eng/tools/azure-sdk-tools[ghtools]", "Check that it was installed with `pip show GitPython`"] + "instructions": ["Navigate to your SDK repository root directory", "Ensure your virtual environment is activated", "python -m pip install eng/tools/azure-sdk-tools[ghtools]", "Check that it was installed with `pip show GitPython`"] }, { "requirement": "pytest >= 8.3.5", "check": ["pytest", "--version"], - "instructions": ["Ensure your virtual environment is activated", "python -m pip install pytest", "Check that it was installed with `pytest --version`"] + "instructions": ["Navigate to your SDK repository root directory", "Ensure your virtual environment is activated", "python -m pip install pytest", "Check that it was installed with `pytest --version`"] } ] } diff --git a/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Models/Responses/VerifySetupResponse.cs b/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Models/Responses/VerifySetupResponse.cs index ebf20d3ffc8..a809634e2de 100644 --- a/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Models/Responses/VerifySetupResponse.cs +++ b/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Models/Responses/VerifySetupResponse.cs @@ -15,8 +15,25 @@ public class VerifySetupResponse : CommandResponse protected override string Format() { var sb = new StringBuilder(); + + // Check if we have any Python-related requirements that need virtual environment activation + bool hasPythonRequirements = Results?.Any(r => + r.Requirement.Contains("azpysdk", StringComparison.OrdinalIgnoreCase) || + r.Requirement.Contains("sdk_generator", StringComparison.OrdinalIgnoreCase) || + r.Requirement.Contains("ghtools", StringComparison.OrdinalIgnoreCase) || + r.Requirement.Contains("pytest", StringComparison.OrdinalIgnoreCase)) == true; + sb.AppendLine("Results:"); + // Add important note about Python virtual environment immediately after heading if Python tools are failing + if (hasPythonRequirements) + { + sb.AppendLine(); + sb.AppendLine("⚠️ IMPORTANT: Before installing Python tools, ensure your Python virtual environment is activated."); + sb.AppendLine(" Set the AZSDKTOOLS_PYTHON_VENV_PATH environment variable to your desired virtual environment path."); + sb.AppendLine(); + } + if (Results != null) { foreach (var result in Results) From d6c822cdc52c9c14fbb653cf0bd50d8c709e6942 Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Tue, 18 Nov 2025 12:47:24 -0800 Subject: [PATCH 2/4] address reqs setup prereq --- .../azsdk-tools/verify-setup.instructions.md | 2 +- .../Models/Responses/VerifySetupResponse.cs | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/eng/common/instructions/azsdk-tools/verify-setup.instructions.md b/eng/common/instructions/azsdk-tools/verify-setup.instructions.md index 38d6a5b40db..97330ffcfc7 100644 --- a/eng/common/instructions/azsdk-tools/verify-setup.instructions.md +++ b/eng/common/instructions/azsdk-tools/verify-setup.instructions.md @@ -16,4 +16,4 @@ The user can specify multiple languages to check. If the user wants to check all ## Output Display results in a user-friendly and concise format, highlighting any missing dependencies that need to be addressed and how to resolve them. -WHENEVER Python related requirements fail, ALWAYS ASK the user if they have set the `AZSDKTOOLS_PYTHON_VENV_PATH` system environment variable to their desired virtual environment. This tool can only check requirements in the venv path specified by that environment variable. +When Python tool requirements fail (azpysdk, sdk_generator, ghtools, pytest), provide additional context about the `AZSDKTOOLS_PYTHON_VENV_PATH` environment variable if the user seems to be having setup issues. The verify-setup tool can only check Python requirements within the virtual environment specified by this environment variable. diff --git a/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Models/Responses/VerifySetupResponse.cs b/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Models/Responses/VerifySetupResponse.cs index a809634e2de..f44e8779676 100644 --- a/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Models/Responses/VerifySetupResponse.cs +++ b/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Models/Responses/VerifySetupResponse.cs @@ -16,24 +16,8 @@ protected override string Format() { var sb = new StringBuilder(); - // Check if we have any Python-related requirements that need virtual environment activation - bool hasPythonRequirements = Results?.Any(r => - r.Requirement.Contains("azpysdk", StringComparison.OrdinalIgnoreCase) || - r.Requirement.Contains("sdk_generator", StringComparison.OrdinalIgnoreCase) || - r.Requirement.Contains("ghtools", StringComparison.OrdinalIgnoreCase) || - r.Requirement.Contains("pytest", StringComparison.OrdinalIgnoreCase)) == true; - sb.AppendLine("Results:"); - // Add important note about Python virtual environment immediately after heading if Python tools are failing - if (hasPythonRequirements) - { - sb.AppendLine(); - sb.AppendLine("⚠️ IMPORTANT: Before installing Python tools, ensure your Python virtual environment is activated."); - sb.AppendLine(" Set the AZSDKTOOLS_PYTHON_VENV_PATH environment variable to your desired virtual environment path."); - sb.AppendLine(); - } - if (Results != null) { foreach (var result in Results) From fe1da5994f16e1e674bf108f59f1c287dde64441 Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Tue, 18 Nov 2025 16:20:23 -0800 Subject: [PATCH 3/4] Update eng/common/instructions/azsdk-tools/verify-setup.instructions.md Co-authored-by: jenny <63012604+JennyPng@users.noreply.github.com> --- .../instructions/azsdk-tools/verify-setup.instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/instructions/azsdk-tools/verify-setup.instructions.md b/eng/common/instructions/azsdk-tools/verify-setup.instructions.md index 97330ffcfc7..be401efcd40 100644 --- a/eng/common/instructions/azsdk-tools/verify-setup.instructions.md +++ b/eng/common/instructions/azsdk-tools/verify-setup.instructions.md @@ -16,4 +16,4 @@ The user can specify multiple languages to check. If the user wants to check all ## Output Display results in a user-friendly and concise format, highlighting any missing dependencies that need to be addressed and how to resolve them. -When Python tool requirements fail (azpysdk, sdk_generator, ghtools, pytest), provide additional context about the `AZSDKTOOLS_PYTHON_VENV_PATH` environment variable if the user seems to be having setup issues. The verify-setup tool can only check Python requirements within the virtual environment specified by this environment variable. +When Python tool requirements fail, inform the user about the `AZSDKTOOLS_PYTHON_VENV_PATH` environment variable if they have setup issues. The verify-setup tool can only check Python requirements within the virtual environment specified by this environment variable. From 05b86ec210b83fe0b217a8ae522652f437be075d Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Fri, 21 Nov 2025 11:21:06 -0800 Subject: [PATCH 4/4] remove backticks from commands --- .../Azure.Sdk.Tools.Cli/Configuration/RequirementsV1.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Configuration/RequirementsV1.json b/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Configuration/RequirementsV1.json index 6aa6bd23e8b..b9a6f66b96c 100644 --- a/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Configuration/RequirementsV1.json +++ b/tools/azsdk-cli/Azure.Sdk.Tools.Cli/Configuration/RequirementsV1.json @@ -104,22 +104,22 @@ { "requirement": "azpysdk", "check": ["azpysdk", "--help"], - "instructions": ["Navigate to your SDK repository root directory", "Ensure your virtual environment is activated", "python -m pip install eng/tools/azure-sdk-tools[build]", "Check that it was installed with `azpysdk --help`"] + "instructions": ["Navigate to your SDK repository root directory", "Ensure your virtual environment is activated", "python -m pip install eng/tools/azure-sdk-tools[build]", "Check that it was installed with azpysdk --help"] }, { "requirement": "sdk_generator", "check": ["sdk_generator", "--help"], - "instructions": ["Navigate to your SDK repository root directory", "Ensure your virtual environment is activated", "python -m pip install eng/tools/azure-sdk-tools[sdk_generator]", "Check that it was installed with `sdk_generator --help`"] + "instructions": ["Navigate to your SDK repository root directory", "Ensure your virtual environment is activated", "python -m pip install eng/tools/azure-sdk-tools[sdk_generator]", "Check that it was installed with sdk_generator --help"] }, { "requirement": "ghtools", "check": ["python", "-m", "pip", "show", "GitPython"], - "instructions": ["Navigate to your SDK repository root directory", "Ensure your virtual environment is activated", "python -m pip install eng/tools/azure-sdk-tools[ghtools]", "Check that it was installed with `pip show GitPython`"] + "instructions": ["Navigate to your SDK repository root directory", "Ensure your virtual environment is activated", "python -m pip install eng/tools/azure-sdk-tools[ghtools]", "Check that it was installed with pip show GitPython"] }, { "requirement": "pytest >= 8.3.5", "check": ["pytest", "--version"], - "instructions": ["Navigate to your SDK repository root directory", "Ensure your virtual environment is activated", "python -m pip install pytest", "Check that it was installed with `pytest --version`"] + "instructions": ["Navigate to your SDK repository root directory", "Ensure your virtual environment is activated", "python -m pip install pytest", "Check that it was installed with pytest --version"] } ] }