Skip to content

Commit 8d731a8

Browse files
authored
If the package has a compat entry for julia, there is no need to have julia listed in Deps.toml.
1 parent 7142249 commit 8d731a8

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
@@ -201,9 +201,6 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
201201
# Compat.toml testing
202202
compatfile = abspath(data["path"], "Compat.toml")
203203
if isfile(compatfile)
204-
# If Compat.toml exists, Deps.toml must exist.
205-
Test.@test isfile(depsfile)
206-
207204
compat = Pkg.TOML.parsefile(compatfile)
208205
# Test that all names with compat is a dependency
209206
compatnames = Set{String}(x for (_, d) in compat for (x, _) in d)
@@ -239,6 +236,10 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
239236

240237
# https://github.com/JuliaRegistries/RegistryCI.jl/issues/522
241238
# For every version, each compat entry has a corresponding deps entry.
239+
#
240+
# Note: it is legal for a package to have Compat.toml but not have
241+
# Deps.toml. Specifically, this is legal if (and only if) the package
242+
# does not have any dependencies, and does have a compat entry for `julia`.
242243
if isfile(compatfile)
243244
compat_uncompressed = RegistryTools.Compress.load(compatfile)
244245
deps_uncompressed = isfile(depsfile) ? RegistryTools.Compress.load(depsfile) : Dict()
@@ -248,7 +249,13 @@ function test(path=pwd(); registry_deps::Vector{<:AbstractString}=String[])
248249
Test.@test compat_for_this_v isa AbstractDict
249250
Test.@test deps_for_this_v isa AbstractDict
250251
for compat_pkgname in keys(compat_for_this_v)
251-
Test.@test haskey(deps_for_this_v, compat_pkgname)
252+
# If the package has a compat entry for `julia`, there
253+
# is no need to have `julia` listed in Deps.toml.
254+
# However, every other compat entry needs to be listed
255+
# in Deps.toml.
256+
if compat_pkgname != julia"
257+
Test.@test haskey(deps_for_this_v, compat_pkgname)
258+
end
252259
end
253260
end
254261
end

0 commit comments

Comments
 (0)