This commit is contained in:
Koushik Dutta
2024-03-08 19:44:28 -08:00
parent 97de3c7bf6
commit 28166a1abc
4 changed files with 26 additions and 17 deletions

View File

@@ -7,13 +7,15 @@ import { RpcMessage, RpcPeer } from "../../rpc";
import { createRpcDuplexSerializer } from '../../rpc-serializer';
import { ChildProcessWorker } from "./child-process-worker";
import { RuntimeWorkerOptions } from "./runtime-worker";
import { getPluginVolume } from '../plugin-volume';
import type {PortablePython as PortablePythonType} from '@bjia56/portable-python'
export class PythonRuntimeWorker extends ChildProcessWorker {
static {
try {
const portablePython = require('@bjia56/portable-python-3.9') as string;
if (portablePython && typeof portablePython === 'string')
const PortablePython = require('@bjia56/portable-python').PortablePython as typeof PortablePythonType;
const py = new PortablePython("3.9");
const portablePython = py.executablePath;
if (fs.existsSync(portablePython))
process.env.SCRYPTED_PYTHON_PATH = portablePython;
}
catch (e) {
@@ -87,7 +89,7 @@ export class PythonRuntimeWorker extends ChildProcessWorker {
stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe'],
env: Object.assign({
// rev this if the base python version or server characterstics change.
SCRYPTED_PYTHON_VERSION: '20240308',
SCRYPTED_PYTHON_VERSION: '20240308.1',
PYTHONUNBUFFERED: '1',
PYTHONPATH,
}, gstEnv, process.env, env),