Skip to content

{Packaging} Build release wheels with python -m build - #33995

Open
aryasadeghi1 wants to merge 1 commit into
Azure:devfrom
aryasadeghi1:unpin-setup
Open

{Packaging} Build release wheels with python -m build#33995
aryasadeghi1 wants to merge 1 commit into
Azure:devfrom
aryasadeghi1:unpin-setup

Conversation

@aryasadeghi1

@aryasadeghi1 aryasadeghi1 commented Aug 27, 2026

Copy link
Copy Markdown
Member

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests
️✔️ None ️✔️ 130/130

Completes the move off setup.py started in #33941, covering the last two call sites: scripts/release/pypi/build.sh (the BuildPythonWheel job) and Dockerfile.nanoserver. build is added to both, since neither had it.

--no-isolation keeps the existing setuptools<81 pin in force. --wheel and --sdist are split because a bare python -m build builds the wheel from the sdist, which would make MANIFEST.in load-bearing.

Also fixes the setuptools<81 comment: the pin is held by setuptools 82 dropping pkg_resources, not by setup.py.

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 feature


This checklist is used to make sure that common guidelines for a pull request are followed.

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

This PR completes the migration away from invoking setup.py directly for wheel/sdist creation, switching the remaining packaging call sites to the PEP 517 frontend (python -m build) in the release PyPI build script and the Windows Nano Server Docker image build.

Changes:

  • Update scripts/release/pypi/build.sh to use python -m build for wheel and sdist creation and install the build frontend.
  • Update Dockerfile.nanoserver to install build and replace setup.py bdist_wheel with python -m build --wheel.

Reviewed changes

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

File Description
scripts/release/pypi/build.sh Switches packaging from setup.py CLI to python -m build, and updates tooling install notes/commands.
Dockerfile.nanoserver Installs build and switches wheel creation in the Windows container to python -m build.
Suppressed comments (1)

scripts/release/pypi/build.sh:36

  • --outdir $BUILD_STAGINGDIRECTORY should be quoted to avoid word-splitting if the staging directory path contains spaces.
    python -m build --wheel --no-isolation --outdir $BUILD_STAGINGDIRECTORY
    python -m build --sdist --no-isolation --outdir $BUILD_STAGINGDIRECTORY

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +20 to +24
# Cap setuptools<81: setuptools 82 removes pkg_resources, which azure-cli still declares as a
# runtime dependency. The builds below go through the PEP 517 frontend, but --no-isolation means
# they use this setuptools too.
# `build` is that frontend.
pip install -U pip "setuptools<81" wheel build
Comment thread Dockerfile.nanoserver
RUN python -m pip install --upgrade pip
RUN pip install wheel
# `build` is the PEP 517 frontend used to build the wheels below.
RUN pip install wheel build
@yonzhan

Copy link
Copy Markdown
Collaborator

Packaging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants