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