Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
bc518ac
ref: Extract updatePackagesAndNotify
edvilme May 21, 2026
bb31351
ref: Streamline refreshPackages
edvilme May 21, 2026
6e79878
add: PackageManager::setPackages method
edvilme May 21, 2026
b655708
Lint
edvilme May 21, 2026
21a0c3c
Fix tests
edvilme May 21, 2026
34bb40a
Address PR comments
edvilme May 21, 2026
3302688
Condense fetchPackages and getPakages methods into getPackages
edvilme May 28, 2026
a1c4aa2
Remove setPackages
edvilme May 28, 2026
e30a3cb
Disable commands on transitive packages
edvilme Jun 10, 2026
4ffdcfb
feature: Manage package versions from sidebar
edvilme May 7, 2026
69738e0
validate version pep440
edvilme May 8, 2026
f976406
Version guards
edvilme May 8, 2026
94d7c3f
Add mechanisms for getting package versions
edvilme May 8, 2026
276821e
Add mechanism for uv
edvilme May 11, 2026
9d111f3
Improve comments
edvilme May 11, 2026
49cdb1b
Address pr comments
edvilme May 11, 2026
6d94c2d
Update semver versions
edvilme May 11, 2026
2e85310
Address pr comments
edvilme May 11, 2026
1bc4882
Address pr comments
edvilme May 11, 2026
6949bc5
Use renovatebot/pep440
edvilme May 11, 2026
9f229e9
Add formatInstalSpec for custom package-version strings used by diffe…
edvilme May 12, 2026
e846e1e
Use poetry package[at]version syntax
edvilme May 12, 2026
4457667
Address pr comments
edvilme May 12, 2026
968dea5
Add python version
edvilme May 16, 2026
27a9fdd
Rename managePackageVersions command
edvilme May 20, 2026
927b940
Apply suggestions from code review
edvilme May 21, 2026
a1e284a
Apply suggestions from code review
edvilme May 21, 2026
5e0fbe2
Update names for consistency
edvilme May 28, 2026
5c4b42a
Use pep440 package for version parsing
edvilme Jun 11, 2026
cf84dbd
Pass parsed versions to commands
edvilme Jun 11, 2026
f1aa37c
Fix CI build errors: replace semver with Pep440Version and fix test i…
edvilme Jun 11, 2026
8bef9af
Remove fetchPackages from PackageManager API and remove dead runProce…
edvilme Jun 16, 2026
8d88831
Add comment noting version picking is undefined for pip <= 20.3.4
edvilme Jun 16, 2026
af77b33
Show confirmation dialog when changing version of transitive package
edvilme Jun 16, 2026
1d8d49f
Remove setPackages from PackageManager interface
edvilme Jun 16, 2026
8a470d1
Fix duplicate PackageChangesCallback type export
edvilme Jun 16, 2026
4d7ce41
Remove unused parsePipInstallVersions function and tests
edvilme Jun 16, 2026
661a46b
Address PR review comments: fix unsafe parse and API mismatch
edvilme Jun 17, 2026
04cec7a
Merge branch 'main' into vscode-python-environments-package-versions
edvilme Jun 17, 2026
45f2ee7
Merge branch 'main' into vscode-python-environments-package-versions
edvilme Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,8 @@
"@types/vscode": "^1.99.0",
"mve": "^0.1.2",
"typescript": "^5.1.3"
},
"dependencies": {
"@renovatebot/pep440": "^3.1.0"
}
}
54 changes: 53 additions & 1 deletion api/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import type { Pep440Version } from '@renovatebot/pep440';
import {
Disposable,
Event,
Expand All @@ -20,6 +21,7 @@ import {
* This is the public API for other extensions to interact with the Python Environments extension.
*/

export type { Pep440Version } from '@renovatebot/pep440';
/**
* The path to an icon, or a theme-specific configuration of icons.
*/
Expand Down Expand Up @@ -711,6 +713,35 @@ export interface PackageManager {
* @returns A promise that resolves when the cache is cleared.
*/
clearCache?(): Promise<void>;

/**
* Returns the version of the underlying package management tool (e.g., pip, uv, conda).
* @param environment - The Python environment context.
* @returns A promise that resolves to a {@link Pep440Version} object, or `undefined` if not available.
*/
getVersion?(environment: PythonEnvironment): Promise<Pep440Version | undefined>;

/**
* Retrieves the list of available versions for a given package.
* @param environment - The Python environment context for the lookup.
* @param packageName - The name of the package to look up.
* @returns A promise that resolves to an array of {@link Pep440Version} objects (newest first),
* or `undefined` if this manager does not support version listing.
*/
getPackageAvailableVersions?(environment: PythonEnvironment, packageName: string): Promise<Pep440Version[] | undefined>;

Comment thread
edvilme marked this conversation as resolved.
/**
* Formats a versioned install specification for this package manager.
*
* Different package managers use different syntax (e.g. pip uses `name==version`,
* conda uses `name=version`). Implement this method to return the correct format.
* When absent, callers should default to `name==version`.
*
* @param packageName - The name of the package.
* @param version - The version string.
* @returns The install specification string (e.g. `"requests==2.31.0"` or `"requests=2.31.0"`).
*/
formatInstallSpec?(packageName: string, version: string): string;
}

/**
Expand Down Expand Up @@ -1091,12 +1122,33 @@ export interface PythonPackageManagementApi {
managePackages(environment: PythonEnvironment, options: PackageManagementOptions): Promise<void>;
}

export interface Pep440VersionApi {
/**
* Get the version of the package manager tool associated with the given environment.
*
* @param environment The Python Environment whose package manager version is requested.
* @returns The {@link Pep440Version} of the package manager tool, or `undefined` if not available.
*/
getPackageManagerVersion(environment: PythonEnvironment): Promise<Pep440Version | undefined>;

/**
* Get the list of available versions for a package from the package manager
* associated with the given environment.
*
* @param packageName The name of the package.
* @param environment The Python Environment context for the lookup.
* @returns An array of {@link Pep440Version} objects (newest first), or `undefined` if not supported.
*/
getAvailableVersions(packageName: string, environment: PythonEnvironment): Promise<Pep440Version[] | undefined>;
}
Comment thread
edvilme marked this conversation as resolved.

export interface PythonPackageManagerApi
extends
PythonPackageManagerRegistrationApi,
PythonPackageGetterApi,
PythonPackageManagementApi,
PythonPackageItemApi {}
PythonPackageItemApi,
Pep440VersionApi {}

export interface PythonProjectCreationApi {
/**
Expand Down
33 changes: 25 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@
"category": "Python Envs",
"icon": "$(trash)"
},
{
"command": "python-envs.managePackageVersion",
"title": "%python-envs.managePackageVersion.title%",
"category": "Python Envs",
"icon": "$(gear)"
},
{
"command": "python-envs.copyEnvPath",
"title": "%python-envs.copyEnvPath.title%",
Expand Down Expand Up @@ -514,6 +520,11 @@
"group": "inline",
"when": "view == env-managers && viewItem =~ /.*pythonBrokenEnvironment.*/ && viewItem =~ /.*copied.*/"
},
{
"command": "python-envs.managePackageVersion",
"group": "inline",
"when": "view == env-managers && viewItem == python-package"
},
{
"command": "python-envs.uninstallPackage",
"group": "inline",
Expand Down Expand Up @@ -556,6 +567,11 @@
"command": "python-envs.revealProjectInExplorer",
"when": "view == python-projects && viewItem =~ /.*python-workspace.*/"
},
{
"command": "python-envs.managePackageVersion",
"group": "inline",
"when": "view == python-projects && viewItem == python-package"
},
{
"command": "python-envs.uninstallPackage",
"group": "inline",
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"python-envs.revealProjectInExplorer.title": "Reveal Project in Explorer",
"python-envs.revealEnvInManagerView.title": "Reveal in Environment Managers View",
"python-envs.runPetInTerminal.title": "Run Python Environment Tool (PET) in Terminal...",
"python-envs.managePackageVersion.title": "Manage Package Version",
"python-envs.alwaysUseUv.description": "When set to true, uv will be used to manage all virtual environments if available. When set to false, uv will only manage virtual environments explicitly created by uv."
}
Loading
Loading