diff --git a/.circleci/config.yml b/.circleci/config.yml index 301e85acbe3..48a348c8741 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -638,6 +638,9 @@ jobs: # squash history onto the previous squash commit every ~20 deploys, so # the repo stays small without a manual step and the push stays thin python -m docstacks prune --keep 20 --min-squash 20 --push; + # go red if the version switcher and the deployed tree disagree (the + # 0.20 entry is the "≤ X.Y ..." link to the archived versions page) + python -m docstacks validate versions.json --site-dir . --ignore 0.20; - save_cache: key: website-cache-2 paths: diff --git a/.github/workflows/check_changelog.yml b/.github/workflows/check_changelog.yml index 9b2e2cd49b6..ad05667124c 100644 --- a/.github/workflows/check_changelog.yml +++ b/.github/workflows/check_changelog.yml @@ -65,7 +65,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@v7.1.0 - run: sudo apt-get update -q && sudo apt-get install -yq pandoc - - run: python -m pip install pygithub sphinx towncrier -e . + - run: python -m pip install pygithub sphinx towncrier -e . git+https://github.com/mne-tools/mne-tools - name: Draft the announcement for the next minor release env: PR_NUMBER: ${{ github.event.pull_request.number }} # empty on main diff --git a/SECURITY.md b/SECURITY.md index 426f9282b74..0a94c28f578 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,17 +2,12 @@ ## Supported Versions -New minor versions of MNE-Python are typically released twice per year. -Only the most current stable release is officially supported. +New minor versions of MNE-Python are typically released three times per year. +Only the [most current stable release](https://github.com/mne-tools/mne-python/releases/latest) +is officially supported. The unreleased, unstable "dev version" is also supported, though users should beware that the API of the dev version is subject to change -without a proper 6-month deprecation cycle. - -| Version | Supported | -| ------- | ------------------------ | -| 1.14.x | :heavy_check_mark: (dev) | -| 1.13.x | :heavy_check_mark: | -| < 1.13 | :x: | +without a proper one-release deprecation cycle. ## Reporting a Vulnerability diff --git a/doc/_static/js/update_installer_version.js b/doc/_static/js/update_installer_version.js deleted file mode 100644 index ad18890caf7..00000000000 --- a/doc/_static/js/update_installer_version.js +++ /dev/null @@ -1,61 +0,0 @@ -/* inspired by https://tobiasahlin.com/blog/move-from-jquery-to-vanilla-javascript/ */ - -function documentReady(callback) { - if (document.readyState != "loading") callback(); - else document.addEventListener("DOMContentLoaded", callback); -} - -async function getRelease() { - result = await fetch("https://api.github.com/repos/mne-tools/mne-installers/releases/latest"); - data = await result.json(); - return data; -} -async function warnVersion() { - data = await getRelease(); - // Take v1.5.1 for example and change to 1.5 - ids = ["linux-installers", "macos-intel-installers", "macos-apple-installers", "windows-installers"]; - warn = false; - ids.forEach((id) => { - label_id = document.getElementById(id); - // tab is immediately after label - children = [].slice.call(label_id.parentNode.children); - div = children[children.indexOf(label_id) + 1]; - a = div.children[0].children[0]; // div->p->a - ending = a.href.split("-").slice(-1)[0]; // Should be one of: ["macOS_Intel.pkg", "macOS_M1.pkg", "Linux.sh", "Windows.exe"] - data["assets"].every((asset) => { - // find the matching asset - if (!asset["browser_download_url"].endsWith(ending)) { - return true; // continue - } - old_stem = a.href.split("/").slice(-1)[0]; - new_stem = asset["browser_download_url"].split("/").slice(-1)[0]; - a.href = asset["browser_download_url"]; - // also replace the command on Linux - if (ending === "Linux.sh") { - code = document.getElementById("codecell0"); - } - if (!warn) { - // MNE-Python-1.5.1_0-Linux.sh to 1.5 for example - old_ver = old_stem.split("-").slice(2)[0].split("_")[0].split(".").slice(0, 2).join("."); - new_ver = new_stem.split("-").slice(2)[0].split("_")[0].split(".").slice(0, 2).join("."); - if (old_ver !== new_ver) { - warn = `The installers below are for version ${new_ver} as ${old_ver} is no longer supported`; - } - } - return false; // do not continue - }); - }); - if (warn) { - let outer = document.createElement("div"); - let title = document.createElement("p"); - let inner = document.createElement("p"); - outer.setAttribute("class", "admonition warning"); - title.setAttribute("class", "admonition-title"); - title.innerText = "Warning"; - inner.innerText = warn; - outer.append(title, inner); - document.querySelectorAll('.install-selector-tabset')[0].before(outer); - } -} - -documentReady(warnVersion); diff --git a/doc/changes/dev/13989.bugfix.rst b/doc/changes/dev/13989.bugfix.rst deleted file mode 100644 index 02368b6eecb..00000000000 --- a/doc/changes/dev/13989.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix bug where :func:`mne.viz.plot_volume_source_estimates` with ``mode="glass_brain"`` always showed absolute values, by `Lau Møller Andersen`_. diff --git a/doc/changes/dev/14293.bugfix.rst b/doc/changes/dev/14293.bugfix.rst deleted file mode 100644 index a7b07d15d81..00000000000 --- a/doc/changes/dev/14293.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix reading EEGLAB ``.set`` files containing MATLAB objects (e.g., ``string`` or ``datetime``) with SciPy 1.18+ when pymatreader is not installed, by `Eric Larson`_. diff --git a/doc/changes/dev/14296.bugfix.rst b/doc/changes/dev/14296.bugfix.rst deleted file mode 100644 index edb29152baa..00000000000 --- a/doc/changes/dev/14296.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix :meth:`mne.io.Raw.export` to EDF/BDF altering channel values for data originally read from EDF/BDF files, and add a ``digital_range`` parameter to allow preserving the original digital range, by `Daniel McCloy`_. diff --git a/doc/changes/v1.13.rst b/doc/changes/v1.13.rst index f092505024a..5e5e3c82f3a 100644 --- a/doc/changes/v1.13.rst +++ b/doc/changes/v1.13.rst @@ -1,3 +1,15 @@ +.. _changes_1_13_2: + +Version 1.13.2 (2026-09-11) +=========================== + +Bugfixes +-------- + +- Fix bug where :func:`mne.viz.plot_volume_source_estimates` with ``mode="glass_brain"`` always showed absolute values, by `Lau Møller Andersen`_. (`#13989 `__) +- Fix reading EEGLAB ``.set`` files containing MATLAB objects (e.g., ``string`` or ``datetime``) with SciPy 1.18+ when pymatreader is not installed, by `Eric Larson`_. (`#14293 `__) +- Fix :meth:`mne.io.Raw.export` to EDF/BDF altering channel values for data originally read from EDF/BDF files, and add a ``digital_range`` parameter to allow preserving the original digital range, by `Daniel McCloy`_. (`#14296 `__) + .. _changes_1_13_0: Version 1.13.0 (2026-09-09) diff --git a/doc/install/installers.rst b/doc/install/installers.rst index cb689f3e973..4a5761c8bed 100644 --- a/doc/install/installers.rst +++ b/doc/install/installers.rst @@ -17,7 +17,7 @@ Platform-specific installers :class-content: text-center :name: install-linux - .. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.13.2/MNE-Python-1.13.2_0-Linux.sh + .. button-link:: https://github.com/mne-tools/mne-installers/releases/latest/download/MNE-Python-Linux.sh :ref-type: ref :color: primary :shadow: @@ -31,14 +31,14 @@ Platform-specific installers .. code-block:: console - $ sh ./MNE-Python-1.13.2_0-Linux.sh + $ sh ./MNE-Python-Linux.sh .. tab-item:: macOS (Intel) :class-content: text-center :name: install-macos-intel - .. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.13.2/MNE-Python-1.13.2_0-macOS_Intel.pkg + .. button-link:: https://github.com/mne-tools/mne-installers/releases/latest/download/MNE-Python-macOS_Intel.pkg :ref-type: ref :color: primary :shadow: @@ -54,7 +54,7 @@ Platform-specific installers :class-content: text-center :name: install-macos-apple - .. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.13.2/MNE-Python-1.13.2_0-macOS_M1.pkg + .. button-link:: https://github.com/mne-tools/mne-installers/releases/latest/download/MNE-Python-macOS_M1.pkg :ref-type: ref :color: primary :shadow: @@ -70,7 +70,7 @@ Platform-specific installers :class-content: text-center :name: install-windows - .. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.13.2/MNE-Python-1.13.2_0-Windows.exe + .. button-link:: https://github.com/mne-tools/mne-installers/releases/latest/download/MNE-Python-Windows.exe :ref-type: ref :color: primary :shadow: @@ -99,7 +99,6 @@ Platform-specific installers .. raw:: html - First steps @@ -164,7 +163,7 @@ To remove the MNE-Python distribution provided by our installers above: .. code-block:: bash $ which python - /home/username/mne-python/1.13.2_0/bin/python + /home/username/mne-python/X.Y.Z_0/bin/python $ rm -Rf /home/$USER/mne-python $ rm /home/$USER/.local/share/applications/mne-python-*.desktop @@ -178,7 +177,7 @@ To remove the MNE-Python distribution provided by our installers above: .. code-block:: bash $ which python - /Users/username/Applications/MNE-Python/1.13.2_0/.mne-python/bin/python + /Users/username/Applications/MNE-Python/X.Y.Z_0/.mne-python/bin/python $ rm -Rf /Users/$USER/Applications/MNE-Python # if user-specific $ rm -Rf /Applications/MNE-Python # if system-wide diff --git a/tools/dev/finalize_changelog.py b/tools/dev/finalize_changelog.py index d46b84eed56..bb9b545eda7 100644 --- a/tools/dev/finalize_changelog.py +++ b/tools/dev/finalize_changelog.py @@ -6,11 +6,14 @@ python tools/dev/finalize_changelog.py 1.13.0 This writes doc/changes/vX.Y.rst with the authors list appended and points the -what's new toctree at it. Anything it flags is a .mailmap gap: fix it, then +what's new toctree at it. For a patch release (X.Y.Z with Z > 0, run on the +maint/X.Y branch) it instead adds the new section to the top of the existing +doc/changes/vX.Y.rst. Anything it flags is a .mailmap gap: fix it, then ``git checkout doc/changes`` and run again. It also drafts announcement.md, for the forum and the GitHub release, from the entries of the PRs labeled -``release-highlight``, which needs ``pygithub`` and ``pandoc``. See the release -checklist in the wiki for the steps around it. +``release-highlight``, which needs ``pygithub`` and ``pandoc``, and regenerates +codemeta.json and CITATION.cff, which needs ``mne_tools``. See the release +checklists in the wiki for the steps around it. """ # Authors: The MNE-Python contributors. @@ -18,6 +21,7 @@ # Copyright the MNE-Python contributors. import argparse +import importlib.util import json import os import re @@ -75,15 +79,25 @@ def _bullet(text, number): args = parser.parse_args() assert re.fullmatch(r"\d+\.\d+\.\d+", args.version), args.version out_fname = changes_dir / f"v{'.'.join(args.version.split('.')[:2])}.rst" +patch = not args.version.endswith(".0") # on maint/X.Y, adding to vX.Y.rst if shutil.which("pandoc") is None: raise SystemExit( "pandoc must be on the PATH to draft the release announcement (nothing " "has been written yet)" ) +if importlib.util.find_spec("mne_tools") is None: + raise SystemExit( + "mne_tools must be importable to update codemeta.json and CITATION.cff, " + "pip install git+https://github.com/mne-tools/mne-tools (nothing has " + "been written yet)" + ) # Everyone with a commit in the release, first-timers (who have a :newcontrib: -# entry, thanks to the credit action) marked with a trailing + -previous = _git("tag", "--list", "v*", "--sort=-v:refname").splitlines()[0] +# entry, thanks to the credit action) marked with a trailing +. On a maint +# branch, the latest tag overall can be a later minor release, so use the +# latest one in its history +previous = _git("tag", "--merged", "HEAD", "--list", "v*", "--sort=-v:refname") +previous = previous.splitlines()[0] authors = dict( # name -> commit address line.split("\t", maxsplit=1)[1].rstrip(">").split(" <", maxsplit=1) for line in _git( @@ -144,9 +158,11 @@ def _bullet(text, number): in_release = set(_git("rev-list", f"{previous}..HEAD").splitlines()) entries, titles = {}, [] # changelog entry -> PR number, and PRs without one for pr in labeled: - if pr.merge_commit_sha not in in_release and pr.number != args.pr: - continue paths = list((changes_dir / "dev").glob(f"{pr.number}.*.rst")) + # A backport has another commit, but on maint all entries are backports + in_this = paths if patch else pr.merge_commit_sha in in_release + if not in_this and pr.number != args.pr: + continue entries.update(dict.fromkeys(paths, pr.number)) if not paths: print(f"Highlighted PR #{pr.number} has no changelog entry, using title") @@ -203,31 +219,46 @@ def _bullet(text, number): ) (repo_root / "announcement.md").write_text(announcement, "utf-8") +# towncrier prepends the release to dev.rst, which maint/X.Y does not have, so +# a patch release goes on top of vX.Y.rst there (above its anchor and authors) +dev_fname = changes_dir / "dev.rst" +if patch: + _git("mv", str(out_fname), str(dev_fname)) subprocess.run( ["towncrier", "build", "--yes", "--version", args.version], cwd=repo_root, check=True, ) -# towncrier prepends the release to dev.rst, so its scaffolding (everything the -# template has above the names.inc include) is left behind below the entries -dev_fname = changes_dir / "dev.rst" -text = dev_fname.read_text("utf-8") -scaffolding = (changes_dir / "dev.rst.template").read_text("utf-8") -scaffolding = scaffolding.split(".. include::")[0] -assert scaffolding in text, "dev.rst does not look like it came from the template" -lines = [f"- {name}{'+' if name in newcontribs else ''}" for name in sorted(authors)] -head, sep, tail = text.replace(scaffolding, "").rpartition(".. include::") -text = f"{head}Authors\n-------\n\n" + "\n".join(lines) + f"\n\n{sep}{tail}" -dev_fname.write_text(text, "utf-8") +# On main, the template scaffolding (everything above the names.inc include) is +# left behind below the entries +if not patch: + text = dev_fname.read_text("utf-8") + scaffolding = (changes_dir / "dev.rst.template").read_text("utf-8") + scaffolding = scaffolding.split(".. include::")[0] + assert scaffolding in text, "dev.rst does not look like it came from the template" + lines = [ + f"- {name}{'+' if name in newcontribs else ''}" for name in sorted(authors) + ] + head, sep, tail = text.replace(scaffolding, "").rpartition(".. include::") + text = f"{head}Authors\n-------\n\n" + "\n".join(lines) + f"\n\n{sep}{tail}" + dev_fname.write_text(text, "utf-8") _git("mv", str(dev_fname), str(out_fname)) whats_new = repo_root / "doc" / "development" / "whats_new.rst" -text = whats_new.read_text("utf-8") +text = whats_new.read_text("utf-8") # on maint, the toctree has no dev.rst text = text.replace(" ../changes/dev.rst\n", f" ../changes/{out_fname.name}\n") whats_new.write_text(text, "utf-8") +for generator in ("generate_codemeta", "generate_citation"): + subprocess.run( + [sys.executable, "-m", f"mne_tools.{generator}", ".", args.version], + cwd=repo_root, + check=True, + ) print( - f"Wrote {out_fname.relative_to(repo_root)} with {len(authors)} authors " - f"({len(newcontribs)} new) since {previous}, and the draft announcement.md " - f"from {len(entries) + len(titles)} entries ({len(labeled)} labeled PRs found)" + f"Wrote {out_fname.relative_to(repo_root)} ({len(authors)} authors, " + f"{len(newcontribs)} new, since {previous}), codemeta.json, CITATION.cff, " + f"and the draft announcement.md from {len(entries) + len(titles)} entries " + f"({len(labeled)} labeled PRs found). If a new author has a compound " + "surname, add it to .extended_metadata.yaml and run again." )