Skip to content

[azpysdk] Auto-install APIView dependencies if missing#47515

Open
tjprescott wants to merge 1 commit into
mainfrom
FixApistubInvocation
Open

[azpysdk] Auto-install APIView dependencies if missing#47515
tjprescott wants to merge 1 commit into
mainfrom
FixApistubInvocation

Conversation

@tjprescott

Copy link
Copy Markdown
Member

Ensures the azpysdk apistub command auto-installed APIView dependencies if missing. Ensures --install-deps is only used optionally for installing package dev dependencies.

Copilot AI review requested due to automatic review settings June 15, 2026 22:33
@tjprescott tjprescott requested a review from danieljurek as a code owner June 15, 2026 22:33
@tjprescott tjprescott requested a review from kashifkhan June 15, 2026 22:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the azpysdk apistub check to ensure APIView/apistub tool dependencies are installed automatically when missing, while making --install-deps only responsible for installing the target package’s dev requirements.

Changes:

  • Added ensure_apistub_dependencies() to detect whether apistub is importable and install eng/apiview_reqs.txt only when needed.
  • Updated apistub.run() so APIView/apistub dependencies are ensured regardless of --install-deps, and --install-deps only installs target package dev requirements.
  • Expanded/adjusted unit tests to cover the new dependency-ensuring behavior and avoid unintended installs during other test scenarios.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
eng/tools/azure-sdk-tools/azpysdk/apistub.py Adds ensure_apistub_dependencies() and updates run() flow so APIView requirements are auto-installed when missing; refines --install-deps behavior.
eng/tools/azure-sdk-tools/tests/test_apistub.py Updates tests to reflect the new dependency installation flow and adds coverage for the “already installed vs missing” cases.

Comment on lines 84 to 86
help=(
"Install dev requirements and apiview dependencies before running. "
"Skipped by default for faster local iteration."
"Install target package dev requirements before running. "
),
self, _env, install_into_venv, _create, _get_whl, _get_mapping, tmp_path, monkeypatch
):
"""When --install-deps is passed, apistub should install dependencies."""
"""When --install-deps is passed, apistub should install target package dependencies."""
@tjprescott tjprescott force-pushed the FixApistubInvocation branch from 25e149c to b729927 Compare June 15, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants