Skip dev_requirements/sdist install for changelog generation when using apistub#48090
Merged
Conversation
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: 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. |
|
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. |
Contributor
There was a problem hiding this comment.
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. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ChenxiJiang333
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
breakingcheck (used by changelog generation) unconditionally raninstall_dev_reqsand a sdistcreate_package_and_installbefore invoking the detector. In--use-apistubmode these steps are unnecessary and can cause failures.The apistub path in
detect_breaking_changes.pybuilds the code report via static analysis (azpysdk apistubgeneratesapi.md, which is converted to a report) and never imports the target package. Therefore installing the package'sdev_requirements.txtand 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, seepackaging_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 existsdue to stale in-sourcebuild/artifacts. Skipping the install avoids the wheel build entirely and speeds up changelog generation.Related: #48089
Changes
azpysdk/breaking.py: guardinstall_dev_reqsand the sdistcreate_package_and_installbehindnot use_apistub. Thejsondiff+ 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--use-apistub:install_dev_reqsandcreate_package_and_installare skipped,install_into_venvstill runs, and the detector is invoked with--use-apistub;--use-apistubis not forwarded.Validation
Files formatted with
black -l 120.