Recommended transition to LazyArtifacts

Is there a recommended path for packages that use Artifacts to transition from

using Pkg.Artifacts


using LazyArtifacts

I’m a bit confused about how to modify Project.toml so that it works with both the 1.5 and 1.6 versions of Julia

If you need backwards compatibility with v1.5, then importing just Pkg will work.

1 Like

Under 1.6.0-DEV.1588 I get an error

julia> using MixedModels
[ Info: Precompiling MixedModels [ff71e718-51f3-5ec2-a782-8ffcbfa3c316]
ERROR: InitError: Artifact "TestData" is a lazy artifact; package developers must call `using LazyArtifacts` in MixedModels before using lazy artifacts.
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] _artifact_str(__module__::Module, artifacts_toml::String, name::SubString{String}, path_tail::String, artifact_dict::Dict{String, Any}, hash::Base.SHA1, platform::Base.BinaryPlatforms.Platform, lazyartifacts::Any)
    @ Artifacts ~/git/julia/usr/share/julia/stdlib/v1.6/Artifacts/src/Artifacts.jl:548
  [3] #invokelatest#2
    @ ./essentials.jl:707 [inlined]
  [4] invokelatest
    @ ./essentials.jl:706 [inlined]
  [5] macro expansion
    @ ~/git/julia/usr/share/julia/stdlib/v1.6/Artifacts/src/Artifacts.jl:675 [inlined]
  [6] __init__()
    @ MixedModels ~/.julia/dev/MixedModels/src/MixedModels.jl:143
  [7] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base ./loading.jl:669
  [8] _require_from_serialized(path::String)
    @ Base ./loading.jl:722
  [9] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1026
 [10] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:909
 [11] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:896
during initialization of module MixedModels

Does MixedModels import Pkg?