Version number in packages with Pkg.clone()

pkg

#1

I’m developing a package and would like to give it version numbers. I don’t want to register it on julias official METADATA yet so Pkg.clone()-support seems like a reasonable solution. Is it still possible to add version numbers?

julia> Pkg.clone("git@github.com:nep-pack/NonlinearEigenproblems.jl.git");
INFO: Cloning NonlinearEigenproblems from git@github.com:nep-pack/NonlinearEigenproblems.jl.git
INFO: Computing changes...
INFO: No packages to install, update or remove
julia> Pkg.status("NonlinearEigenproblems")
 - NonlinearEigenproblems        0.0.0-             master (unregistered)

Julia version 0.6.3. Still using the “old” Pkg-system, not Pkg3. Would this be easier in Pkg3?


#2

Those version numbers are just git-tags; You can create tags on GitHub on the release page of your repo, or create a tag from the command line: https://git-scm.com/book/en/v2/Git-Basics-Tagging


#3

Super thanks for quick response.

There must be something I’m missing still. I still don’t get a version number even after adding a tag/release.

julia> Pkg.rm("NonlinearEigenproblems")
INFO: Removing NonlinearEigenproblems (unregistered)
julia> Pkg.clone("git@github.com:jarlebring/NonlinearEigenproblems.jl.git")
julia> Pkg.status("NonlinearEigenproblems")
 - NonlinearEigenproblems        0.0.0-             master (unregistered)

(Note: different repo from original post) It has tags/releases:

jarl@bjork:~/.julia/v0.6/NonlinearEigenproblems$ git tag
v0.0.1
v0.1.0
v0.2.0
v0.3.0
jarl@bjork:~/.julia/v0.6/NonlinearEigenproblems$ 

#4

Ah, I guess I was wrong about what information is shown in Pkg.status; seems like it just shows 0.0.0 for all unregistered packages? At least you have “given it version numbers” when you created the tags, in the sense that you can do git checkout v0.1.0 etc.


#5

Aha. I think one can do even more because of the git tags. With PkgDev.register you can register the package locally on disk in the .julia/v0.6/METDATA. So I just had to run

julia> PkgDev.register("NonlinearEigenproblems");
julia> Pkg.status("NonlinearEigenproblems");
 - NonlinearEigenproblems        0.3.0

Thanks for the assistance.