Skip to content

[apiview-stub-generator] Use uv for package install (revert timeout to 120s)#16429

Merged
danieljurek merged 1 commit into
mainfrom
hameed-kunkanoor/apistub-use-uv
Jul 21, 2026
Merged

[apiview-stub-generator] Use uv for package install (revert timeout to 120s)#16429
danieljurek merged 1 commit into
mainfrom
hameed-kunkanoor/apistub-use-uv

Conversation

@Hameedkunkanoor

Copy link
Copy Markdown
Contributor

Summary

Installs the target package with uv pip install (when uv is on PATH) instead of pip before generating the API view, and reverts the package-install timeout from 300s back to the original 120s.

Why

Follow-up to #16395. That PR raised the timeout to 300s to accommodate azure-ai-agentserver-core, whose install pulls the full Microsoft OpenTelemetry instrumentation tree. Verbose diagnostics showed the slowness was pip's dependency resolver backtracking over the large, beta-pinned graph (42 packages, 52 downloads, 0 cached, no network retries, only a few MB transferred) — a CPU/resolver problem, not network. The install took ~370s under pip and even blew past 300s.

uv's resolver handles the same tree in seconds (the repo's dev-requirement installs already use uv and resolve in ~1-2s). Switching apistub's own package install to uv removes the root cause, so the elevated timeout is no longer necessary.

Changes

  • _install_package: prefer uv pip install --python <interp> when uv is available; fall back to pip install otherwise.
  • Revert install timeout 300s -> 120s.
  • Bump version 0.3.29 -> 0.3.30 + CHANGELOG entry.

Notes

  • uv is already the default installer across the azure-sdk-for-python tooling (AZPYSDK_PIP_IMPL=uv), with UV_DEFAULT_INDEX wired to the authenticated feed — so this aligns apistub's last pip holdout with the established pattern.
  • Falls back to pip cleanly if uv is absent, so no hard dependency is introduced.

…o 120s

Install the target package with 'uv pip install' when uv is available (falling
back to pip otherwise). uv's resolver is far faster than pip's for large,
beta-pinned dependency trees such as the Microsoft OpenTelemetry distro, where
pip spent minutes backtracking (observed ~370s for azure-ai-agentserver-core).
With uv this drops to seconds, so the elevated install timeout is no longer
needed and is reverted from 300s back to 120s. Bumps version to 0.3.30.
Copilot AI review requested due to automatic review settings July 21, 2026 09:08
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
64 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

Updates the apiview-stub-generator package installation step to prefer uv pip install (when available) to avoid pip’s slow dependency backtracking on large graphs, allowing the install timeout to be reverted to its original value.

Changes:

  • Prefer uv pip install --python <interp> over pip install when uv is available on PATH, with a clean fallback to pip.
  • Revert the package install timeout back to 120s.
  • Bump package version to 0.3.30 and add a CHANGELOG entry describing the change.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/python-packages/apiview-stub-generator/apistub/_stub_generator.py Prefer uv for package installs and revert install timeout to 120s.
packages/python-packages/apiview-stub-generator/apistub/_version.py Version bump to 0.3.30.
packages/python-packages/apiview-stub-generator/CHANGELOG.md Document the uv install change and timeout revert.

@Hameedkunkanoor
Hameedkunkanoor enabled auto-merge (squash) July 21, 2026 09:13
@danieljurek
danieljurek disabled auto-merge July 21, 2026 09:29
@danieljurek
danieljurek merged commit d99596b into main Jul 21, 2026
15 of 16 checks passed
@danieljurek
danieljurek deleted the hameed-kunkanoor/apistub-use-uv branch July 21, 2026 09:29
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.

3 participants