Skip to content

feat(python-setup): guide users to a proxy when the package index is unreachable - #2116

Merged
rugpanov merged 1 commit into
mainfrom
python-setup-proxy-guidance
Aug 14, 2026
Merged

feat(python-setup): guide users to a proxy when the package index is unreachable#2116
rugpanov merged 1 commit into
mainfrom
python-setup-proxy-guidance

Conversation

@rugpanov

Copy link
Copy Markdown
Contributor

Why

On locked-down corporate machines pypi.org is blocked and uv must reach an alternate index/proxy. When it can't, environments setup-local fails as E_PROVISION and the extension showed a misleading "dependency version conflict" message — leaving users with no path forward.

What

  • Detect uv's package-index connectivity failures and surface tailored guidance:
    • a popup naming UV_INDEX_URL / a pip.conf index-url,
    • a Configure package index button linking uv's index docs,
    • a copy-pasteable remediation block in the output channel (the raw CLI error is still shown).
  • Scope precisely: E_PROVISION only, requiring uv's failed to fetch index context (excluding git deps) plus a host-unreachable symptom — so genuine dependency conflicts, git-dependency fetches, and build-tool stderr are not mislabelled. E_PYTHON_INSTALL is deliberately excluded (a managed-CPython download from a different mirror that this guidance can't fix).
  • Telemetry: an optional boolean indexUnreachable on python_env.setup.result to measure how often a blocked index (vs a conflict) is the cause.

Verification

  • yarn test:unit — 757 passing, 0 failing (detector, message, action, output-channel remediation, telemetry, and negative cases).
  • prettier + eslint clean.
  • Reproduced against real uv 0.12.3 output (UV_INDEX_URL → a refusing endpoint): the genuine Failed to fetch … Connection refused text maps to the proxy guidance and button.

Note

Stacks on #2113 (the "Install uv" button), which introduces the popup action-button infra this builds on. The diff shows those commits too until #2113 merges; please merge this after #2113.

This pull request and its description were written by Isaac.

@rugpanov

rugpanov commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests ❌ 3 of 4 test jobs failed for b4c41e06 (0 passed, 1 skipped).
View run

@rugpanov
rugpanov force-pushed the python-setup-proxy-guidance branch from b4c41e0 to 87041a6 Compare August 13, 2026 19:58
@rugpanov

rugpanov commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests ❌ 3 of 4 test jobs failed for 87041a6b (0 passed, 1 skipped).
View run

@rugpanov
rugpanov force-pushed the python-setup-proxy-guidance branch from 87041a6 to de78c4b Compare August 13, 2026 21:51
@rugpanov

rugpanov commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests ❌ 3 of 4 test jobs failed for de78c4b5 (0 passed, 1 skipped).
View run

…unreachable

Why:
On locked-down corporate machines pypi.org is blocked and uv must reach an
alternate index/proxy. When it cannot, `environments setup-local` fails as
E_PROVISION and the extension showed a misleading "dependency version conflict"
message, leaving users with no path forward.

What:
- Detect uv's package-index connectivity failures and surface tailored guidance:
  a popup naming UV_INDEX_URL / a pip config index-url, a "Configure package
  index" button linking uv's docs, and copy-pasteable, cross-platform remediation
  in the output channel. The raw CLI error is still shown.
- Detect precisely (E_PROVISION only): structurally exclude git sources (git+,
  "git repository") and direct distributions (.whl/.tar.), then require uv's
  "failed to fetch" aimed at a PEP 503 "/simple/" index path AND a host-unreachable
  connectivity symptom (incl. Linux and macOS DNS phrasings). This includes a
  git-NAMED package (/simple/gitpython/) while excluding git/direct-URL fetches
  and names like /simplejson-…, and leaves genuine conflicts on their own message.
  E_PYTHON_INSTALL is excluded (CPython download from a different mirror).
- Add an optional boolean `indexUnreachable` on python_env.setup.result to measure
  how often a blocked index (vs a conflict) is the cause.

Verification:
- errorMessages unit tests: 45 passing (detector incl. git-named/git-source/
  direct-URL/simple-in-name/macOS-DNS cases, message, action, remediation,
  telemetry, negatives). Full suite passed at 760 on the prior functional state.
- prettier + eslint clean.
- Reproduced against real uv 0.12.3 (UV_INDEX_URL -> a refusing endpoint):
  the genuine "Failed to fetch ... Connection refused" text maps to the guidance.
- Reviewed across five rounds (Isaac + Codex + Claude); converged with both fresh
  reviewers approving and no outstanding findings.

Co-authored-by: Isaac
@rugpanov
rugpanov force-pushed the python-setup-proxy-guidance branch from de78c4b to a341335 Compare August 14, 2026 11:11
@rugpanov
rugpanov deployed to test-trigger-is August 14, 2026 11:11 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/vscode

Inputs:

  • PR number: 2116
  • Commit SHA: a341335dc609bd643ef0290becd281d75798868f

Checks will be approved automatically on success.

@rugpanov
rugpanov deployed to test-trigger-is August 14, 2026 11:12 — with GitHub Actions Active
@rugpanov

rugpanov commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Integration tests ❌ 1 of 35 test jobs failed for a341335d (34 passed).
View run

@rugpanov
rugpanov merged commit 36aecd6 into main Aug 14, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants