Skip to content

feat: add getPackageAvailableVersions to public API and bump API to 1.1.0 - #1682

Merged
Eduardo Villalpando Mello (edvilme) merged 7 commits into
mainfrom
api-version-bump
Aug 13, 2026
Merged

feat: add getPackageAvailableVersions to public API and bump API to 1.1.0#1682
Eduardo Villalpando Mello (edvilme) merged 7 commits into
mainfrom
api-version-bump

Conversation

@edvilme

@edvilme Eduardo Villalpando Mello (edvilme) commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add PythonPackageGetterApi.getPackageAvailableVersions to the public API so consumers can query a package's available versions
  • bump @vscode/python-environments from 1.0.0 to 1.1.0
  • synchronize both API lockfile version fields
  • document the public API changes since the latest npm release

API changes

  • add PythonPackageGetterApi.getPackageAvailableVersions(environment, packageName): Promise<Pep440Version[] | undefined> — exposes a package's available versions (newest-first) to API consumers, delegating to the environment's package manager and resolving to undefined when version listing is unsupported
  • re-export Pep440Version for package manager version APIs
  • add PackageInfo.isTransitive and GetPackagesOptions.skipCache
  • add optional package manager hooks for watch targets, direct dependencies, tool versions, available package versions, and install-spec formatting
  • add the optional GetPackagesOptions parameter to PackageManager.getPackages and PythonPackageGetterApi.getPackages
  • update PackageManager.refresh and PythonPackageGetterApi.refreshPackages to return the refreshed package list when available

Validation

  • npm run lint
  • npm run compile-tests
  • npm run unittest (1494 passing, 5 pending)
  • git diff --check

@edvilme Eduardo Villalpando Mello (edvilme) added the debt Code quality issues label Jul 30, 2026
@edvilme Eduardo Villalpando Mello (edvilme) changed the title chore: bump API package version to 2.0.0 chore: bump API package version to 1.1.0 Jul 30, 2026
Add PythonPackageGetterApi.getPackageAvailableVersions so API consumers
can query a package's available versions (newest-first), delegating to the
environment's package manager and resolving to undefined when unsupported.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3f16397e-0917-4efb-8d75-566c71ebf9ba
@edvilme Eduardo Villalpando Mello (edvilme) changed the title chore: bump API package version to 1.1.0 feat: add getPackageAvailableVersions to public API and bump API to 1.1.0 Jul 31, 2026
@edvilme

Copy link
Copy Markdown
Contributor Author

Adding "skip tests" label since this functionality already exists but is now being exposed to the public API

Comment thread api/CHANGELOG.md Outdated
Comment thread api/CHANGELOG.md
Comment thread api/CHANGELOG.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

see two items about refresh and the exported top level items

@StellaHuang95

Copy link
Copy Markdown
Contributor

🔒 Automated review in progress — Stella Huang (@StellaHuang95) is auto-reviewing this PR.

Comment thread api/package.json
Comment thread api/CHANGELOG.md Outdated
Comment thread src/features/pythonApi.ts

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.

@StellaHuang95 Stella Huang (StellaHuang95) added the review-auto:approved Automated review: no blocking findings (approval posted). label Aug 6, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for addressing the previous feedback. The packed-package validation still has three blocking holes:

  1. The publish pipeline runs cp ../src/api.ts src/main.ts, but api/src is ignored and absent from a clean checkout. The step fails before compilation unless it creates the directory first.

  2. api/test/consumer.ts does not enforce the exact public return type. Assigning an explicitly narrow implementation to PythonPackageGetterApi["getPackageAvailableVersions"] still compiles if the published contract is widened to Promise<unknown> or Promise<any>. Please assert exact type equality or call the typed API and assign its result to Promise<Pep440Version[] | undefined>.

  3. The package test exercises conditional exports; require.resolve() does not prove that top-level main is present, and import.meta.resolve() can resolve a missing target. Please inspect the installed package metadata and assert top-level main and types plus all referenced target files exist.

Also, normalize or realpath the expected and resolved temporary paths: on macOS Node may return /private/var/... for a test root created as /var/..., causing a false failure.

@edvilme
Eduardo Villalpando Mello (edvilme) merged commit 772f34f into main Aug 13, 2026
84 checks passed
@edvilme
Eduardo Villalpando Mello (edvilme) deleted the api-version-bump branch August 13, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Code quality issues review-auto:approved Automated review: no blocking findings (approval posted). skip tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants