Skip to content

Commit 49061c3

Browse files
committed
fix main CI
1 parent 7dfce4b commit 49061c3

3 files changed

Lines changed: 22 additions & 5 deletions

File tree

analysis/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["uv_build>=0.10.2,<0.11.0"]
33
build-backend = "uv_build"
44

55
[tool.uv.build-backend]
6-
module-root = ""
6+
module-root = ".."
77

88
[project]
99
name = "analysis"

src/managers/builtin/helpers.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ export async function runUV(
6464
cwd?: string,
6565
log?: LogOutputChannel,
6666
token?: CancellationToken,
67+
timeout?: number,
6768
): Promise<string> {
6869
log?.info(`Running: uv ${args.join(' ')}`);
6970
return new Promise<string>((resolve, reject) => {
70-
const proc = spawnProcess('uv', args, { cwd: cwd });
71+
const proc = spawnProcess('uv', args, { cwd: cwd, timeout });
7172
token?.onCancellationRequested(() => {
7273
proc.kill();
7374
reject(new CancellationError());
@@ -104,10 +105,11 @@ export async function runPython(
104105
cwd?: string,
105106
log?: LogOutputChannel,
106107
token?: CancellationToken,
108+
timeout?: number,
107109
): Promise<string> {
108110
log?.info(`Running: ${python} ${args.join(' ')}`);
109111
return new Promise<string>((resolve, reject) => {
110-
const proc = spawnProcess(python, args, { cwd: cwd });
112+
const proc = spawnProcess(python, args, { cwd: cwd, timeout });
111113
token?.onCancellationRequested(() => {
112114
proc.kill();
113115
reject(new CancellationError());

src/managers/builtin/utils.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,29 @@ export async function refreshPythons(
139139
return sortEnvironments(collection);
140140
}
141141

142+
const PIP_LIST_TIMEOUT_MS = 30_000;
143+
142144
async function refreshPipPackagesRaw(environment: PythonEnvironment, log?: LogOutputChannel): Promise<string> {
143145
// Use environmentPath directly for consistency with UV environment tracking
144146
const useUv = await shouldUseUv(log, environment.environmentPath.fsPath);
145147
if (useUv) {
146-
return await runUV(['pip', 'list', '--python', environment.execInfo.run.executable], undefined, log);
148+
return await runUV(
149+
['pip', 'list', '--python', environment.execInfo.run.executable],
150+
undefined,
151+
log,
152+
undefined,
153+
PIP_LIST_TIMEOUT_MS,
154+
);
147155
}
148156
try {
149-
return await runPython(environment.execInfo.run.executable, ['-m', 'pip', 'list'], undefined, log);
157+
return await runPython(
158+
environment.execInfo.run.executable,
159+
['-m', 'pip', 'list'],
160+
undefined,
161+
log,
162+
undefined,
163+
PIP_LIST_TIMEOUT_MS,
164+
);
150165
} catch (ex) {
151166
log?.error('Error running pip list', ex);
152167
log?.info(

0 commit comments

Comments
 (0)