Skip to content

[python] update python emitter install with helpful 401 error output#10720

Merged
msyyc merged 2 commits into
microsoft:mainfrom
JennyPng:cfs-error-message
May 25, 2026
Merged

[python] update python emitter install with helpful 401 error output#10720
msyyc merged 2 commits into
microsoft:mainfrom
JennyPng:cfs-error-message

Conversation

@JennyPng
Copy link
Copy Markdown
Member

@JennyPng JennyPng commented May 18, 2026

closes Azure/azure-sdk-for-python#46964

Because the python emitter's install.ts may use uv pip to install packages, it can run into authentication errors if a package version isn't cached in our central feed service, which we now default to pulling from instead of PyPI (see Azure/azure-sdk-for-python#46281 )

updates the error point to link to python repo's authentication docs

@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 18, 2026
@JennyPng JennyPng marked this pull request as ready for review May 18, 2026 22:02
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 18, 2026

Open in StackBlitz

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

commit: 62fb7bb

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

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

When python emitter install fails due to 401 error, output informative instructions linking to resolution steps in the Python SDK's repo docs.

@azure-sdk-automation
Copy link
Copy Markdown

azure-sdk-automation Bot commented May 18, 2026

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves the Python http-client emitter’s installation experience by surfacing more actionable diagnostics when package installation fails, particularly for authentication-related (401) failures against the Azure feed.

Changes:

  • Switch install_packages to capture subprocess output and include it in raised errors.
  • Add special-case guidance (linking to Azure SDK for Python contributing/auth docs) when failure output indicates a 401/Unauthorized.
  • Add a Chronus entry documenting the internal change.

Reviewed changes

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

File Description
packages/http-client-python/eng/scripts/setup/package_manager.py Capture pip/uv install output and enhance errors with 401-specific guidance.
.chronus/changes/cfs-error-message-2026-4-18-15-8-34.md Add changelog entry describing the improved 401 failure messaging.

Comment thread packages/http-client-python/eng/scripts/setup/package_manager.py
Comment thread packages/http-client-python/eng/scripts/setup/package_manager.py
Comment thread .chronus/changes/cfs-error-message-2026-4-18-15-8-34.md
Comment thread .chronus/changes/cfs-error-message-2026-4-18-15-8-34.md
@msyyc msyyc added this pull request to the merge queue May 25, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 25, 2026
@msyyc msyyc added this pull request to the merge queue May 25, 2026
Merged via the queue into microsoft:main with commit d72f4f1 May 25, 2026
41 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve troubleshooting when updating the python emitter version in emitter-package.json

4 participants