Skip to content

Commit 7589e58

Browse files
authored
AutoMerge: temporarily disable the "Require [compat] for stdlib dependencies" feature" (#540)
* AutoMerge: temporarily disable the "Require `[compat]` for stdlib dependencies" feature" * Add more detail to a comment * Restore the `is_julia_stdlib` and `julia_stdlib_list` functions
1 parent 2a13ff8 commit 7589e58

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

src/AutoMerge/guidelines.jl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
using HTTP: HTTP
22

3+
# TODO: change this value to `true` once we are ready to re-enable the
4+
# "Require `[compat]` for stdlib dependencies" feature.
5+
#
6+
# For example, we might consider changing this value to `true`
7+
# once Julia 1.6 is no longer the LTS.
8+
const _AUTOMERGE_REQUIRE_STDLIB_COMPAT = false
9+
310
const guideline_registry_consistency_tests_pass = Guideline(;
411
info="Registy consistency tests",
512
docs=nothing,
@@ -91,8 +98,15 @@ function meets_compat_for_all_deps(working_directory::AbstractString, pkg, versi
9198
for version_range in keys(deps)
9299
if version in Pkg.Types.VersionRange(version_range)
93100
for name in keys(deps[version_range])
94-
if !is_jll_name(name)
95-
@debug("Found a new (non-JLL) dependency: $(name)")
101+
if _AUTOMERGE_REQUIRE_STDLIB_COMPAT
102+
debug_msg = "Found a new (non-JLL) dependency: $(name)"
103+
apply_compat_requirement = !is_jll_name(name)
104+
else
105+
debug_msg = "Found a new (non-stdlib non-JLL) dependency: $(name)"
106+
apply_compat_requirement = !is_jll_name(name) && !is_julia_stdlib(name)
107+
end
108+
if apply_compat_requirement
109+
@debug debug_msg
96110
dep_has_compat_with_upper_bound[name] = false
97111
end
98112
end

src/AutoMerge/util.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,20 @@ function comment_text_merge_now()
239239
return result
240240
end
241241

242+
is_julia_stdlib(name) = name in julia_stdlib_list()
243+
244+
function julia_stdlib_list()
245+
stdlib_list = readdir(Pkg.Types.stdlib_dir())
246+
# Before Julia v1.6 Artifacts.jl isn't a standard library, but
247+
# we want to include it because JLL packages depend on the empty
248+
# placeholder https://github.com/JuliaPackaging/Artifacts.jl
249+
# in older versions for compatibility.
250+
if VERSION < v"1.6.0"
251+
push!(stdlib_list, "Artifacts")
252+
end
253+
return stdlib_list
254+
end
255+
242256
function now_utc()
243257
utc = TimeZones.tz"UTC"
244258
return Dates.now(utc)

0 commit comments

Comments
 (0)