Fix Python emitter CI publish failure: stamp prerelease version in Build-Packages.ps1#10817
Merged
iscai-msft merged 11 commits intoMay 29, 2026
Merged
Conversation
The Build-Packages.ps1 script accepted a -Prerelease flag but never used
it to stamp the package version. Every CI build on main produced a package
with the same version from package.json, causing npm publish to fail with
a 409 conflict when publishing to the DevOps feed.
Added prerelease version stamping (matching the pattern used by the C#
emitter) that appends -alpha.{BuildNumber} or -beta.{BuildNumber} to the
version and updates package.json before npm pack.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
24d3fa9 to
9e5527f
Compare
pnpm is not available in the CI build environment which only has npm/node. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add pnpm install step to the build-step template so chronus is available in the CI environment. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
chronus is not in http-client-python's node_modules, so pnpm can't find it. Install it globally alongside pnpm. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
msyyc
reviewed
May 28, 2026
msyyc
reviewed
May 28, 2026
…nus install Address PR review comments: - Remove global @chronus/chronus install from build-step.yml (pnpm chronus is already available) - Replace chronus-based version stamping with direct package.json update using -alpha.$BuildNumber suffix, matching the C# emitter pattern - This ensures each CI build produces a unique version, preventing 409 conflicts on the DevOps feed Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep chronus-based prerelease (dev) versioning instead of alpha/BuildNumber. Only run 'chronus version --prerelease' when there are pending change files for @typespec/http-client-python, avoiding 409 conflicts when no changes are queued. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rewrite Build-Packages.ps1 to match C#'s proven approach: - Use -alpha.$BuildNumber (prerelease) / -beta.$BuildNumber versioning - Directly update package.json instead of using chronus - Add Set-VersionVariable for ADO pipeline output variables - Remove chronus dependency from build pipeline entirely Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add back the Linux-only lint step and package install verification that were accidentally removed when aligning with C# pattern. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add -alpha.$BuildNumber (prerelease) or -beta.$BuildNumber version stamping, matching the C# emitter pattern. The rest of the script remains unchanged from main. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Neither Python nor C# build scripts use pnpm, so the global install is unnecessary. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
@timotheeguerin trying to align with csharp bc of concerns from @msyyc instead of using dev versions |
catalinaperalta
approved these changes
May 29, 2026
msyyc
added a commit
to iscai-msft/typespec
that referenced
this pull request
Jun 4, 2026
…on in Build-Packages.ps1" (microsoft#10881) Reverts microsoft#10817 After discussion, we revert this PR to avoid duplicated alpha release for same python emitter content.
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.
Problem
The Python emitter's
Build-Packages.ps1script accepts a-Prereleaseflag but never uses it to stamp the package version. Every CI build onmainproduces a package with the exact same version frompackage.json, causingnpm publishto fail with a 409 conflict when publishing to the DevOps feed.See failing build: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6353671
Fix
Added prerelease version stamping that:
-alpha.{BuildNumber}(when-Prerelease) or-beta.{BuildNumber}to the versionpackage.jsonbeforenpm packso the tarball has the correct versionThis matches the existing pattern used by the C# emitter's
Build-Packages.ps1.Changes
packages/http-client-python/eng/scripts/Build-Packages.ps1: Use-Prereleaseand-BuildNumberparams to stamp version before packaging