Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy way to load all needed packages after activating enviroment? #94

Open
oxinabox opened this issue Feb 5, 2021 · 6 comments · May be fixed by #95
Open

Easy way to load all needed packages after activating enviroment? #94

oxinabox opened this issue Feb 5, 2021 · 6 comments · May be fixed by #95

Comments

@oxinabox
Copy link
Member

oxinabox commented Feb 5, 2021

The enviroment stored in the JLSO means we always have access to the right packages.
Bu they need to be usinged (or at least Base.requireed) to have the JLSO correctly deserialize any types from them.
Else you get a UInt8 array.

Ideally we would workout which are actually used in the JLSO for a particular object and be able to using them.

A work around is to load everything.
It is a bit gross but the following works (I think it needs julia 1.4)

using Pkg: Pkg
eval(Expr(:using, (Expr(:., n) for n in Symbol.(keys(Pkg.Types.Context().env.project.deps)))...))
@axdahl
Copy link

axdahl commented Feb 5, 2021

I just tested in Julia 1.5.3 and the snippet worked.

@rofinn
Copy link
Member

rofinn commented Feb 5, 2021

Yeah, but unless we're inspecting the serialized objects this feels like more of a Pkg issue?

@oxinabox
Copy link
Member Author

oxinabox commented Feb 5, 2021

Yeah, but unless we're inspecting the serialized objects this feels like more of a Pkg issue?

I think we should do exactly that.

@rofinn
Copy link
Member

rofinn commented Feb 5, 2021

Hmm, maybe we should do that in another package? I've heard people complain that JLD2.jl doesn't do that either.

@oxinabox
Copy link
Member Author

oxinabox commented Feb 5, 2021

I think we should work it out here, and worry about generalizing later

@rofinn rofinn linked a pull request Feb 7, 2021 that will close this issue
@rofinn
Copy link
Member

rofinn commented Feb 7, 2021

Okay, added a MWE in the PR linked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants