From 68f056672b4b04ed294624323898c2c55a76b1fb Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Thu, 7 Mar 2019 19:08:12 -0800 Subject: [PATCH 1/3] Set JULIA_PROJECT="@." for kernel --- deps/build.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/build.jl b/deps/build.jl index e67631b7..5ed6670a 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -2,7 +2,7 @@ using Conda # Install Jupyter kernel-spec file. include("kspec.jl") -kernelpath = installkernel("Julia") +kernelpath = installkernel("Julia", env=Dict("JULIA_PROJECT"=>"@.")) # make it easier to get more debugging output by setting JULIA_DEBUG=1 # when building. From b2117c757fe061138957beaae04af81abfe578fe Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Fri, 8 Mar 2019 17:56:23 -0800 Subject: [PATCH 2/3] Use command line flags to set --project for kernel --- deps/build.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/build.jl b/deps/build.jl index 5ed6670a..19199846 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -2,7 +2,7 @@ using Conda # Install Jupyter kernel-spec file. include("kspec.jl") -kernelpath = installkernel("Julia", env=Dict("JULIA_PROJECT"=>"@.")) +kernelpath = installkernel("Julia", "--project=@.") # make it easier to get more debugging output by setting JULIA_DEBUG=1 # when building. From fef16a09197371498f747af77470adeaf2d99991 Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Wed, 13 Mar 2019 09:33:17 -0700 Subject: [PATCH 3/3] Explain project handling in README --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 8d02a281..2124c055 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,17 @@ running IJulia kernel. If your code needs to detect whether it is running in an IJulia notebook (or other Jupyter client), it can check `isdefined(Main, :IJulia) && Main.IJulia.inited`. +### Julia projects + +The default Jupyter kernel that is installed by IJulia starts with the +Julia command line flag `--project=@.`. A `Project.toml` (or `JuliaProject.toml`) +in the folder of a notebook (or in a parent folder of this notebook) will +therefore automatically become the active project for that notebook. +Users that don't want this behavior should install an additional IJulia +kernel without that command line flag (see section +[Installing additional Julia kernels](#Installing-additional-Julia-kernels)). + + ### Customizing your IJulia environment If you want to run code every time you start IJulia---but only when in IJulia---add a `startup_ijulia.jl` file to your Julia `config` directory, e.g., `~/.julia/config/startup_ijulia.jl`.