Skip to content

Commit 31e9292

Browse files
committed
If the package has a compat entry for julia, there is no need to have julia listed in Deps.toml.
1 parent ed9b6cb commit 31e9292

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/registry_testing.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
206206
# Compat.toml testing
207207
compatfile = abspath(data["path"], "Compat.toml")
208208
if isfile(compatfile)
209-
# If Compat.toml exists, Deps.toml must exist.
210-
Test.@test isfile(depsfile)
211-
212209
compat = Pkg.TOML.parsefile(compatfile)
213210
# Test that all names with compat is a dependency
214211
compatnames = Set{String}(x for (_, d) in compat for (x, _) in d)
@@ -244,6 +241,10 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
244241

245242
# https://github.com/JuliaRegistries/RegistryCI.jl/issues/522
246243
# For every version, each compat entry has a corresponding deps entry.
244+
#
245+
# Note: it is legal for a package to have Compat.toml but not have
246+
# Deps.toml. Specifically, this is legal if (and only if) the package
247+
# does not have any dependencies, and does have a compat entry for `julia`.
247248
if isfile(compatfile)
248249
compat_uncompressed = RegistryTools.Compress.load(compatfile)
249250
deps_uncompressed = isfile(depsfile) ? RegistryTools.Compress.load(depsfile) : Dict()
@@ -253,7 +254,13 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
253254
Test.@test compat_for_this_v isa AbstractDict
254255
Test.@test deps_for_this_v isa AbstractDict
255256
for compat_pkgname in keys(compat_for_this_v)
256-
Test.@test haskey(deps_for_this_v, compat_pkgname)
257+
# If the package has a compat entry for `julia`, there
258+
# is no need to have `julia` listed in Deps.toml.
259+
# However, every other compat entry needs to be listed
260+
# in Deps.toml.
261+
if compat_pkgname != julia"
262+
Test.@test haskey(deps_for_this_v, compat_pkgname)
263+
end
257264
end
258265
end
259266
end

0 commit comments

Comments
 (0)