tfiers / PkgGraph.jl

Visualize the dependency graph of a Julia package
https://tfiers.github.io/PkgGraph.jl
MIT License
42 stars 2 forks source link

Get Julia 1.6 support back (only for if pkg in project) #73

Open tfiers opened 1 year ago

tfiers commented 1 year ago

Re bd4f3de ("fix #71; by dropping Julia 1.6 support, lol"):

keep julia 1.6 support (and get our small patches back (in test, and in ["deps"])). just with existing limitation (only in active proj; not querying registry)

tfiers commented 1 year ago

From

function reachable_registries(; depots::Union{String, Vector{String}}=Base.DEPOT_PATH)
    # collect registries
    if depots isa String
        depots = [depots]
    end
    registries = RegistryInstance[]
    for d in depots
        isdir(d) || continue
        reg_dir = joinpath(d, "registries")
        isdir(reg_dir) || continue
        reg_paths = readdir(reg_dir; join=true)
        candidate_registries = String[]
        # All folders could be registries
        append!(candidate_registries, filter(isdir, reg_paths))
        if registry_read_from_tarball()
            compressed_registries = filter(endswith(".toml"), reg_paths)
            # if we are reading compressed registries, ignore compressed registries
            # with the same name
            compressed_registry_names = Set([splitext(basename(file))[1] for file in compressed_registries])
            filter!(x -> !(basename(x) in compressed_registry_names), candidate_registries)
            for compressed_registry in compressed_registries
                if verify_compressed_registry_toml(compressed_registry)
                    push!(candidate_registries, compressed_registry)
                end
            end
        end

        for candidate in candidate_registries
            # candidate can be either a folder or a TOML file
            if isfile(joinpath(candidate, "Registry.toml")) || isfile(candidate)
                push!(registries, RegistryInstance(candidate))
            end
        end
    end
    return registries
end

also see, ofc, how reachable regs is defined in Pkg now

tfiers commented 1 year ago

Actually: just import PkgDeps :) (@static if or sth, on Version < 1.7 only)

tfiers commented 1 year ago

Removing from v1 milestone. We're on julia 1.9 now (even though 1.6 is LTS)