Skip to content
Snippets Groups Projects
Commit 238a0b5d authored by Marcus Schiesser's avatar Marcus Schiesser
Browse files

fix: don't install root package for llamapack examples (as there isn't one)

parent 71bd256f
Branches
Tags
No related merge requests found
...@@ -86,6 +86,6 @@ export const installLlamapackProject = async ({ ...@@ -86,6 +86,6 @@ export const installLlamapackProject = async ({
await copyData({ root }); await copyData({ root });
await installLlamapackExample({ root, llamapack }); await installLlamapackExample({ root, llamapack });
if (postInstallAction !== "none") { if (postInstallAction !== "none") {
installPythonDependencies(root); installPythonDependencies({ noRoot: true });
} }
}; };
...@@ -10,9 +10,11 @@ export function isPoetryAvailable(): boolean { ...@@ -10,9 +10,11 @@ export function isPoetryAvailable(): boolean {
return false; return false;
} }
export function tryPoetryInstall(): boolean { export function tryPoetryInstall(noRoot: boolean): boolean {
try { try {
execSync("poetry install", { stdio: "inherit" }); execSync(`poetry install${noRoot ? " --no-root" : ""}`, {
stdio: "inherit",
});
return true; return true;
} catch (_) {} } catch (_) {}
return false; return false;
......
...@@ -92,12 +92,14 @@ export const addDependencies = async ( ...@@ -92,12 +92,14 @@ export const addDependencies = async (
} }
}; };
export const installPythonDependencies = (root: string) => { export const installPythonDependencies = (
{ noRoot }: { noRoot: boolean } = { noRoot: false },
) => {
if (isPoetryAvailable()) { if (isPoetryAvailable()) {
console.log( console.log(
`Installing python dependencies using poetry. This may take a while...`, `Installing python dependencies using poetry. This may take a while...`,
); );
const installSuccessful = tryPoetryInstall(); const installSuccessful = tryPoetryInstall(noRoot);
if (!installSuccessful) { if (!installSuccessful) {
console.error( console.error(
red("Install failed. Please install dependencies manually."), red("Install failed. Please install dependencies manually."),
...@@ -181,6 +183,6 @@ export const installPythonTemplate = async ({ ...@@ -181,6 +183,6 @@ export const installPythonTemplate = async ({
await addDependencies(root, addOnDependencies); await addDependencies(root, addOnDependencies);
if (postInstallAction !== "none") { if (postInstallAction !== "none") {
installPythonDependencies(root); installPythonDependencies();
} }
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment