Project.toml 이 없는 경우 역으로 toml 파일을 만드는 데 유용하다
using Pkg
function _installed()
@warn "Pkg.installed() is deprecated"
deps = Pkg.dependencies()
installs = Dict{String, VersionNumber}()
for (uuid, dep) in deps
dep.is_direct_dep || continue
dep.version === nothing && continue
installs[dep.name] = dep.version
end
return installs
end
_installed()
name= "StochDynamicProgramming"
deps = Pkg.dependencies()
depends = nothing
pkg_uuid = nothing
for (uuid, dep) in deps
if dep.name == name
@show dep
depends = deepcopy(dep)
pkg_uuid = uuid
break
end
end
depends.dependencies
결과
Dict{String,Base.UUID} with 7 entries:
"Compat" => UUID("34da2185-b29b-5c13-b0c7-acf172513d20")
"CutPruners" => UUID("65d46eb8-70e9-5a30-bf48-2afa3a021b8f")
"Distributions" => UUID("31c24e10-a181-5473-b8eb-7969acd0382f")
"DocStringExtensions" => UUID("ffbed154-4ef7-542d-bbb7-c09d3a79fcae")
"Interpolations" => UUID("a98d9a8b-a2ab-59e6-89dd-64a1c18fca59")
"ProgressMeter" => UUID("92933f4c-e287-5a05-a399-4b506db050ca")
"JuMP" => UUID("4076af6c-e467-56ae-b986-b466b2749572")
소스 (Jupyter HTML) ==> Here