lxvm / AutoBZ.jl

Automatic and adaptive BZ integration for electronic properties
https://lxvm.github.io/AutoBZ.jl/
MIT License
3 stars 1 forks source link

Installation instructions in documentation do not work #41

Closed Luthaf closed 2 weeks ago

Luthaf commented 2 weeks ago

This is part of https://github.com/openjournals/joss-reviews/issues/7080

In https://lxvm.github.io/AutoBZ.jl/stable/pages/workflow/, you suggest to use the following to install the package:

using Pkg
Pkg.activate()
Pkg.add(url="https://github.com/lxvm/AutoBZ.jl.git", version="main")

This fails for me with

ERROR: ArgumentError: invalid base 10 digit 'm' in "main"
Stacktrace:
  [1] tryparse_internal(#unused#::Type{Int64}, s::SubString{String}, startpos::Int64, endpos::Int64, base_::Int64, raise::Bool)
    @ Base ./parse.jl:137
  [2] parse(::Type{Int64}, s::SubString{String}; base::Nothing)
    @ Base ./parse.jl:246
  [3] parse
    @ ./parse.jl:245 [inlined]
  [4] Pkg.Versions.VersionBound(s::SubString{String})
    @ Pkg.Versions ~/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/Versions.jl:100
  [5] Pkg.Versions.VersionRange(s::String)
    @ Pkg.Versions ~/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/Versions.jl:146
  [6] VersionSpec
    @ ~/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/Versions.jl:229 [inlined]
  [7] handle_package_input!(pkg::Pkg.Types.PackageSpec)
    @ Pkg.API ~/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/API.jl:2164
  [8] foreach
    @ ./abstractarray.jl:3075 [inlined]
  [9] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API ~/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/API.jl:155
 [10] add(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API ~/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/API.jl:145
 [11] add(; name::Nothing, uuid::Nothing, version::String, url::String, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API ./boot.jl:0
 [12] top-level scope
    @ REPL[3]:1

Using a specific tag (Pkg.add(url="https://github.com/lxvm/AutoBZ.jl.git", version="v0.5.3") fails with

ERROR: version specification invalid when tracking a repository: `0.5.3` specified for package `https://github.com/lxvm/AutoBZ.jl.git`
Stacktrace:
 [1] pkgerror(::String, ::Vararg{String})
   @ Pkg.Types ~/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/Types.jl:69
 [2] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
   @ Pkg.API ~/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/API.jl:241
 [3] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API ~/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/API.jl:156
 [4] add(pkgs::Vector{Pkg.Types.PackageSpec})
   @ Pkg.API ~/.julia/juliaup/julia-1.9.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/API.jl:145
 [5] add(; name::Nothing, uuid::Nothing, version::String, url::String, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API ./boot.jl:0
 [6] top-level scope
   @ REPL[4]:1
lxvm commented 2 weeks ago

Hi @Luthaf , thank you for the review. I can reproduce the issue and was able to successfully install the package by replacing the version keyword with rev. If this works for you I will merge the fix in #43.

This means that I expect the following to work:

using Pkg
Pkg.activate()
Pkg.add(url="https://github.com/lxvm/AutoBZ.jl.git", rev="main")
Luthaf commented 2 weeks ago

rev works, thanks!