feat: add getPackageAvailableVersions to public API and bump API to 1.1.0 - #1682
feat: add getPackageAvailableVersions to public API and bump API to 1.1.0#1682edvilme wants to merge 3 commits into
Conversation
4f563d7 to
540d41d
Compare
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
|
Adding "skip tests" label since this functionality already exists but is now being exposed to the public API |
| ### 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. |
There was a problem hiding this comment.
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?
| 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] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
preserve top-level main and types alongside exports, and test packed ESM and legacy CommonJS consumers.
| - 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. | ||
|
|
There was a problem hiding this comment.
would also want to packed-package contract tests before publishing
eleanorjboyd
left a comment
There was a problem hiding this comment.
see two items about refresh and the exported top level items
Summary
PythonPackageGetterApi.getPackageAvailableVersionsto the public API so consumers can query a package's available versions@vscode/python-environmentsfrom1.0.0to1.1.0API changes
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 toundefinedwhen version listing is unsupportedPep440Versionfor package manager version APIsPackageInfo.isTransitiveandGetPackagesOptions.skipCacheGetPackagesOptionsparameter toPackageManager.getPackagesandPythonPackageGetterApi.getPackagesPackageManager.refreshandPythonPackageGetterApi.refreshPackagesto return the refreshed package list when availableValidation
npm run lintnpm run compile-testsnpm run unittest(1494passing,5pending)git diff --check