All notable changes to the @vscode/python-environments API package are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
minimumExtensionVersionmetadata recording the independently versioned extension baseline required by this npm release.- An npm-only compatibility guard that rejects older or invalid extension versions before activation or access to the API, with localized update guidance.
- PR validation against the latest stable extension release, packed-metadata checks, and publish-time verification that shared API sources have shipped in that stable release.
- New npm releases require the latest stable extension baseline. Existing npm releases keep their original minimum; consumers targeting older extensions may need to pin an older npm package.
- Optional
capabilitiesmaps for environment and package managers, with typed keys and contextual checks. Omitted maps use legacy method inference; when present, the map must advertise every catalog key explicitly, and missing keys resolve unsupported. - Raw-provider capability resolvers and routed extension API queries that report support without invoking manager operations or prompting.
- Capability catalogs for six environment and six package features, with flat operation names. Listing includes refresh, and package installation, uninstallation, and upgrades are advertised individually rather than through a management umbrella.
- Exported
EnvironmentCapabilityandPackageCapabilityconstant objects for named access to capability keys, with derived string-literal unions. getLegacyPackageManagerCapabilityandgetLegacyEnvironmentManagerCapabilityhelpers that infer support from method presence without invoking operations. Resolvers use them automatically when a provider omits its capability map.- Optional
Support.isLegacymetadata, set to true by legacy inference helpers and included in public capability-query telemetry.
- Capability prerequisite checks have no cycle protection; providers must keep delegation chains acyclic.
- Added optional
EnvironmentManager.getVersion?(): Promise<Pep440Version | undefined>support for retrieving the version of the underlying environment management tool. Built-in implementations are provided for Conda, Poetry, Pipenv, and Pyenv.
- Added the optional
PackageManager.createForProjectfactory for package managers whose operations depend on the calling Python project. Explicit project contexts are used directly; environment-only operations use a scoped manager only when exactly one tracked project matches. - Added optional
PackageManager.disposesupport for releasing resources owned by project-scoped package managers.
- Environment-only package operations no longer fall back to an unbound project-aware package manager. When no unique project can be inferred, package reads return
undefinedand mutations and refreshes reject withNo package manager found.
- Reorganized the package source into separate API facade, public contract, and public error modules without changing the root package exports.
- Added
PackageVersionLookupNotSupportedError, thrown when a package manager cannot list a package's available versions (an unsupported capability, as distinct from an operational failure). The error exposes a stablecode('PackageVersionLookupNotSupported') discriminator. - Added the
isPackageVersionLookupNotSupportedError(error): error is PackageVersionLookupNotSupportedErrortype guard. It recognizes the error via its stablecode, so it works even when the error crosses an extension bundle boundary andinstanceofwould fail. - Added an optional
errorModetoPythonPackageGetterApi.getPackageAvailableVersions. The defaultlegacymode preserves the existingundefinedresult for unsupported lookups and operational failures. The opt-inthrowmode rejects withPackageVersionLookupNotSupportedErrorfor unsupported capabilities and propagates operational failures unchanged.
- Documented that
PackageManager.getPackageAvailableVersionsimplementations should throwPackageVersionLookupNotSupportedErrorwhen version lookup is unsupported and let operational failures propagate. Resolving toundefinedcontinues to be treated by callers as an unsupported capability.
- Added
PackageManagementInteractionOptionswith an optionalrunHeadless?: booleanproperty, mixed intoPackageManagementOptions. Whentrue, package management operations run without any user prompts or interaction — steps that would normally require input, such as selecting packages to install when none are specified, are skipped instead of prompting — for automated or headless scenarios such as integration tests. - Added
RemoveEnvironmentOptionswith an optionalrunHeadless?: booleanproperty to remove environments without a confirmation prompt in automated or headless scenarios.
- Re-exported the
Pep440Versiontype from@renovatebot/pep440for use with the new package version APIs. - Added the optional
PackageInfo.isTransitive?: booleanproperty to indicate whether a package is a transitive dependency. - Added
GetPackagesOptionswith an optionalskipCache?: booleanproperty. Whentrue, package managers bypass cached data and query the underlying package management tool. - Added optional
PackageManager.getPackageWatchTargets?(environment: PythonEnvironment): RelativePattern[]to return manager-specific filesystem patterns to monitor for package installation and removal changes, in addition to the default site-packages metadata locations. - Added optional
PackageManager.getDirectPackageNames?(environment: PythonEnvironment): Promise<Set<string> | undefined>to return a best-effort set of direct, non-transitive package names when supported by the package manager. - Added optional
PackageManager.getVersion?(environment: PythonEnvironment): Promise<Pep440Version | undefined>to return the version of the underlying package management tool, such as pip, uv, or conda. - Added optional
PackageManager.getPackageAvailableVersions?(environment: PythonEnvironment, packageName: string): Promise<Pep440Version[] | undefined>to return the available versions of a package in newest-first order when supported. - Added optional
PackageManager.formatInstallSpec?(packageName: string, version: string): stringto format a versioned install specification using manager-specific syntax, such asname==versionfor pip orname=versionfor conda. - Added
PythonPackageGetterApi.getPackageAvailableVersions(environment: PythonEnvironment, packageName: string): Promise<Pep440Version[] | undefined>so API consumers can query a package's available versions in newest-first order. Resolves toundefinedwhen the environment's package manager does not support version listing.
- Added the optional
options?: GetPackagesOptionsparameter toPackageManager.getPackages(environment, options?)andPythonPackageGetterApi.getPackages(environment, options?). Consumers can setoptions.skipCacheto request fresh package data.