Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Julia, is there a good way to maintain multiple versions of a package targeted at different releases?

Tags:

julia

Right now, there are two relevant versions of Julia: the latest stable 0.3 release, and the 0.4 release under development (which has nightly builds).

Is there currently a good way to have Julia 0.3 and 0.4 versions of the same package, to handle syntax & other changes that occur between Julia versions?

For example, is one of these options possible for packages on METADATA?

  • Having Julia 0.3 install one branch and Julia 0.4 install another
  • Code flags for Julia 0.3 or 0.4 in the relevant sections
like image 938
Ben Hamner Avatar asked Nov 27 '14 02:11

Ben Hamner


People also ask

How do I add multiple packages to Julia?

You can use Pkg to install multiple packages (https://github.com/JuliaLang/julia/issues/19591). For instance: Pkg. add(["Combinatorics", "TaylorSeries"]) . If your list sits in a text file, you can just load it and pass it to Pkg.

Where are Julia packages stored?

By default, packages will be installed to ~/. julia/packages .


1 Answers

There is nothing to stop you maintaining your package for both Julia versions other than your patience.

For example, you could have master of your packages GitHub repository be the Julia 0.4 compatible version, and maintain a separate julia03 branch for Julia 0.3.

In METADATA, you'd maintain two "series" of releases, e.g. the 0.1.x series would all point to commits on the julia03 branch, and the 0.2.x series would all point to commits on master. All these releases would have appropriate lines in their REQUIRE/requires (julia 0.3 0.4- in one and julia 0.4 in the other).

One other way to think of it is to create a branch in your package everytime you tag a major release. For example, JuMP has a release06 branch where we can backport small fixes to the 0.6 series of releases, while working on new features on master.

Finally, Compat.jl has many helpful tools to make code work on Julia 0.3 and Julia 0.4.

like image 98
IainDunning Avatar answered Oct 18 '22 02:10

IainDunning