From 31d173f7f7a2478a053ea7a2527d4bbda5c0685b Mon Sep 17 00:00:00 2001 From: Andrey Avtomonov Date: Mon, 11 May 2026 11:52:20 +0200 Subject: [PATCH] fix: restore artifact smoke python env helper --- scripts/package-artifacts.mjs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/package-artifacts.mjs b/scripts/package-artifacts.mjs index 8f38cf0b..27eee305 100644 --- a/scripts/package-artifacts.mjs +++ b/scripts/package-artifacts.mjs @@ -4,7 +4,7 @@ import { createHash } from 'node:crypto'; import { execFile } from 'node:child_process'; import { access, mkdir, mkdtemp, readFile, readdir, rm, writeFile } from 'node:fs/promises'; import { tmpdir } from 'node:os'; -import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path'; +import { delimiter, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; import { @@ -1224,6 +1224,16 @@ function pythonExecutable(projectDir) { return join(projectDir, '.venv', 'bin', 'python'); } +export function npmSmokePythonEnv(projectDir, baseEnv = process.env) { + const binDir = process.platform === 'win32' ? join(projectDir, '.venv', 'Scripts') : join(projectDir, '.venv', 'bin'); + const existingPath = baseEnv.PATH ?? ''; + + return { + ...baseEnv, + PATH: existingPath ? `${binDir}${delimiter}${existingPath}` : binDir, + }; +} + async function buildArtifacts(layout) { await rm(layout.artifactDir, { recursive: true, force: true }); await mkdir(layout.npmDir, { recursive: true });