import { spawn } from 'node:child_process'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); const python = path.join(root, '.venv', process.platform === 'win32' ? 'Scripts/python.exe' : 'bin/python'); const child = spawn('uv', ['pip', 'compile', 'backend/requirements.txt', 'backend/requirements-build.txt', '--python', python, '--universal', '--generate-hashes', '--output-file', 'backend/requirements.lock'], { cwd: root, stdio: 'inherit' }); child.once('error', error => { console.error(error.message); process.exitCode = 1; }); child.once('exit', code => { process.exitCode = code ?? 1; });