Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on Pkg #1964

Merged
merged 1 commit into from
Dec 7, 2024
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
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
FLINT_jll = "e134572f-a0d5-539d-bddf-3cad8db41a82"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RandomExtensions = "fb686558-2515-59ef-acaa-46db3789a887"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"

[compat]
AbstractAlgebra = "0.43.10"
FLINT_jll = "^300.100.100"
Libdl = "1.6"
LinearAlgebra = "1.6"
Pkg = "1.6"
Random = "1.6"
RandomExtensions = "0.4.2"
SHA = "~1.6, ~1.7, 0.7"
TOML = "<0.0.1, 1"
julia = "1.6"
54 changes: 16 additions & 38 deletions src/Nemo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

using RandomExtensions: RandomExtensions, make, Make2, Make3

import Pkg
import TOML

import SHA

Expand Down Expand Up @@ -333,6 +333,19 @@

const __isthreaded = Ref(false)

function show_banner()
PROJECT_TOML = TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))
VERSION_NUMBER = PROJECT_TOML["version"]
if isdir(joinpath(@__DIR__, "..", ".git"))
VERSION_NUMBER *= "-dev"

Check warning on line 340 in src/Nemo.jl

View check run for this annotation

Codecov / codecov/patch

src/Nemo.jl#L336-L340

Added lines #L336 - L340 were not covered by tests
end
println("")
println("Welcome to Nemo version $VERSION_NUMBER")
println("")
println("Nemo comes with absolutely no warranty whatsoever")

Check warning on line 345 in src/Nemo.jl

View check run for this annotation

Codecov / codecov/patch

src/Nemo.jl#L342-L345

Added lines #L342 - L345 were not covered by tests
end


function __init__()
# In case libgmp picks up the wrong libgmp later on, we "unset" the jl_*
# functions from the julia :libgmp.
Expand All @@ -346,10 +359,7 @@
@ccall libflint.flint_set_abort(@cfunction(flint_abort, Nothing, ())::Ptr{Nothing})::Nothing

if AbstractAlgebra.should_show_banner() && get(ENV, "NEMO_PRINT_BANNER", "true") != "false"
println("")
println("Welcome to Nemo version $(version())")
println("")
println("Nemo comes with absolutely no warranty whatsoever")
show_banner()

Check warning on line 362 in src/Nemo.jl

View check run for this annotation

Codecov / codecov/patch

src/Nemo.jl#L362

Added line #L362 was not covered by tests
end

# Initialize the thread local random state
Expand Down Expand Up @@ -377,42 +387,10 @@

###############################################################################
#
# Version information
# Hack helper
#
################################################################################

const deps = Pkg.dependencies()
if !haskey(deps, Base.UUID("2edaba10-b0f1-5616-af89-8c11ac63239a"))
version() = "building"
else
ver = deps[Base.UUID("2edaba10-b0f1-5616-af89-8c11ac63239a")]
if occursin("/dev/", ver.source)
version() = VersionNumber("$(ver.version)-dev")
else
version() = VersionNumber("$(ver.version)")
end
end

function versioninfo()
print("Nemo version $(version())\n")
nemorepo = dirname(dirname(@__FILE__))

print("Nemo: ")
prepo = Base.LibGit2.GitRepo(nemorepo)
Base.LibGit2.with(Base.LibGit2.head(prepo)) do phead
print("commit: ")
print(string(Base.LibGit2.Oid(phead))[1:8])
print(" date: ")
commit = Base.LibGit2.get(Base.LibGit2.GitCommit, prepo, Base.LibGit2.Oid(phead))
print(Base.Dates.unix2datetime(Base.LibGit2.author(commit).time))
print(")\n")
end

finalize(prepo)

return nothing
end

macro new_struct(T, args...)
return esc(Expr(:new, T, args...))
end
Expand Down
Loading