-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
34 lines (29 loc) · 883 Bytes
/
Copy pathtypes.ts
File metadata and controls
34 lines (29 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
export interface PythonProcessResult {
readonly stdout: string;
readonly stderr: string;
readonly exitCode: number;
}
export interface ExecutionOptions {
readonly timeout?: number;
readonly env?: Record<string, string>;
readonly cwd?: string;
}
export interface PythonModuleConfig {
readonly name: string;
readonly version: string;
readonly dependencies: ReadonlyArray<string>;
}
export type PythonRuntime = 'python3' | 'pypy3' | 'python3.11';
/**
* Orchestrates external python process lifecycle
*/
export interface IProcessManager {
execute(command: string, options?: ExecutionOptions): Promise<PythonProcessResult>;
validateRuntime(runtime: PythonRuntime): Promise<boolean>;
}
export class PythonRuntimeError extends Error {
constructor(public readonly code: number, message: string) {
super(message);
this.name = 'PythonRuntimeError';
}
}