mirror of
https://github.com/koush/scrypted.git
synced 2026-04-27 10:20:27 +01:00
postbeta
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user