Open bencottier opened 2 years ago
I think the reason it doesn't work with Pkg.test
in particular is that Pkg.test
ultimately runs this to remove the julia base environment from LOAD_PATH
.
The reason I made an issue here is that I'd expect the IJulia kernel to inherit the --startup-file
option from any parent process, unless there is particular reason not to. This kind of thing can be done using Base.julia_cmd()
. But I guess there are special reasons for overriding other julia options, like -i
?
From the git blame of https://github.com/JuliaLang/IJulia.jl/blob/8710cd4bc1adabfacb8d9caec56332e36daa1f90/deps/kspec.jl#L97
I found https://github.com/JuliaLang/Pkg.jl/issues/1815/ which is a reason to not specify --startup-file
😕
Ah, I now realise the command to start the kernel is normally set one time in installkernel
, so that makes it difficult to change the startup-file
option.
@bencottier, are you able to nbconvert
within the Julia REPL?
IIRC, yes I was able to nbconvert
within the Julia REPL. (Sorry, I'm no longer working with Julia so this issue is no longer relevant to me.)
I have a Julia package with a function that runs
nbconvert
- it's actually usingWeave.notebook
but I've since found a MWE.I want to test the function that runs
nbconvert
but I hit an error whennbconvert
runs the Julia kernel.MWE setup
For the MWE I created a package/folder
IJuliaPkgTest.jl
with the following structure:Project.toml
:src/IJuliaPkgTest.jl
just containsmodule IJuliaPkgTest end
.test/runtests.jl
:Finally,
test.ipynb
:The problem
Here is the error when I run
Pkg.test
. The key thing is this after the julia kernel starts:As you can see I have a
startup.jl
file, which containsusing Revise
. I haveRevise.jl
in my base environment, but the base environment doesn't seem to be available here.Full logs:
My guess is this has something to do with
Pkg.test
runningjulia
with--startup-file=no
and the IJulia kernel running with the default--startup-file=yes
. ThePkg.test
command looks like this:But it's not just that, because this seems to run OK:
versioninfo