Skip to content

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

Open
edvilme wants to merge 3 commits into
mainfrom
api-version-bump
Open

feat: add getPackageAvailableVersions to public API and bump API to 1.1.0#1682
edvilme wants to merge 3 commits into
mainfrom
api-version-bump

Conversation

@edvilme

@edvilme 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 edvilme added the debt Code quality issues label Jul 30, 2026
@edvilme
edvilme force-pushed the api-version-bump branch from 4f563d7 to 540d41d Compare July 30, 2026 18:01
@edvilme 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
@edvilme
edvilme enabled auto-merge (squash) July 31, 2026 21:59
@edvilme
edvilme disabled auto-merge July 31, 2026 22:15
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 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

edvilme commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

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

@edvilme
edvilme enabled auto-merge (squash) August 3, 2026 16:58
@edvilme
edvilme requested a review from eleanorjboyd August 4, 2026 17:04
Comment thread api/CHANGELOG.md
### Changed

- Added the optional `options?: GetPackagesOptions` parameter to `PackageManager.getPackages(environment, options?)` and `PythonPackageGetterApi.getPackages(environment, options?)`. Consumers can set `options.skipCache` to request fresh package data.
- Changed `PackageManager.refresh(environment)` from `Promise<void>` to `Promise<Package[] | undefined>`, allowing implementations to return the refreshed package list.

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.

this is a big change here- we would need to go to 2.0 if we want to change the return value of this method. Any other ways we could maybe do that?

Comment thread api/CHANGELOG.md
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0]

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.

The published 1.0 package has top-level main and types; api/package.json now has only conditional exports. This accumulated unpublished change is not mentioned in the changelog.

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.

preserve top-level main and types alongside exports, and test packed ESM and legacy CommonJS consumers.

Comment thread api/CHANGELOG.md
- Added the optional `options?: GetPackagesOptions` parameter to `PackageManager.getPackages(environment, options?)` and `PythonPackageGetterApi.getPackages(environment, options?)`. Consumers can set `options.skipCache` to request fresh package data.
- Changed `PackageManager.refresh(environment)` from `Promise<void>` to `Promise<Package[] | undefined>`, allowing implementations to return the refreshed package list.
- Changed `PythonPackageGetterApi.refreshPackages(environment)` from `Promise<void>` to `Promise<Package[] | undefined>`, exposing the refreshed package list to API consumers.

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.

would also want to packed-package contract tests before publishing

@eleanorjboyd eleanorjboyd left a comment

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

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

Labels

debt Code quality issues skip tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants