-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
I'm not actually that knowledgeable about RegistryInstances, but I think (hope) that it would allow us to get rid of all the custom registry parsing we do here:
DocumentationGenerator.jl/src/utils/pkgtools.jl
Lines 312 to 354 in e553973
| function installable_on_version(reg::UnifiedRegistryInfo, version) | |
| allpkgs = Dict() | |
| pkgpaths = map(x -> x.metadir, collect(values(reg.info))) | |
| filter!(isdir, pkgpaths) | |
| if isempty(pkgpaths) | |
| @error "No package folders found inside the registry" | |
| return allpkgs | |
| end | |
| for pkg in pkgpaths | |
| "Compat.toml" in readdir(pkg) || continue | |
| pkgtoml = Pkg.TOML.parsefile(joinpath(pkg, "Package.toml")) | |
| versions = Pkg.TOML.parsefile(joinpath(pkg, "Versions.toml")) | |
| compat = Pkg.TOML.parsefile(joinpath(pkg, "Compat.toml")) | |
| compatible_versions = VersionNumber[] | |
| for pkgver in keys(compat) | |
| try | |
| if haskey(compat[pkgver], "julia") | |
| if any(in.(version, Pkg.Types.VersionRange.(compat[pkgver]["julia"]))) | |
| append!(compatible_versions, [ | |
| VersionNumber(v) for v in keys(versions) if | |
| VersionNumber(v) in Pkg.Types.VersionRange(pkgver) | |
| ]) | |
| end | |
| else | |
| append!(compatible_versions, [ | |
| VersionNumber(v) for v in keys(versions) if | |
| VersionNumber(v) in Pkg.Types.VersionRange(pkgver) | |
| ]) | |
| end | |
| catch err | |
| @error err | |
| end | |
| end | |
| allpkgs[pkgtoml["uuid"]] = ( | |
| name = pkgtoml["name"], | |
| url = pkgtoml["repo"], | |
| uuid = pkgtoml["uuid"], | |
| path = pkg, | |
| versions = compatible_versions, | |
| ) | |
| end | |
| allpkgs | |
| end |
And also it would hopefully support the zipped up registry format out of the box as well.
Metadata
Metadata
Assignees
Labels
No labels