jupyterhub / repo2docker

Turn repositories into Jupyter-enabled Docker images
https://repo2docker.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.63k stars 362 forks source link

julia_project.py: fix Pkg REPL api warning #1376

Open fonsp opened 1 month ago

fonsp commented 1 month ago

Repo2docker currently prints this warning when using a Julia project:

Warning: The Pkg REPL mode is intended for interactive use only, and should not be used from scripts. It is recommended to use the functional API instead.
└ @ Pkg.REPLMode /srv/julia/share/julia/stdlib/v1.10/Pkg/src/REPLMode/REPLMode.jl:382
  at 12:24:22

This PR fixes that. I also used Pkg.instantiate() instead of Pkg.precompile() because it makes a bit more sense in this context: we want to guarantee that packages are instantiated (which precompiles at the end), not just that they are precompiled: https://pkgdocs.julialang.org/v1/api/#Pkg.instantiate

I believe that resolve already instantiates (and precompiles), but this is not defined in spec so it is good to add the instantiate call.