From 4f7165ff73ecf1f88f588963ee326aba91073fd1 Mon Sep 17 00:00:00 2001 From: Renan Santos Date: Tue, 26 Nov 2024 03:17:34 -0300 Subject: [PATCH] Add native Pixi locator (#24442) Sister PR (needs to be merged first): - https://github.com/microsoft/python-environment-tools/pull/172 --- .../base/locators/common/nativePythonTelemetry.ts | 2 ++ .../base/locators/common/nativePythonUtils.ts | 2 ++ src/client/telemetry/index.ts | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/src/client/pythonEnvironments/base/locators/common/nativePythonTelemetry.ts b/src/client/pythonEnvironments/base/locators/common/nativePythonTelemetry.ts index 489b9a98c4aa..703fdfca01c3 100644 --- a/src/client/pythonEnvironments/base/locators/common/nativePythonTelemetry.ts +++ b/src/client/pythonEnvironments/base/locators/common/nativePythonTelemetry.ts @@ -67,6 +67,7 @@ export type RefreshPerformance = { MacPythonOrg?: number; MacXCode?: number; PipEnv?: number; + PixiEnv?: number; Poetry?: number; PyEnv?: number; Venv?: number; @@ -125,6 +126,7 @@ export function sendNativeTelemetry( locatorMacPythonOrg: data.data.refreshPerformance.locators.MacPythonOrg || 0, locatorMacXCode: data.data.refreshPerformance.locators.MacXCode || 0, locatorPipEnv: data.data.refreshPerformance.locators.PipEnv || 0, + locatorPixiEnv: data.data.refreshPerformance.locators.PixiEnv || 0, locatorPoetry: data.data.refreshPerformance.locators.Poetry || 0, locatorPyEnv: data.data.refreshPerformance.locators.PyEnv || 0, locatorVenv: data.data.refreshPerformance.locators.Venv || 0, diff --git a/src/client/pythonEnvironments/base/locators/common/nativePythonUtils.ts b/src/client/pythonEnvironments/base/locators/common/nativePythonUtils.ts index f840ce9a41ec..86135924537f 100644 --- a/src/client/pythonEnvironments/base/locators/common/nativePythonUtils.ts +++ b/src/client/pythonEnvironments/base/locators/common/nativePythonUtils.ts @@ -7,6 +7,7 @@ import { traceError } from '../../../../logging'; export enum NativePythonEnvironmentKind { Conda = 'Conda', + Pixi = 'Pixi', Homebrew = 'Homebrew', Pyenv = 'Pyenv', GlobalPaths = 'GlobalPaths', @@ -26,6 +27,7 @@ export enum NativePythonEnvironmentKind { const mapping = new Map([ [NativePythonEnvironmentKind.Conda, PythonEnvKind.Conda], + [NativePythonEnvironmentKind.Pixi, PythonEnvKind.Pixi], [NativePythonEnvironmentKind.GlobalPaths, PythonEnvKind.OtherGlobal], [NativePythonEnvironmentKind.Pyenv, PythonEnvKind.Pyenv], [NativePythonEnvironmentKind.PyenvVirtualEnv, PythonEnvKind.Pyenv], diff --git a/src/client/telemetry/index.ts b/src/client/telemetry/index.ts index ae4fd53adff6..357f6e60768a 100644 --- a/src/client/telemetry/index.ts +++ b/src/client/telemetry/index.ts @@ -1749,6 +1749,7 @@ export interface IEventNamePropertyMapping { "locatorMacXCode" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" }, "locatorPipEnv" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" }, "locatorPoetry" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" }, + "locatorPixi" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" }, "locatorPyEnv" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" }, "locatorVenv" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" }, "locatorVirtualEnv" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" }, @@ -1812,6 +1813,10 @@ export interface IEventNamePropertyMapping { * Time taken to find all Pipenv environments. */ locatorPipEnv?: number; + /** + * Time taken to find all Pixi environments. + */ + locatorPixi?: number; /** * Time taken to find all Poetry environments. */