Skip to content

Fix Python emitter CI publish failure: stamp prerelease version in Build-Packages.ps1#10817

Open
iscai-msft wants to merge 5 commits into
microsoft:mainfrom
iscai-msft:fix/python-prerelease-version-stamping
Open

Fix Python emitter CI publish failure: stamp prerelease version in Build-Packages.ps1#10817
iscai-msft wants to merge 5 commits into
microsoft:mainfrom
iscai-msft:fix/python-prerelease-version-stamping

Conversation

@iscai-msft
Copy link
Copy Markdown
Member

Problem

The Python emitter's Build-Packages.ps1 script accepts a -Prerelease flag but never uses it to stamp the package version. Every CI build on main produces a package with the exact same version from package.json, causing npm publish to 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:

  1. Appends -alpha.{BuildNumber} (when -Prerelease) or -beta.{BuildNumber} to the version
  2. Updates package.json before npm pack so the tarball has the correct version

This matches the existing pattern used by the C# emitter's Build-Packages.ps1.

Changes

  • packages/http-client-python/eng/scripts/Build-Packages.ps1: Use -Prerelease and -BuildNumber params to stamp version before packaging

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>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label May 27, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 27, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@10817

commit: 9b8cc2d

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - fix ✏️

Fix CI publish failures by stamping prerelease version in Build-Packages.ps1. The -Prerelease flag was accepted but unused, causing every CI build to produce the same version and fail with a 409 conflict on the DevOps feed.

@azure-sdk-automation
Copy link
Copy Markdown

azure-sdk-automation Bot commented May 27, 2026

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@iscai-msft iscai-msft force-pushed the fix/python-prerelease-version-stamping branch from 24d3fa9 to 9e5527f Compare May 27, 2026 17:55
iscai-msft and others added 2 commits May 27, 2026 14:49
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python eng

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant