Skip to content

Skip dev_requirements/sdist install for changelog generation when using apistub#48090

Merged
msyyc merged 5 commits into
mainfrom
fix/changelog-skip-dev-reqs-apistub
Jul 17, 2026
Merged

Skip dev_requirements/sdist install for changelog generation when using apistub#48090
msyyc merged 5 commits into
mainfrom
fix/changelog-skip-dev-reqs-apistub

Conversation

@msyyc

@msyyc msyyc commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

The breaking check (used by changelog generation) unconditionally ran install_dev_reqs and a sdist create_package_and_install before invoking the detector. In --use-apistub mode these steps are unnecessary and can cause failures.

The apistub path in detect_breaking_changes.py builds the code report via static analysis (azpysdk apistub generates api.md, which is converted to a report) and never imports the target package. Therefore installing the package's dev_requirements.txt and building/installing the sdist is only needed for the legacy import-based path.

This also fixes a local failure during changelog generation (which always passes --use-apistub, see packaging_tools/package_utils.py): building wheels from local-source dev dependencies (azure-identity, azure-mgmt-resource) fails on Windows with [WinError 183] Cannot create a file when that file already exists due to stale in-source build/ artifacts. Skipping the install avoids the wheel build entirely and speeds up changelog generation.

Related: #48089

Changes

  • azpysdk/breaking.py: guard install_dev_reqs and the sdist create_package_and_install behind not use_apistub. The jsondiff + breaking-change-checker install (install_into_venv) still runs in both modes, since the detector imports them.
  • tests/test_breaking.py: new tests verifying that
    • with --use-apistub: install_dev_reqs and create_package_and_install are skipped, install_into_venv still runs, and the detector is invoked with --use-apistub;
    • default (import-based) path: both installs run and --use-apistub is not forwarded.

Validation

python -m pytest eng/tools/azure-sdk-tools/tests/test_breaking.py -v
# 2 passed

Files formatted with black -l 120.

The apistub path in the breaking-change check builds the code report via static analysis and never imports the target package, so installing the package's dev_requirements.txt and building/installing the sdist is unnecessary. This also avoids a local wheel-build failure (WinError 183 from stale in-source build/ dirs) during changelog generation, which always uses --use-apistub. Guard both steps behind 'not use_apistub' and add tests.
@azure-pipelines

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

@msyyc
msyyc marked this pull request as ready for review July 16, 2026 10:26
@msyyc
msyyc requested a review from danieljurek as a code owner July 16, 2026 10:26
Copilot AI review requested due to automatic review settings July 16, 2026 10:26
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 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

Skips unnecessary dependency and sdist installation when breaking-change detection uses static apistub analysis.

Changes:

  • Guards package installation behind not use_apistub.
  • Adds coverage for apistub and legacy paths.

Reviewed changes

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

File Description
azpysdk/breaking.py Skips unnecessary installs in apistub mode.
tests/test_breaking.py Tests installation behavior for both modes.

Comment thread eng/tools/azure-sdk-tools/tests/test_breaking.py Outdated
Copilot AI review requested due to automatic review settings July 17, 2026 01:46

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

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

@msyyc
msyyc merged commit c3af616 into main Jul 17, 2026
19 checks passed
@msyyc
msyyc deleted the fix/changelog-skip-dev-reqs-apistub branch July 17, 2026 03:04
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