I have a package which reproduces equations from a professional standard that is revised every two years. I need to be able to access specific editions of the package which are linked to specific editions of the standard document e.g. 2025 Edition. What is the best way to smoothly achieve that?
I used to make a new package with the year in the package name, but that was a lot of work, and realistically, the content of the standard doesn’t change much, if at all, between editions. I’m currently considering two new options (but am open to others).
Keep persistent git branches e.g. 2025.
Hijack the release version number to use year as the “major” digit e.g. 2025.0.0.
Which method do you think would cause the least friction for my internal users?
(I intend to register this package with LocalRegistry.jl using a local file server for others in my company, but I am still setting that up.)
I think the best approach is to create a single package where each version is a module (aka Version.jl). You move all the commonalities into a single top module, then have dedicated sub modules for the version specific details. That also makes it really clear to users what changes from one to the next version. It also avoids clashing definitions and gives you a clear namespace for each specific version.
That has nothing to do with major versions. You can only load one version of a given package in the same process, no matter in what way the version numbers differ.
I don’t think I like this idea because it forces me to change all my downstream function calls in the packages using this package e.g. from Div3.2023.KM6.f(x) to Div3.2025.KM6.f(x). I would rather load a specific version of Div3.jl into an environment and have the function definitions update in place when called by a downstream package there e.g. as Div3.KM6.f(x). I have tried to reproduce the source text as closely as possible, giving the equations the same names in the same order, so I am reluctant to scramble them into different common or edition-specific modules.