From f1022e487b3bea8314961d16732e1a6f96f79ba0 Mon Sep 17 00:00:00 2001 From: Sebastian Pfitzner Date: Sat, 12 Aug 2023 13:48:40 +0200 Subject: [PATCH] fix: look for Julia-specific Python in JULIA_HOME (#6393) --- news/changelog-1.4.md | 1 + src/core/jupyter/capabilities.ts | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/news/changelog-1.4.md b/news/changelog-1.4.md index e48b77f783..f5f95cc183 100644 --- a/news/changelog-1.4.md +++ b/news/changelog-1.4.md @@ -106,6 +106,7 @@ - Support for executing inline expressions (e.g. `` `{python} x` ``) - ([#6344](https://github.com/quarto-dev/quarto-cli/issues/6344)): Somewhat improve the error message in case of YAML parsing errors in metadata of Python code cells. - ([#6367](https://github.com/quarto-dev/quarto-cli/issues/6367)): Fix bug with nested code cells in the generation of Jupyter notebook from .qmd files. +- ([#6393](https://github.com/quarto-dev/quarto-cli/pull/6393)): Search `JULIA_HOME` for Julia-specific Python installations. ## OJS engine diff --git a/src/core/jupyter/capabilities.ts b/src/core/jupyter/capabilities.ts index c4334156a2..92f53e7cdd 100644 --- a/src/core/jupyter/capabilities.ts +++ b/src/core/jupyter/capabilities.ts @@ -77,9 +77,16 @@ export async function jupyterCapabilities(kernelspec?: JupyterKernelspec) { const S_IXUSR = 0o100; async function getVerifiedJuliaCondaJupyterCapabilities() { - const home = isWindows() ? Deno.env.get("USERPROFILE") : Deno.env.get("HOME"); - if (home) { - const juliaCondaPath = join(home, ".julia", "conda", "3"); + let juliaHome = Deno.env.get("JULIA_HOME"); + if (!juliaHome) { + const home = isWindows() ? Deno.env.get("USERPROFILE") : Deno.env.get("HOME"); + if (home) { + juliaHome = join(home, ".julia"); + } + } + + if (juliaHome) { + const juliaCondaPath = join(juliaHome, "conda", "3"); const bin = isWindows() ? ["python3.exe", "python.exe"] : [join("bin", "python3"), join("bin", "python")];