Skip to content

Raise PackageVersionLookupNotSupportedError - #1728

Merged
Eduardo Villalpando Mello (edvilme) merged 3 commits into
mainfrom
package-lookup-not-implemented
Aug 20, 2026
Merged

Raise PackageVersionLookupNotSupportedError#1728
Eduardo Villalpando Mello (edvilme) merged 3 commits into
mainfrom
package-lookup-not-implemented

Conversation

@edvilme

@edvilme Eduardo Villalpando Mello (edvilme) commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #1727

This pull request adds explicit package-version lookup errors without breaking existing callers.

API behavior

  • Adds PackageVersionLookupNotSupportedError with the stable code PackageVersionLookupNotSupported.
  • Adds isPackageVersionLookupNotSupportedError() for reliable detection across extension bundle boundaries.
  • Adds an optional errorMode parameter to PythonPackageGetterApi.getPackageAvailableVersions():
    • Omitted or legacy: preserves the existing behavior and resolves undefined for unsupported lookups and operational failures.
    • throw: rejects with PackageVersionLookupNotSupportedError when lookup is unsupported and propagates operational failures unchanged.
  • Provides overloads so throw mode returns Promise<Pep440Version[]>, while legacy mode returns Promise<Pep440Version[] | undefined>.

Implementations

  • Pip reports pip versions older than 21.2 as unsupported and propagates command or parsing failures in throw mode.
  • Conda propagates command and parsing failures in throw mode.
  • Poetry reports version lookup as unsupported.
  • Missing and third-party package-manager implementations are adapted according to the requested error mode.
  • The extension-owned package version picker opts into throw mode, falling back to manual entry only for the typed unsupported error.
  • Python interpreter versions such as 3.13.14.final.0 are normalized for pip lookup.

Package and tests

  • Bumps @vscode/python-environments to 1.3.0 and updates the API changelog and consumer type checks.
  • Adds focused coverage verifying the default legacy behavior and the opt-in throw mode.

@heejaechang

Heejae Chang (heejaechang) commented Aug 20, 2026

Copy link
Copy Markdown

🔒 Automated review in progress — Heejae Chang (@heejaechang) is auto-reviewing this PR.

Comment thread api/package.json
Comment thread src/api.ts Outdated
Comment thread api/test/consumer.ts
@heejaechang

Copy link
Copy Markdown

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

@heejaechang Heejae Chang (heejaechang) added the review-auto:changes-requested Automated review: posted blocking findings to address. label Aug 20, 2026
Comment thread api/package.json
Comment thread src/api.ts Outdated
@heejaechang

Copy link
Copy Markdown

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

@heejaechang

Copy link
Copy Markdown

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

@edvilme
Eduardo Villalpando Mello (edvilme) force-pushed the package-lookup-not-implemented branch 2 times, most recently from a269452 to 60345ad Compare August 20, 2026 02:56
Comment thread src/managers/builtin/pipPackageManager.ts
@heejaechang

Copy link
Copy Markdown

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

Comment thread src/internal.api.ts
@heejaechang

Copy link
Copy Markdown

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

@eleanorjboyd

Copy link
Copy Markdown
Member

heejae's review lgtm - I agree with those items and once those fixes are in I can approve it

Comment thread src/test/internalPackageManager.versionLookup.unit.test.ts Outdated
@heejaechang

Copy link
Copy Markdown

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

@heejaechang

Copy link
Copy Markdown

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

Add an opt-in throw mode for callers that need to distinguish unsupported lookups from operational failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4c801599-6aaa-4eb5-b4ed-23362ed54dbd
@heejaechang

Copy link
Copy Markdown

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved via Review Center.

@heejaechang Heejae Chang (heejaechang) added review-auto:approved Automated review: no blocking findings (approval posted). and removed review-auto:changes-requested Automated review: posted blocking findings to address. labels Aug 20, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved via Review Center.

@edvilme
Eduardo Villalpando Mello (edvilme) merged commit 9a2c114 into main Aug 20, 2026
125 of 128 checks passed
@edvilme
Eduardo Villalpando Mello (edvilme) deleted the package-lookup-not-implemented branch August 20, 2026 04:11

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved via Review Center.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved via Review Center.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved via Review Center.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature-request Request for new features or functionality review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public typed error for unsupported package version lookup

4 participants