Skip to content

Conversation

@JennyPng
Copy link
Member

@JennyPng JennyPng commented Dec 15, 2025

#42601

  • When using uv venv, it errored with "module pip not found", so I believe apistubgen uses pip
  • To address ^, i added an ensurepip call during venv creation if using uv
  • was also seeing some import error with two core packages so I switched to run the apistub command from the staging directory instead of package_dir, which resolved it 🐱

pipelines:

Redoing pipelines after editing pip install

  • core
  • core nightly
  • storage
  • storage nightly

@JennyPng JennyPng marked this pull request as ready for review January 8, 2026 22:28
Copilot AI review requested due to automatic review settings January 8, 2026 22:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request updates the ApiStub generation process in CI to use the new azpysdk tooling instead of the older tox-based approach. The changes address issues with uv virtual environments that were missing pip, and resolve import errors by running apistub from the staging directory instead of the package directory.

Key changes:

  • Modified get_package_wheel_path to simplify return type and remove unused output token path logic
  • Changed skip_install from True to False to ensure the package is installed into the venv
  • Added pip installation for uv-based virtual environments to ensure compatibility with tools that depend on pip
  • Updated CI pipeline to use dispatch_checks.py instead of dispatch_tox.py and switched from --toxenv to --checks argument

Reviewed changes

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

File Description
eng/tools/azure-sdk-tools/azpysdk/apistub.py Simplified wheel path resolution, enabled package installation, added absolute path conversions, and changed working directory for apistub execution to staging directory
eng/tools/azure-sdk-tools/azpysdk/Check.py Added pip installation step for uv virtual environments to ensure compatibility with tools requiring pip
eng/pipelines/templates/steps/run_apistub.yml Updated to use new dispatch_checks.py script, changed toxenv to checks argument, and added environment variables for uv configuration

try:
subprocess.check_call(["uv", "pip", "install", "--python", venv_python, "pip"])
except subprocess.CalledProcessError as e:
logger.error(f"Failed to ensure pip in uv venv: {e}")
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

If pip installation fails in the uv venv, the error is logged but execution continues. This could lead to failures later when tools that depend on pip are invoked. Consider either raising the exception or at least returning early to prevent subsequent failures.

Suggested change
logger.error(f"Failed to ensure pip in uv venv: {e}")
logger.error(f"Failed to ensure pip in uv venv: {e}")
raise RuntimeError("Failed to ensure pip is available in the uv virtual environment.") from e

Copilot uses AI. Check for mistakes.
Copy link
Member

@scbedd scbedd Jan 12, 2026

Choose a reason for hiding this comment

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

I dislike that we special case this. If we need pip for the apistubgen to work, we should add it to the set of requirements for apistubgen environment. That'll address the issue without special casing here.

I could be missing something of course 😆 , lmk.

Copy link
Member

@scbedd scbedd left a comment

Choose a reason for hiding this comment

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

We should make the environment install any necessary packages. Is apistubgen perhaps missing a dependency on pip? Or do we just add pip to the set of requirements for the environment.

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