Skip to content

Commit

Permalink
If the package has a compat entry for julia, there is no need to ha…
Browse files Browse the repository at this point in the history
…ve `julia` listed in Deps.toml.
  • Loading branch information
DilumAluthge authored Oct 28, 2023
1 parent 7142249 commit 8d731a8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/registry_testing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
# Compat.toml testing
compatfile = abspath(data["path"], "Compat.toml")
if isfile(compatfile)
# If Compat.toml exists, Deps.toml must exist.
Test.@test isfile(depsfile)

compat = Pkg.TOML.parsefile(compatfile)
# Test that all names with compat is a dependency
compatnames = Set{String}(x for (_, d) in compat for (x, _) in d)
Expand Down Expand Up @@ -239,6 +236,10 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])

# https://github.com/JuliaRegistries/RegistryCI.jl/issues/522
# For every version, each compat entry has a corresponding deps entry.
#
# Note: it is legal for a package to have Compat.toml but not have
# Deps.toml. Specifically, this is legal if (and only if) the package
# does not have any dependencies, and does have a compat entry for `julia`.
if isfile(compatfile)
compat_uncompressed = RegistryTools.Compress.load(compatfile)
deps_uncompressed = isfile(depsfile) ? RegistryTools.Compress.load(depsfile) : Dict()
Expand All @@ -248,7 +249,13 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
Test.@test compat_for_this_v isa AbstractDict
Test.@test deps_for_this_v isa AbstractDict
for compat_pkgname in keys(compat_for_this_v)
Test.@test haskey(deps_for_this_v, compat_pkgname)
# If the package has a compat entry for `julia`, there
# is no need to have `julia` listed in Deps.toml.
# However, every other compat entry needs to be listed
# in Deps.toml.
if compat_pkgname != julia"
Test.@test haskey(deps_for_this_v, compat_pkgname)
end
end
end
end
Expand Down

0 comments on commit 8d731a8

Please sign in to comment.