Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper workflow for testing a julia package locally on multiple versions of Base at once

Tags:

julia

It is very common for Julia packages to support multiple version of Julia at once. The standard workflow is make modifications in ~/.julia/v0.x/PackageName and then run Pkg.test("PackageName") on the package, but this only tests the package in whatever Julia 0.x is and not other versions. The other versions can't see the local changes since the modifications were only made in 0.x folder. Currently, I rely on Travis on catching problems, but the turn around time is much slower than running tests locally.

What is the proper method for testing a package on multiple versions of Julia locally? Symbolic links?

like image 896
tlnagy Avatar asked Nov 22 '16 21:11

tlnagy


People also ask

How do I check my packages on Julia?

Julia provides Pkg. status() function to print the list of all the installed packages. This is useful when we want to know whether the package you wish to use is installed or not. At the point when the Pkg order is run interestingly, the package directory is naturally made.

How do you do unit testing in Julia?

Testing Base JuliaIf you build Julia from source, you can run this test suite with make test . In a binary install, you can run the test suite using Base. runtests() . Run the Julia unit tests listed in tests , which can be either a string or an array of strings, using ncores processors.

How do I install multiple packages in 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.


1 Answers

Use symbolic links.

I've been using symbolic links since julia v0.3. It works reasonably well. I'll typically have the package checked out in the lower version directory, (say 0.4), and have symbolic links in the directories for 0.5 and 0.6. I do this for all packages that I'm actively working on. Everything else get duplicated as part of the Pkg.add/clone process.

This only works of course when you have a single branch of your package (typicaly master) that supports all julia versions, via Compat. In cases where you have different branches for different julia versions, you'll need to have separate checkouts for each julia version.

like image 188
aviks Avatar answered Sep 29 '22 09:09

aviks