Updating a package to support new version of Julia

I am interested in learning best practices and people’s experiences with updating a package to support a new version of Julia. I have written a few packages which all support julia v0.5, and will soon start the work of updating them to support v0.6. What strategy do you find suitable?

  • Work in a new branch that only supports the new version 0.6
  • Making use of Compat.jl to support multiple versions simultaneously
  • Other strategy?

What are the biggest hurdles to a smooth update?

Thanks!

I’d run it and fix all depwarns using Compat.jl and if you hit too many case that can’t be fixed without conditional (include), you can use different branches. I haven’t got any issue fixing breackage on 0.6 so far.

1 Like

I find there always are two distinct stages in taking a package from one version to the next. Packages with users who are required to stay with the erstwhile current version of Julia for a while may need extra attention.

I have written some small and some large packages. When moving from v0.3 to v0.4 and again from v0.4 to v0.5 my initial step is to start the newer version of Julia, Pkg.clone() the work into that version’s local repository, and then see what happens after using <mypackage>. There are going to be many messages, warnings, deprecation notices and there may arise an error that stops the initial information. To date, those messages have shown much commonality; and I select the one, two or three most frequent then fixup those parts of the source files.

At this stage (and for a while longer) I edit the local version in the new release’s repository and leave the current version and the github source alone (lessons learned, now shared).

I do that to get a good sense of how my work, that specific packaged intent, is best better evinced with Julia’s new resources and simplicities. Then I look to Lint.jl and Compat.jl.

1 Like

Thanks for your replies! It seems the strategy I used last time it was updating times is reasonable.

I also find Julia’s deprecation system quite useful when upgrading. One thing I have been thinking about is whether or not some of the language changes might cause bugs that do not neccesarily generate errors, such as v::Vector, v.' * v is a scalar. Errors like these might potentially be hard to find if not explicitly tested for. I have no concrete example, but maybe someone has run into this and/or have a strategy to seek those cases out?

A post was split to a new topic: How to tag a new release for a package?