mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

Make it such that our installer downloads always point to the correct version and don't need to be updated with each release

Open hoechenberger opened this issue 2 years ago • 5 comments

How I imagine this to work:

  1. we follow a strict naming / tagging scheme on mne-tools/mne-installers
  2. we add a tiny snippet of JavaScript to the HTML file of our docs; the script extracts the version number of the currently-viewed documentation and adjusts the link targets of the download buttons accordingly
  3. profit!

hoechenberger avatar Mar 21 '22 17:03 hoechenberger

what about https://github.com/mne-tools/mne-installers/releases/download/latest/MNE-Python-latest-Linux.sh that is an alias for the most recent version? and you update that link each time you make a release?

drammock avatar Jun 15 '22 15:06 drammock

I think that's what we're already doing, unless I misunderstood your proposal …  And it might just be good enough. I mean, we don't release that often, so…

hoechenberger avatar Jun 15 '22 21:06 hoechenberger

no, I mean literally create a path https://github.com/mne-tools/mne-installers/releases/download/latest/MNE-Python-latest-Linux.sh that doesn't result in a 404

drammock avatar Jun 15 '22 22:06 drammock

https://docs.github.com/en/rest/releases/releases#get-the-latest-release

drammock avatar Jun 15 '22 22:06 drammock

https://api.github.com/repos/mne-tools/mne-installers/releases/latest gets you the JSON

drammock avatar Jun 15 '22 22:06 drammock

If we do this with JavaScript it means that for example we do it for 1.5, and when we release 1.6 the 1.5 doc installers will point to 1.6 (because they'll always point to the latest release). I actually think this is okay because the HTML page will display which installer is being talked about (1.6) and it's the only one we'll support at the release of 1.6 anyway. But it's something to be aware of.

The alternative would be to do some version parsing to figure out which version of the docs you're in, then go through the releases using GitHub APIs to figure out which release to use. It's doable but onerous for little gain. Perhaps what we could do is detect if the current version of the displayed docs (e.g., 1.5 or dev) does not match that of the installers being advertised (1.6) and show a warning. This has the added benefit that people looking at the dev page won't errantly expect to download the installer from there and immediately get a dev version.

larsoner avatar Oct 01 '23 17:10 larsoner

If we do this with JavaScript it means that for example we do it for 1.5, and when we release 1.6 the 1.5 doc installers will point to 1.6 (because they'll always point to the latest release). I actually think this is okay

agree that this is the best approach. Cases where users will want something other than the latest installer are rare (so far to my knowledge it's only ever happened when one of the deps we bundled was buggy).

drammock avatar Oct 03 '23 07:10 drammock