{Packaging} Support Python 3.14 in CI, packaging, and metadata#33313
{Packaging} Support Python 3.14 in CI, packaging, and metadata#33313YangAn-microsoft wants to merge 3 commits into
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
986de78 to
dac4c3c
Compare
333da22 to
333ad06
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
b5a863b to
35c2919
Compare
There was a problem hiding this comment.
Pull request overview
Updates Azure CLI to officially support Python 3.14 by bumping CI/pipeline Python versions, packaging scripts, docs, and PyPI metadata, and adds a core startup mitigation for Python 3.14’s importlib deadlock detection when loading command modules in parallel.
Changes:
- Add Python 3.14 support metadata (PyPI classifiers) and update documentation to reflect the supported Python range.
- Update Azure Pipelines/test matrices and macOS/DEB/Homebrew packaging scripts to build/test with Python 3.14.
- Pre-warm common Azure SDK imports in
azure-cli-corebefore parallel module loading to avoid Python 3.14_DeadlockError.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/setup.py | Adds Python 3.14 classifier to package metadata. |
| src/azure-cli-core/setup.py | Adds Python 3.14 classifier to core package metadata. |
| src/azure-cli-telemetry/setup.py | Adds Python 3.14 classifier to telemetry package metadata. |
| src/azure-cli-testsdk/setup.py | Adds Python 3.14 classifier to testsdk package metadata. |
| src/azure-cli-core/azure/cli/core/init.py | Pre-warms shared imports prior to parallel command-module loading to avoid Python 3.14 import deadlocks. |
| azure-pipelines.yml | Switches primary pipeline Python version to 3.14 and expands job matrices to include 3.14. |
| azure-pipelines-full-tests.yml | Adds a full-test job targeting Python 3.14 (latest profile). |
| .azure-pipelines/breaking-change-tests.yml | Updates breaking-change pipeline to Python 3.14. |
| .azure-pipelines/macos-standalone-release.yml | Updates default Homebrew Python version to 3.14 for macOS standalone release. |
| .azure-pipelines/templates/macos/macos-build-jobs.yml | Updates default macOS build template Python version and docs to 3.14. |
| .azure-pipelines/templates/macos/macos-cask-generation-and-tests.yml | Updates default macOS cask template Python version to 3.14. |
| .azure-pipelines/templates/macos/macos-publish-jobs.yml | Updates default macOS publish template Python version to 3.14. |
| .azure-pipelines/templates/macos/macos-sign-notarize-jobs.yml | Updates default macOS sign/notarize template Python version to 3.14. |
| scripts/release/debian/build.sh | Bumps Debian build Python version to 3.14.4. |
| scripts/release/homebrew/docker/formula_generate.py | Updates Homebrew formula generation to target Python 3.14. |
| scripts/release/macos/build_binary_tar_gz.py | Updates macOS tarball build defaults/docs to Python 3.14. |
| scripts/release/macos/cask_generate.py | Updates CLI help text example to Python 3.14. |
| scripts/regression_test/regression_test.yml | Updates regression test pipeline to use Python 3.14. |
| doc/command_guidelines.md | Updates documented supported Python range to include 3.14. |
| doc/extensions/authoring.md | Updates extension authoring guidance/examples to Python 3.14. |
| doc/install_linux_prerequisites.md | Updates supported Python range to include 3.14. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c8573ca to
f23ec3b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (5)
azure-pipelines.yml:520
- This job matrix drops Python 3.13 (now only 3.12 + 3.14). That conflicts with the PR description (“alongside 3.12 and 3.13”) and with docs that still claim support for 3.10–3.14 (including 3.13). If 3.13 remains supported, please add it back to the matrix here.
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Python312:
python.version: '3.12'
Python314:
python.version: '3.14'
azure-pipelines.yml:537
- This job matrix drops Python 3.13 (now only 3.12 + 3.14). That conflicts with the PR description (“alongside 3.12 and 3.13”) and with docs that still claim support for 3.10–3.14 (including 3.13). If 3.13 remains supported, please add it back to the matrix here.
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Python312:
python.version: '3.12'
Python314:
python.version: '3.14'
azure-pipelines.yml:557
- This job matrix drops Python 3.13 (now only 3.12 + 3.14). That conflicts with the PR description (“alongside 3.12 and 3.13”) and with docs that still claim support for 3.10–3.14 (including 3.13). If 3.13 remains supported, please add it back to the matrix here.
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Python312:
python.version: '3.12'
Python314:
python.version: '3.14'
azure-pipelines.yml:578
- This job matrix drops Python 3.13 (now only 3.12 + 3.14). That conflicts with the PR description (“alongside 3.12 and 3.13”) and with docs that still claim support for 3.10–3.14 (including 3.13). If 3.13 remains supported, please add it back to the matrix here.
pool:
name: ${{ variables.ubuntu_pool }}
strategy:
matrix:
Python314:
python.version: '3.14'
azure-pipelines.yml:1141
- This job matrix drops Python 3.13 (now only 3.12 + 3.14). That conflicts with the PR description (“alongside 3.12 and 3.13”) and with docs that still claim support for 3.10–3.14 (including 3.13). If 3.13 remains supported, please add it back to the matrix here.
strategy:
matrix:
Python312:
python.version: '3.12'
Python314:
python.version: '3.14'
04daf12 to
294d9cb
Compare
AI comments: Here is a review of the comment you (@jiasli) left at #issuecomment-4496078686, along with analysis and context for each of your five points: Review of Your Comment on PR #33313Your comment raises excellent technical questions about Fix 1: the Point 1: CPython 3.14
|
| echo Installing setuptools wheel | ||
| %PYTHON_DIR%\python.exe -Im pip install setuptools wheel | ||
| if "%ARCH%"=="x86" ( | ||
| %PYTHON_DIR%\python.exe -Im pip install "setuptools<82" wheel |
There was a problem hiding this comment.
I've raise the win32 wheel issue in yaml/pyyaml#888 (comment)
Hope the wheel can be published so we don't need to change the build script.
There was a problem hiding this comment.
I agree. The solution in this PR is aiming to build pyyaml in embedded Python 3.14. Is it not necessary at all.
pyyaml only releases pyyaml-6.0.3-cp313-cp313-win32.whl (https://pypi.org/project/PyYAML/#files). pyyaml should address the absence of win32 wheel for Python 3.14.
There was a problem hiding this comment.
Replaced the previous workaround stack with a one-line ._pth fix. Now whether pyyaml provides win32 wheel won't affect our build.
Root cause (verified empirically on fresh win32 embed 3.13 vs 3.14): the old script did del python*._pth. On 3.13 that was harmless — python.exe still resolved the stdlib via default path computation. On 3.14, removing the ._pth breaks pip's PEP 517 isolated BuildEnvironment subprocess: the child python.exe can no longer locate python314.zip, fails to import encodings, and aborts in init_fs_encoding. That subprocess failure surfaced downstream as the _socket / _ctypes / setuptools.build_meta errors we'd been working around.
Fix: keep the shipped ._pth and just append import site. That single line enables site.py, which adds Lib\site-packages to sys.path. The existing pythonXY.zip / . entries keep stdlib and .pyd modules discoverable in both the parent process and any subprocess pip spawns.
Dropped: PIP_CONSTRAINT + build-constraints.txt, the setuptools<82 x86 pin, --no-build-isolation x86 branch, and the pyyaml pre-build block — all four workarounds become unnecessary because the underlying path-bootstrapping failure no longer happens.
Diff is now a single line in build.cmd:
- del python*._pth
+ for %%f in (python*._pth) do echo import site>> %%fThere was a problem hiding this comment.
Note on the 3.14 parallel-import deadlock
CPython 3.14's importlib now raises _DeadlockError on certain re-entrant module-lock acquisitions instead of silently hanging. Earlier revisions of this PR included an _prewarm_shared_imports() mitigation in azure-cli-core. That code has been dropped from this PR — #33250 (restore sequential module loading) is the correct fix and supersedes the prewarm workaround. This PR now only covers the packaging/CI move to 3.14 and the MSI build fix above; the deadlock is handled out-of-band by #33250.
2c3ed95 to
863714e
Compare
7d43070 to
c7e8d40
Compare
Description
Bumps Azure CLI's supported Python from 3.13 → 3.14 across CI, packaging, metadata, and docs, plus one robustness fix for the Windows MSI build on the win32 embeddable Python 3.14 distribution.
Note on the 3.14 parallel-import deadlock
CPython 3.14's
importlibnow raises_DeadlockErroron certain re-entrant module-lock acquisitions instead of silently hanging. Earlier revisions of this PR included an_prewarm_shared_imports()mitigation inazure-cli-core. That code has been dropped from this PR — #33250 (restore sequential module loading) is the correct fix and supersedes the prewarm workaround. This PR now only covers the packaging/CI move to 3.14 and the MSI build fix above; the deadlock is handled out-of-band by #33250.Version bumps
azure-pipelines*.yml,breaking-change-tests.yml,regression_test.yml):versionSpec3.13 →'3.14'(quoted to preserve the trailing zero); addPython314matrix entries; addAutomationFullTestPython314ProfileLatest.Programming Language :: Python :: 3.14classifier to allsetup.pyfiles.Testing Guide
Run CI and confirm the new Python 3.14 jobs pass. The x86 MSI build exercises the embed-Python
_pthfix;test_azure_cli_installationon Linux 3.14 covers the rest of the packaging/metadata changes.History Notes
No customer-facing API changes. Internal CI, packaging, compatibility, and a Windows MSI build fix for embeddable Python 3.14.