Stream: helpdesk (published)

Topic: ✔ Nested environments?


view this post on Zulip Richard Reeve (Apr 26 2022 at 21:24):

This seems like an obvious question, but I can't find the answer anywhere. I want to have all of my environments to have Revise installed, but I don't want to have to do that manually because Revise isn't relevant to the specific project - for instance I want to have Revise installed in every environment in every examples folder in every package I write without specifying it. Is there any way of automatically including some environment (i.e. some global Project.toml / Manifest.toml) in any current environment? Or maybe a way of nesting one environment inside another?

view this post on Zulip j-fu (Apr 26 2022 at 21:53):

These are rather called "stacked" environments.
See https://discourse.julialang.org/t/why-not-always-use-revise/64589/6

It should be sufficient to add Revise to the default environment to make it available while activating project and package environments.

view this post on Zulip Richard Reeve (Apr 26 2022 at 22:05):

Thanks. I honestly had no idea that worked after god knows how long using Julia now. I can't help but feel it should be better documented! Presumably it means that I don't know without putting stuff in CI on github whether I've actually put the right dependencies into a new environment though if Julia automatically pulls things that I have in my global environment into any local environment? Is there anyway of switching it off?

view this post on Zulip Dilum Aluthge (Apr 26 2022 at 22:45):

JULIA_LOAD_PATH="@" julia --project -e 'import Pkg; Pkg.test()'

view this post on Zulip Richard Reeve (Apr 26 2022 at 22:46):

Thanks!

view this post on Zulip Notification Bot (Apr 26 2022 at 22:46):

Richard Reeve has marked this topic as resolved.

view this post on Zulip Jakob Nybo Nissen (Apr 27 2022 at 06:58):

Just tested it, on my computer when I run pkg> test, it does not use packages from the default environment (thank God!)


Last updated: Nov 22 2024 at 04:41 UTC