diff --git a/pkgs/development/python-modules/mne-python/default.nix b/pkgs/development/python-modules/mne/default.nix similarity index 61% rename from pkgs/development/python-modules/mne-python/default.nix rename to pkgs/development/python-modules/mne/default.nix index b36d06a2793f..1cf7dcc1f19b 100644 --- a/pkgs/development/python-modules/mne-python/default.nix +++ b/pkgs/development/python-modules/mne/default.nix @@ -18,11 +18,15 @@ h5io, pymatreader, pythonOlder, + procps, + optipng, }: buildPythonPackage rec { - pname = "mne-python"; - version = "1.9.0"; + pname = "mne"; + # https://github.com/mne-tools/mne-python/pull/13049 is required to build, it does not apply if fetchpatch'ed + stableVersion = "1.9.0"; + version = "1.9.0-unstable-2025-05-01"; pyproject = true; disabled = pythonOlder "3.9"; @@ -30,14 +34,22 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "mne-tools"; repo = "mne-python"; - tag = "v${version}"; - hash = "sha256-Y9xkp1tji0+muP8+HqogRj5TGKCtpJzapKYWtmGw+F0="; + rev = "5df1721b488070e3b3928dface9dd0b8c39a3bef"; + hash = "sha256-BCLejk0sVym+HRCfnTl5LTOGUMrQdxZbqhrCnIpzsvM="; }; + env.SETUPTOOLS_SCM_PRETEND_VERSION = stableVersion; + postPatch = '' substituteInPlace pyproject.toml \ --replace-fail "--cov-report=" "" \ --replace-fail "--cov-branch" "" + + substituteInPlace doc/conf.py \ + --replace-fail '"optipng"' '"${lib.getExe optipng}"' + substituteInPlace mne/utils/config.py \ + --replace-fail '"free"' '"${lib.getExe' procps "free"}"' \ + --replace-fail '"sysctl"' '"${lib.getExe' procps "sysctl"}"' ''; build-system = [ @@ -78,6 +90,15 @@ buildPythonPackage rec { "test_plotting_scalebars" # tries to write a datetime object to hdf5, which fails: "test_hitachi_basic" + # flaky + "test_fine_cal_systems" + "test_simulate_raw_bem" + ]; + + pytestFlagsArray = [ + "-m 'not (slowtest or ultraslowtest or pgtest)'" + # removes 700k lines form pytest log, remove this when scipy is at v1.17.0 + "--disable-warnings" ]; pythonImportsCheck = [ "mne" ]; @@ -86,7 +107,7 @@ buildPythonPackage rec { description = "Magnetoencephelography and electroencephalography in Python"; mainProgram = "mne"; homepage = "https://mne.tools"; - changelog = "https://mne.tools/stable/changes/${src.tag}.html"; + changelog = "https://mne.tools/stable/changes/${stableVersion}.html"; license = licenses.bsd3; maintainers = with maintainers; [ bcdarwin diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index a620853eb405..f42db1303c54 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -415,6 +415,7 @@ mapAliases ({ mitmproxy-wireguard = throw "mitmproxy-wireguard has been removed because it was replaced by upstream with mitmproxy-rs"; # added 2023-11-06 mkdocs-awesome-pages-plugin = mkdocs-awesome-nav; # added 2025-03-10 mkdocs-minify = mkdocs-minify-plugin; # added 2023-11-28 + mne-python = mne; # added 2025-05-02 modestmaps = throw "modestmaps is unmaintained and was never enabled for anything except Python27"; # Added 2025-03-23 mox = throw "mox was removed because it is unmaintained"; # added 2023-02-21 mox3 = throw "mox3 was removed because it is unmaintained"; # added 2024-08-30 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8a72c051a393..7119f764d77a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8966,7 +8966,7 @@ self: super: with self; { mmtf-python = callPackage ../development/python-modules/mmtf-python { }; - mne-python = callPackage ../development/python-modules/mne-python { }; + mne = callPackage ../development/python-modules/mne { }; mnemonic = callPackage ../development/python-modules/mnemonic { };