Closed ericphanson closed 3 years ago
I wonder if we should have a max_depth
argument?
defaulting to type_max(Int)
I wonder if we should have a max_depth argument? defaulting to type_max(Int)
We don't need to worry about cycles because if we find a package twice we don't recurse the second time, in case that's the concern. And it's pretty fast:
julia> @time dependencies("DifferentialEquations")
0.055740 seconds (166.06 k allocations: 14.614 MiB)
Dict{String, Base.UUID} with 157 entries:
"Pkg" => UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f")
"ForwardDiff" => UUID("f6369f11-7733-5829-9624-2563aa707210")
"RecursiveFactorization" => UUID("f2c3362d-daeb-58d1-803e-2bc74f2840b4")
"SuiteSparse" => UUID("4607b0f0-06f3-5cda-b6b1-a6196a1729e9")
"ParameterizedFunctions" => UUID("65888b18-ceab-5e60-b2b9-181511a3b968")
"DelayDiffEq" => UUID("bcd4f6db-9728-5f36-b5f7-82caef46ccdb")
"MuladdMacro" => UUID("46d2c3a1-f734-5fdb-9937-b9b9aeba4221")
"TableTraits" => UUID("3783bdb8-4a98-5b6b-af9a-565f29a5fe9c")
"OffsetArrays" => UUID("6fe1bfb0-de20-5000-8ca7-80f57d26f881")
"ConstructionBase" => UUID("187b0558-2788-49d3-abe0-74a17ed4e7c9")
"OrderedCollections" => UUID("bac558e1-5e72-5ebc-8fee-abe8a469f55d")
"MultiScaleArrays" => UUID("f9640e96-87f6-5992-9c3b-0743c6a49ffa")
"StochasticDiffEq" => UUID("789caeaf-c7a9-5a7d-9973-96adeb23e2a0")
⋮ => ⋮
So I don't really see the need for limiting the depth for a perf point of view. Is it to use as a feature to see like level-1 deps, level-2 deps, etc?
LGTM!
Thanks Matt! Then I'll leave the max-depth as a possible future feature in the interest of getting this in. Could you take a quick look at #27? This PR is pointing at that one, so I'd rather merge 27 into master and then this into master, rather than merging this into 27.
Based on #27