fix(compliance): use PYTHON_BIN env var for venv support
Modern Debian/Ubuntu enforces PEP 668 which blocks system-wide pip installs. The backend now reads PYTHON_BIN from the environment (defaulting to 'python3') so each server can point to a venv. Updates README with venv setup instructions.
This commit is contained in:
@@ -17,6 +17,7 @@ const fs = require('fs');
|
||||
const { spawn } = require('child_process');
|
||||
|
||||
const PARSER_SCRIPT = path.join(__dirname, '../scripts/parse_compliance_xlsx.py');
|
||||
const PYTHON_BIN = process.env.PYTHON_BIN || 'python3';
|
||||
const TEMP_DIR = path.join(process.cwd(), 'uploads', 'temp');
|
||||
const ALLOWED_TEAMS = new Set(['STEAM', 'ACCESS-ENG', 'ACCESS-OPS', 'INTELDEV']);
|
||||
|
||||
@@ -47,7 +48,7 @@ function dbAll(db, sql, params = []) {
|
||||
// ---------------------------------------------------------------------------
|
||||
function parseXlsx(filePath) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const py = spawn('python3', [PARSER_SCRIPT, filePath]);
|
||||
const py = spawn(PYTHON_BIN, [PARSER_SCRIPT, filePath]);
|
||||
let out = '';
|
||||
let err = '';
|
||||
py.stdout.on('data', d => { out += d; });
|
||||
|
||||
Reference in New Issue
Block a user