Registering a Julia Package

Registering Your Julia Package

After following the package developement guidelines (for naming, testing, requirements, etc), making your package available to the community can be done as follows:

  1. Make sure all dependecies are up-to-date and that the updates did not break your package
    Pkg.update()
    Pkg.test("MyPackage")
    
  2. Work on a new branch of METADATA. This step is optional but recommended if you plan to register more than one package as it allows to submit pull requests per package. See below for steps
  3. Register and tag your package to your local METADATA
    Pkg.register("MyPackage")
    Pkg.tag("MyPackage")
    
  4. Finally, merge your changes the METADATA to the official repository using a pull request
    Pkg.publish()
    

During this process you may run into GitHub login issues that can be fixed by configuring your global user name

git config --global github.user USERNAME

Additional tips on trouble shooting and manual publishing of the METADATA is dicussed in the official Julia Documentation

Branch metadata

  • METADATA.jl is a an actual repository at git://github.com/JuliaLang/METADATA.jl and the current branch is metadata-v2. To verify this information:cd ~/.julia/v0.4/METADATA

    git remote -v

    origin git://github.com/JuliaLang/METADATA.jl (fetch)
    origin git@github.com:JuliaLang/METADATA.jl.git (push)

    git branch -a

    *metadata-v2
    remotes/origin/HEAD -> origin/metadata-v2
    remotes/origin/jn/gtk0.10.0
    remotes/origin/kf/adoptshowoff
    remotes/origin/metadata-v0
    remotes/origin/metadata-v1
    remotes/origin/metadata-v2
    remotes/origin/omm/devtools

    • At this point your METADATA should be up-to-date. Howevere, if you have local changes that you want to disregard you can reset the branch as follows (make sure origin corresponds to the correct remote):
    git fetch origin
    git checkout metadata-v2
    git reset --hard origin/metadata-v2
    
    • Make a new branch based on metadata-v2 where you’ll make the changes:

    git checkout -b newBranch

    • Now in the Julia REPL you can register and tag your package (see step 3 above)
    • Quit Julia. Merge your branch back into metadata-v2
    git checkout metadata-v2
    git merge newBranch
    
    • Start Julia again and publish your package! (step 4)

    At this point you could reset your metadata-v2 branch if you need to.

One Comment Add yours

  1. NR says:

    You should replace Pkg with PkgDev now for registering and tagging Julia packages.

Leave a Reply

Your email address will not be published. Required fields are marked *