Skip to content

Commit

Permalink
Use banner showing code from AbstractAlgebra (#1714)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Apr 12, 2024
1 parent c8a1ee4 commit 5fac404
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RandomExtensions = "fb686558-2515-59ef-acaa-46db3789a887"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[compat]
AbstractAlgebra = "0.40.0"
AbstractAlgebra = "0.40.8"
Antic_jll = "~0.201.500"
Arb_jll = "~200.2300.000"
Calcium_jll = "~0.401.100"
Expand Down
23 changes: 1 addition & 22 deletions src/Nemo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -353,28 +353,7 @@ function __init__()
ccall((:flint_set_abort, libflint), Nothing,
(Ptr{Nothing},), @cfunction(flint_abort, Nothing, ()))

# Check if were loaded from another package
# if VERSION < 1.7.*, only the "other" package will have the
# _tryrequire_from_serialized in the backtrace.
# if VERSION >= 1.8, also doing 'using Package' will have
# _tryrequire_from_serialized the backtrace.
#
# To still distinguish both scenarios, notice that
# 'using OtherPackage' will either have _tryrequire_from_serialized at least twice,
# or one with four arguments (hence five as the function name is the first argument)
# 'using Package' serialized will have a version with less arguments
bt = Base.process_backtrace(Base.backtrace())
filter!(sf -> sf[1].func === :_tryrequire_from_serialized, bt)
isinteractive_manual =
length(bt) == 0 || (length(bt) == 1 && length(only(bt)[1].linfo.specTypes.parameters) < 4)

# Respect the -q and --banner flag
allowbanner = Base.JLOptions().banner != 0

if allowbanner && isinteractive_manual && isinteractive() &&
!any(x -> x.name in ("Hecke", "Oscar", "Singular"), keys(Base.package_locks)) &&
get(ENV, "NEMO_PRINT_BANNER", "true") != "false"

if AbstractAlgebra.should_show_banner() && get(ENV, "NEMO_PRINT_BANNER", "true") != "false"
println("")
println("Welcome to Nemo version $(version())")
println("")
Expand Down

0 comments on commit 5fac404

Please sign in to comment.