Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 19 additions & 4 deletions 23 src/managers/builtin/venvUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ async function getPythonInfo(env: NativeEnvInfo): Promise<PythonEnvironmentInfo>
let description = undefined;
if (env.kind === NativePythonEnvironmentKind.venvUv) {
description = l10n.t('uv');
} else if (env.kind === NativePythonEnvironmentKind.uvWorkspace) {
description = l10n.t('uv workspace');
}

const binDir = path.dirname(env.executable);
Expand Down Expand Up @@ -181,7 +183,12 @@ export async function findVirtualEnvironments(
const envs = data
.filter((e) => isNativeEnvInfo(e))
.map((e) => e as NativeEnvInfo)
.filter((e) => e.kind === NativePythonEnvironmentKind.venv || e.kind === NativePythonEnvironmentKind.venvUv);
.filter(
(e) =>
e.kind === NativePythonEnvironmentKind.venv ||
e.kind === NativePythonEnvironmentKind.venvUv ||
e.kind === NativePythonEnvironmentKind.uvWorkspace,
);

for (const e of envs) {
if (!(e.prefix && e.executable && e.version)) {
Expand All @@ -194,7 +201,7 @@ export async function findVirtualEnvironments(
log.info(`Found venv environment: ${env.name}`);

// Track UV environments using environmentPath for consistency
if (e.kind === NativePythonEnvironmentKind.venvUv) {
if (e.kind === NativePythonEnvironmentKind.venvUv || e.kind === NativePythonEnvironmentKind.uvWorkspace) {
await addUvEnvironment(env.environmentPath.fsPath);
}
}
Expand Down Expand Up @@ -326,7 +333,11 @@ export async function createWithProgress(
const resolved = await nativeFinder.resolve(pythonPath);
const env = api.createPythonEnvironmentItem(await getPythonInfo(resolved), manager);

if (useUv && resolved.kind === NativePythonEnvironmentKind.venvUv) {
if (
useUv &&
(resolved.kind === NativePythonEnvironmentKind.venvUv ||
resolved.kind === NativePythonEnvironmentKind.uvWorkspace)
) {
await addUvEnvironment(env.environmentPath.fsPath);
}

Expand Down Expand Up @@ -525,7 +536,11 @@ export async function resolveVenvPythonEnvironmentPath(
): Promise<PythonEnvironment | undefined> {
const resolved = await nativeFinder.resolve(fsPath);

if (resolved.kind === NativePythonEnvironmentKind.venv || resolved.kind === NativePythonEnvironmentKind.venvUv) {
if (
resolved.kind === NativePythonEnvironmentKind.venv ||
resolved.kind === NativePythonEnvironmentKind.venvUv ||
resolved.kind === NativePythonEnvironmentKind.uvWorkspace
) {
const envInfo = await getPythonInfo(resolved);
return api.createPythonEnvironmentItem(envInfo, manager);
}
Expand Down
1 change: 1 addition & 0 deletions 1 src/managers/common/nativePythonFinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export enum NativePythonEnvironmentKind {
macCommandLineTools = 'MacCommandLineTools',
linuxGlobal = 'LinuxGlobal',
macXCode = 'MacXCode',
uvWorkspace = 'UvWorkspace',
venv = 'Venv',
venvUv = 'Uv',
virtualEnv = 'VirtualEnv',
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.