Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/AutoMerge/guidelines.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
using HTTP: HTTP

# TODO: change this value to `true` once we are ready to re-enable the
# "Require `[compat]` for stdlib dependencies" feature.
#
# For example, we might consider changing this value to `true`
# once Julia 1.6 is no longer the LTS.
const _AUTOMERGE_REQUIRE_STDLIB_COMPAT = false

const guideline_registry_consistency_tests_pass = Guideline(;
info="Registy consistency tests",
docs=nothing,
Expand Down Expand Up @@ -91,8 +98,15 @@ function meets_compat_for_all_deps(working_directory::AbstractString, pkg, versi
for version_range in keys(deps)
if version in Pkg.Types.VersionRange(version_range)
for name in keys(deps[version_range])
if !is_jll_name(name)
@debug("Found a new (non-JLL) dependency: $(name)")
if _AUTOMERGE_REQUIRE_STDLIB_COMPAT
debug_msg = "Found a new (non-JLL) dependency: $(name)"
apply_compat_requirement = !is_jll_name(name)
else
debug_msg = "Found a new (non-stdlib non-JLL) dependency: $(name)"
apply_compat_requirement = !is_jll_name(name) && !is_julia_stdlib(name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this function exists anymore, we'd need to restore it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Restored in 46b5d70

end
if apply_compat_requirement
@debug debug_msg
dep_has_compat_with_upper_bound[name] = false
end
end
Expand Down
14 changes: 14 additions & 0 deletions src/AutoMerge/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,20 @@ function comment_text_merge_now()
return result
end

is_julia_stdlib(name) = name in julia_stdlib_list()

function julia_stdlib_list()
stdlib_list = readdir(Pkg.Types.stdlib_dir())
# Before Julia v1.6 Artifacts.jl isn't a standard library, but
# we want to include it because JLL packages depend on the empty
# placeholder https://github.com/JuliaPackaging/Artifacts.jl
# in older versions for compatibility.
if VERSION < v"1.6.0"
push!(stdlib_list, "Artifacts")
end
return stdlib_list
end

function now_utc()
utc = TimeZones.tz"UTC"
return Dates.now(utc)
Expand Down