Skip to content

Commit bf62b46

Browse files
committed
Refactor utils.js
Signed-off-by: ambuj <[email protected]>
1 parent e2cd176 commit bf62b46

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

lib/helpers/utils.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13539,8 +13539,19 @@ export function getPipFrozenTree(
1353913539
thoughtLog("Performing poetry install");
1354013540
let poetryInstallArgs = ["-m", "poetry", "install", "-n", "--no-root"];
1354113541

13542-
const pyprojectpath = safeExistsSync(join(basePath, "pyproject.toml"));
13543-
const isPoetryV2 = parsePyProjectTomlFile(pyprojectpath).isPoetryV2;
13542+
const pyprojectpath = safeExistsSync(join(basePath, "pyproject.toml"))
13543+
? join(basePath, "pyproject.toml")
13544+
: null;
13545+
let isPoetryV2 = false;
13546+
if (pyprojectpath) {
13547+
try {
13548+
isPoetryV2 =
13549+
parsePyProjectTomlFile(pyprojectpath).isPoetryV2 || false;
13550+
} catch (err) {
13551+
thoughtLog(`Failed to parse pyproject.toml: ${err.message}`);
13552+
}
13553+
}
13554+
// isPoetryV2 = parsePyProjectTomlFile(pyprojectpath).isPoetryV2;
1354413555
// checking if poetryV2 is true or not
1354513556
if (isPoetryV2) {
1354613557
// Include all dependency groups and extras (Poetry v2+)

0 commit comments

Comments
 (0)