{Packaging} Build wheels with python -m build instead of python setup.py - #33941
Open
aryasadeghi1 wants to merge 1 commit into
Open
{Packaging} Build wheels with python -m build instead of python setup.py#33941aryasadeghi1 wants to merge 1 commit into
python -m build instead of python setup.py#33941aryasadeghi1 wants to merge 1 commit into
Conversation
…tup.py` `scripts/ci/build.sh` invoked `python setup.py bdist_wheel` / `sdist` directly. Setuptools 80+ deprecates running setup.py as a CLI and warns that these calls must be removed "to avoid build errors in the future", so drive the builds through the standard PEP 517 frontend instead. `--no-isolation` preserves current behaviour: the build uses the setuptools already installed by the caller rather than provisioning a fresh one. This keeps each caller's setuptools pin in force and avoids requiring outbound network access inside the packaging test containers. `--wheel` and `--sdist` are separate invocations on purpose. A bare `python -m build` builds an sdist first and then builds the wheel from it, which would newly make MANIFEST.in correctness load-bearing. `build` is added to the four scripts that run scripts/ci/build.sh, since none of them installed the PEP 517 frontend. Verified locally: wheels produced via `python -m build --wheel --no-isolation` are identical to the previous `setup.py bdist_wheel` output for all four distributions -- same archive member list and same METADATA.
|
Hi aryasadeghi1, |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested review from
ZelinWang (wangzelin007) and
Yong Zhang (yonzhan)
August 20, 2026 10:17
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Azure CLI packaging automation to stop invoking setup.py directly (deprecated by newer setuptools) and instead build wheels/sdists via the standard PEP 517 frontend (python -m build). It also adjusts the release packaging test scripts so their container environments install the build frontend used by scripts/ci/build.sh.
Changes:
- Switch
scripts/ci/build.shfrompython setup.py bdist_wheel/sdisttopython -m build --wheel/--sdist --no-isolation. - Update RPM/AzureLinux, Debian, and Homebrew packaging test scripts to install the
buildpackage before invokingscripts/ci/build.sh. - Refresh inline comments in those scripts to reflect the new build mechanism.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/release/rpm/test_rpm_in_docker.sh | Installs build before running scripts/ci/build.sh; updates pin rationale comments. |
| scripts/release/rpm/test_azurelinux_in_docker.sh | Installs build before running scripts/ci/build.sh; updates pin rationale comments. |
| scripts/release/homebrew/test_homebrew_package.sh | Installs build alongside wheel for the packaging build step. |
| scripts/release/debian/test_deb_in_docker.sh | Installs build alongside wheel for the packaging build step. |
| scripts/ci/build.sh | Replaces setup.py CLI builds with python -m build --no-isolation for wheels and sdists. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+55
to
+59
| # --no-isolation builds against the environment prepared by the caller rather than | ||
| # provisioning a fresh one, which keeps the caller's setuptools pin in force and | ||
| # avoids requiring outbound network access inside the packaging test containers. | ||
| python -m build --wheel --no-isolation --outdir $output_dir | ||
| python -m build --sdist --no-isolation --outdir $sdist_dir |
Comment on lines
+18
to
+20
| # Cap setuptools<81: 81 removes setup.py --dry-run and changes distutils command signatures (82 removes pkg_resources). | ||
| # scripts/ci/build.sh builds with `python -m build --no-isolation`, so this pin is the setuptools the build uses. | ||
| # `build` is the PEP 517 frontend that script invokes. |
Comment on lines
+18
to
+20
| # scripts/ci/build.sh builds with `python -m build --no-isolation`, so this pin is the setuptools the build uses. | ||
| # `build` is the PEP 517 frontend that script invokes. | ||
| python -m pip install --upgrade "setuptools<81" build |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
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.
🤖 PR Validation — ️✔️ All clear
scripts/ci/build.shinvokedpython setup.py bdist_wheel/sdistdirectly. Setuptools 80+ deprecates running setup.py as a CLI and warns that these calls must be removed "to avoid build errors in the future", so drive the builds through the standard PEP 517 frontend instead.Verified: wheels produced via
python -m build --wheel --no-isolationare identical to the previoussetup.py bdist_wheeloutput for all four distributions; same archive member list and same METADATA.Related command
Description
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.