Repository navigation
Fix invalid PyPI package versions after shared-script sync - #3985
Merged
Merged
Conversation
Discard the regex returned by SetupPythonConventions so package versions remain scalar strings. Add regression coverage for stable, prerelease, build-number, and invalid versions, including generated project metadata. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8dc224e5-c470-4102-83cc-c5b85948aaf5
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrow fix directly addresses the regression, with targeted test coverage and no identified blocking issues.
No open issues 🎉
What changed in this PR
Fixes PyPI packaging after the shared-script sync by preventing an unused return value from corrupting package versions.
Changes:
- Suppresses output from
SetupPythonConventions(). - Adds five regression tests covering version conversion and generated metadata.
- Records the packaging fix in the changelog.
| File | Description |
|---|---|
| servers/Azure.Mcp.Server/changelog-entries/msalaman-fix-pypi-version.yaml | Documents the packaging fix. |
| eng/scripts/Pack-Pypi.Tests.ps1 | Tests version conversion and metadata. |
| eng/scripts/Pack-Pypi.ps1 | Prevents extra output from entering package versions. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8dc224e5-c470-4102-83cc-c5b85948aaf5
Contributor
Author
|
Copilot resolve the merge conflicts in this pull request |
…ng-failure # Conflicts: # eng/scripts/Pack-Pypi.Tests.ps1 Co-authored-by: msalaman <28122166+msalaman@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8dc224e5-c470-4102-83cc-c5b85948aaf5
msalaman
enabled auto-merge (squash)
October 19, 2026 17:06
msalaman
disabled auto-merge
October 19, 2026 18:19
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8dc224e5-c470-4102-83cc-c5b85948aaf5
Alan Zimmer (alzimmermsft)
approved these changes
Oct 19, 2026
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.
What does this PR do?
Suppress the unused return value from
SetupPythonConventions()inConvertTo-PythonPackageVersionso the converter returns only the Python package version.The shared engineering-script sync in #3939 changed
SetupPythonConventions()from returningvoidto returning a regex string. The existing caller emitted that regex alongside the version, creating aSystem.Object[]. Calling.ToString()on the array then wroteversion = "System.Object[]"intopyproject.toml, causing Hatchling to reject the wheel build.This PR makes the one-line caller fix without modifying shared engineering scripts, adds five regression tests covering stable, beta, alpha, build-number, and invalid versions, and verifies generated
pyproject.tomlversion metadata. No changelog entry is needed because this is an internal packaging change. MCP tool checklist sections below are not applicable: no tools or tool descriptions changed.Validation
Invoke-Pester -Path .\eng\scripts\Pack-Pypi.Tests.ps1 -CI -Output Detailed— passed, 5 tests..ToString()isSystem.Object[]; the fixed converter returns the scalar string1.2.3b4for1.2.3-beta.4.git diff --cached --check— passed before committing.dotnet build .\servers\Azure.Mcp.Server\src\Azure.Mcp.Server.csproj --no-restore --verbosity quiet— blocked:global.jsonrequires SDK10.0.401; this machine has9.0.315and10.0.113. Retried after the changelog removal with the same result..\eng\scripts\Build-Local.ps1 -VerifyNpx— blocked by the same missing SDK during project-property discovery; npm package verification did not run..\eng\common\spelling\Invoke-Cspell.ps1 -FileList @('eng\scripts\Pack-Pypi.ps1', 'eng\scripts\Pack-Pypi.Tests.ps1', 'servers\Azure.Mcp.Server\changelog-entries\msalaman-fix-pypi-version.yaml')— blocked: CSpell requires Node.js>=22.18.0, but this machine has22.16.0. The wrapper exited zero, but CSpell rejected the runtime, so this is not a successful spelling check. This attempt preceded removal of the changelog entry.GitHub issue number?
No linked issue. Fixes a packaging regression introduced by #3939.
Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test PipelineInvoking Livetests
Copilot submitted PRs are not trustworthy by default. Users with
writeaccess to the repo need to validate the contents of this PR before leaving a comment with the text/azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.