Skip to content

Commit 4bbfe7a

Browse files
committed
fix: rebase with main
1 parent 6e45c1e commit 4bbfe7a

5 files changed

Lines changed: 51 additions & 3 deletions

File tree

src/managers/builtin/pipUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { findFiles } from '../../common/workspace.apis';
99
import { EXTENSION_ROOT_DIR } from '../../common/constants';
1010
import { selectFromCommonPackagesToInstall, selectFromInstallableToInstall } from '../common/pickers';
1111
import { traceInfo } from '../../common/logging';
12-
import { Installable, mergePackages } from '../common/utils';
12+
import { mergePackages } from '../common/utils';
13+
import { Installable } from '../common/types';
1314

1415
async function tomlParse(fsPath: string, log?: LogOutputChannel): Promise<tomljs.JsonMap> {
1516
try {

src/managers/common/pickers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { QuickInputButtons, QuickPickItem, QuickPickItemButtonEvent, QuickPickIt
22
import { Common, PackageManagement } from '../../common/localize';
33
import { launchBrowser } from '../../common/env.apis';
44
import { showInputBoxWithButtons, showQuickPickWithButtons, showTextDocument } from '../../common/window.apis';
5-
import { Installable } from './utils';
5+
import { Installable } from './types';
66

77
const OPEN_BROWSER_BUTTON = {
88
iconPath: new ThemeIcon('globe'),

src/managers/common/types.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { Uri } from 'vscode';
2+
3+
export interface Installable {
4+
/**
5+
* The name of the package, requirements, lock files, or step name.
6+
*/
7+
readonly name: string;
8+
9+
/**
10+
* The name of the package, requirements, pyproject.toml or any other project file, etc.
11+
*/
12+
readonly displayName: string;
13+
14+
/**
15+
* Arguments passed to the package manager to install the package.
16+
*
17+
* @example
18+
* ['debugpy==1.8.7'] for `pip install debugpy==1.8.7`.
19+
* ['--pre', 'debugpy'] for `pip install --pre debugpy`.
20+
* ['-r', 'requirements.txt'] for `pip install -r requirements.txt`.
21+
*/
22+
readonly args?: string[];
23+
24+
/**
25+
* Installable group name, this will be used to group installable items in the UI.
26+
*
27+
* @example
28+
* `Requirements` for any requirements file.
29+
* `Packages` for any package.
30+
*/
31+
readonly group?: string;
32+
33+
/**
34+
* Description about the installable item. This can also be path to the requirements,
35+
* version of the package, or any other project file path.
36+
*/
37+
readonly description?: string;
38+
39+
/**
40+
* External Uri to the package on pypi or docs.
41+
* @example
42+
* https://pypi.org/project/debugpy/ for `debugpy`.
43+
*/
44+
readonly uri?: Uri;
45+
}

src/managers/common/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { PythonEnvironment } from '../../api';
2+
import { Installable } from './types';
23

34
export function noop() {
45
// do nothing

src/managers/conda/condaUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ import { pickProject } from '../../common/pickers/projects';
3939
import { CondaStrings, PackageManagement, Pickers } from '../../common/localize';
4040
import { showInputBox, showQuickPick, showQuickPickWithButtons, withProgress } from '../../common/window.apis';
4141
import { showErrorMessageWithLogs } from '../../common/errors/utils';
42-
import { Installable, selectFromCommonPackagesToInstall } from '../common/pickers';
42+
import { selectFromCommonPackagesToInstall } from '../common/pickers';
4343
import { quoteArgs } from '../../features/execution/execUtils';
4444
import { traceInfo } from '../../common/logging';
4545
import { untildify } from '../../common/utils/pathUtils';
4646
import { isWindows } from '../../common/utils/platformUtils';
47+
import { Installable } from '../common/types';
4748

4849
export const CONDA_PATH_KEY = `${ENVS_EXTENSION_ID}:conda:CONDA_PATH`;
4950
export const CONDA_PREFIXES_KEY = `${ENVS_EXTENSION_ID}:conda:CONDA_PREFIXES`;

0 commit comments

Comments
 (0)