( workPath: string, env: NodeJS.ProcessEnv, systemPython: string, uvPath: string | null )
| 557 | } |
| 558 | |
| 559 | async function getMultiServicePythonRunner( |
| 560 | workPath: string, |
| 561 | env: NodeJS.ProcessEnv, |
| 562 | systemPython: string, |
| 563 | uvPath: string | null |
| 564 | ): Promise<PythonRunner> { |
| 565 | // Use an existing .venv/venv if present and allowed (single Python service in a project). |
| 566 | const { pythonCmd, venvRoot } = useVirtualEnv(workPath, env, systemPython); |
| 567 | if (venvRoot) { |
| 568 | debug(`Using existing virtualenv at ${venvRoot} for multi-service dev`); |
| 569 | return { command: pythonCmd, args: [] }; |
| 570 | } |
| 571 | |
| 572 | // Create a per-service .venv, so deps are managed separately. |
| 573 | const venvPath = join(workPath, '.venv'); |
| 574 | await ensureVenv({ |
| 575 | pythonVersion: { pythonPath: systemPython }, |
| 576 | venvPath, |
| 577 | uvPath, |
| 578 | quiet: true, |
| 579 | }); |
| 580 | debug(`Created virtualenv at ${venvPath} for multi-service dev`); |
| 581 | |
| 582 | const pythonBin = getVenvPythonBin(venvPath); |
| 583 | const binDir = getVenvBinDir(venvPath); |
| 584 | env.VIRTUAL_ENV = venvPath; |
| 585 | env.PATH = `${binDir}${delimiter}${env.PATH || ''}`; |
| 586 | |
| 587 | return { command: pythonBin, args: [] }; |
| 588 | } |
| 589 | |
| 590 | export const startDevServer: StartDevServer = async opts => { |
| 591 | const { |
no test coverage detected