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 Pkg from dependencies #1896

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ 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"
Expand All @@ -17,7 +16,6 @@ AbstractAlgebra = "0.43.4"
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"
Expand Down
14 changes: 1 addition & 13 deletions src/Nemo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

using RandomExtensions: RandomExtensions, make, Make2, Make3

import Pkg

import SHA

# N.B: do not import div, divrem from Base
Expand Down Expand Up @@ -383,17 +381,7 @@
#
################################################################################

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
version() = Base.get_pkgversion_from_path(pkgdir)

Check warning on line 384 in src/Nemo.jl

View check run for this annotation

Codecov / codecov/patch

src/Nemo.jl#L384

Added line #L384 was not covered by tests
Copy link
Member

Choose a reason for hiding this comment

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

If this was just about the Package version, we could use the Compat package and then Compat.pkgversion(Nemo).

However this code also tries to determine if one is using a dev version, i.e., whether it is being run from a git clone. Alas the code for doing that is buggy already (it checks whether /dev/ is in the path, which is OK if someone used Pkg.develop but not for people like me who manually git clone repositories).

Interestingly Nemo.versioninfo tries to get a more thorough git status, but it is also broken (at least with Julia 1.10 and 1.11)

julia> Nemo.versioninfo()
Nemo version 0.47.1
Nemo: ERROR: UndefVarError: `LibGit2` not defined in `Base`

Copy link
Member

Choose a reason for hiding this comment

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

In Oscar.jl we instead use this code to determine if it is a dev version (but this is also far from perfect -- and it uses Pkg):

const is_dev = (function()
        deps = Pkg.dependencies()
        if Base.haskey(deps, PROJECT_UUID)
          if deps[PROJECT_UUID].is_tracking_path
            return true
          end
        end
        return occursin("-dev", lowercase(string(VERSION_NUMBER)))
    end)()


function versioninfo()
print("Nemo version $(version())\n")
Expand Down
Loading