From 24e043c62b7b8c56516b83baba7d9ac3d74b5715 Mon Sep 17 00:00:00 2001 From: Maksym Balatsko Date: Sun, 1 Oct 2023 06:07:19 -0700 Subject: [PATCH 1/5] python3Packages.h5io: init at 0.2.1 --- .../python-modules/h5io/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/h5io/default.nix diff --git a/pkgs/development/python-modules/h5io/default.nix b/pkgs/development/python-modules/h5io/default.nix new file mode 100644 index 000000000000..e9f8af129f1c --- /dev/null +++ b/pkgs/development/python-modules/h5io/default.nix @@ -0,0 +1,52 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, setuptools +, numpy +, h5py +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "h5io"; + version = "0.2.1"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "h5io"; + repo = "h5io"; + rev = "refs/tags/h5io-${version}"; + hash = "sha256-3mrHIkfaXq06mMzUwudRO81DWTk0TO/e15IQA5fxxNc="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "--cov-report=" "" \ + --replace "--cov-branch" "" \ + --replace "--cov=h5io" "" + ''; + + nativeBuildInputs = [ setuptools ]; + + propagatedBuildInputs = [ + numpy + h5py + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "h5io" ]; + + meta = with lib; { + description = "Read and write simple Python objects using HDF5"; + homepage = "https://github.com/h5io/h5io"; + changelog = "https://github.com/h5io/h5io/releases/tag/${src.rev}"; + license = licenses.bsd3; + maintainers = with maintainers; [ mbalatsko ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8910c18f7895..61ea9f0f1a70 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5037,6 +5037,8 @@ self: super: with self; { inherit (pkgs) h3; }; + h5io = callPackage ../development/python-modules/h5io { }; + h5netcdf = callPackage ../development/python-modules/h5netcdf { }; h5py = callPackage ../development/python-modules/h5py { }; From 2a6418ee03f9533f9492d9cd48053703e6e14f32 Mon Sep 17 00:00:00 2001 From: Maksym Balatsko Date: Sun, 1 Oct 2023 06:41:29 -0700 Subject: [PATCH 2/5] python3Packages.pytest-harvest: init at 1.10.4 --- .../python-modules/pytest-harvest/default.nix | 68 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 70 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-harvest/default.nix diff --git a/pkgs/development/python-modules/pytest-harvest/default.nix b/pkgs/development/python-modules/pytest-harvest/default.nix new file mode 100644 index 000000000000..32c195171934 --- /dev/null +++ b/pkgs/development/python-modules/pytest-harvest/default.nix @@ -0,0 +1,68 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools-scm +, pytest-runner +, pytest +, decopatch +, makefun +, six +, pytestCheckHook +, numpy +, pandas +, tabulate +, pytest-cases +, pythonOlder +}: + +buildPythonPackage rec { + pname = "pytest-harvest"; + version = "1.10.4"; + pyproject = true; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "smarie"; + repo = "python-pytest-harvest"; + rev = "refs/tags/${version}"; + hash = "sha256-ebzE63d7zt9G9HgbLHaE/USZZpUd3y3vd0kNdT/wWw0="; + }; + + # create file, that is created by setuptools_scm + # we disable this file creation as it touches internet + postPatch = '' + echo "version = '${version}'" > pytest_harvest/_version.py + ''; + + nativeBuildInputs = [ + setuptools-scm + pytest-runner + ]; + + buildInputs = [ pytest ]; + + propagatedBuildInputs = [ + decopatch + makefun + six + ]; + + nativeCheckInputs = [ + pytestCheckHook + numpy + pandas + tabulate + pytest-cases + ]; + + pythonImportsCheck = [ "pytest_harvest" ]; + + meta = with lib; { + description = "Store data created during your `pytest` tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes"; + homepage = "https://github.com/smarie/python-pytest-harvest"; + changelog = "https://github.com/smarie/python-pytest-harvest/releases/tag/${src.rev}"; + license = licenses.bsd3; + maintainers = with maintainers; [ mbalatsko ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 61ea9f0f1a70..ae9513dc021b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11528,6 +11528,8 @@ self: super: with self; { pytest-grpc = callPackage ../development/python-modules/pytest-grpc { }; + pytest-harvest = callPackage ../development/python-modules/pytest-harvest { }; + pytest-helpers-namespace = callPackage ../development/python-modules/pytest-helpers-namespace { }; pytest-html = callPackage ../development/python-modules/pytest-html { }; From ccad08f75e0d7d94131e22cd1e63a706ac02915b Mon Sep 17 00:00:00 2001 From: Maksym Balatsko Date: Sun, 1 Oct 2023 07:04:27 -0700 Subject: [PATCH 3/5] python3Packages.pymatreader: init at 0.0.31 --- .../python-modules/pymatreader/default.nix | 46 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/python-modules/pymatreader/default.nix diff --git a/pkgs/development/python-modules/pymatreader/default.nix b/pkgs/development/python-modules/pymatreader/default.nix new file mode 100644 index 000000000000..484797381fa9 --- /dev/null +++ b/pkgs/development/python-modules/pymatreader/default.nix @@ -0,0 +1,46 @@ +{ lib +, buildPythonPackage +, fetchFromGitLab +, setuptools +, h5py +, numpy +, scipy +, xmltodict +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pymatreader"; + version = "0.0.31"; + pyproject = true; + + src = fetchFromGitLab { + owner = "obob"; + repo = "pymatreader"; + rev = "refs/tags/v${version}"; + hash = "sha256-pYObmvqA49sHjpZcwXkN828R/N5CSpmr0OyyxzDiodQ="; + }; + + nativeBuildInputs = [ setuptools ]; + + propagatedBuildInputs = [ + h5py + numpy + scipy + xmltodict + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "pymatreader" ]; + + meta = with lib; { + description = "A python package to read all kinds and all versions of Matlab mat files"; + homepage = "https://gitlab.com/obob/pymatreader/"; + changelog = "https://gitlab.com/obob/pymatreader/-/blob/${src.rev}/CHANGELOG.md"; + license = licenses.bsd2; + maintainers = with maintainers; [ mbalatsko ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ae9513dc021b..14d125169578 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10758,6 +10758,8 @@ self: super: with self; { pymatgen = callPackage ../development/python-modules/pymatgen { }; + pymatreader = callPackage ../development/python-modules/pymatreader { }; + pymatting = callPackage ../development/python-modules/pymatting { }; pymaven-patch = callPackage ../development/python-modules/pymaven-patch { }; From a6efe42fe09100bbffd3a00ad1b61d464e4a7e25 Mon Sep 17 00:00:00 2001 From: Maksym Balatsko Date: Sun, 1 Oct 2023 07:56:27 -0700 Subject: [PATCH 4/5] python3Packages.mne-python: 1.6.0 -> 1.6.1 --- .../python-modules/mne-python/default.nix | 73 ++++++++++++------- 1 file changed, 46 insertions(+), 27 deletions(-) diff --git a/pkgs/development/python-modules/mne-python/default.nix b/pkgs/development/python-modules/mne-python/default.nix index 8a85f487d2d2..c1e1a9561e24 100644 --- a/pkgs/development/python-modules/mne-python/default.nix +++ b/pkgs/development/python-modules/mne-python/default.nix @@ -1,66 +1,84 @@ { lib , buildPythonPackage , fetchFromGitHub +, setuptools +, setuptools-scm , numpy , scipy , pytestCheckHook , pytest-timeout -, h5py +, pytest-harvest , matplotlib -, nibabel -, pandas -, scikit-learn , decorator , jinja2 , pooch , tqdm -, setuptools +, packaging +, importlib-resources +, lazy-loader +, h5io +, pymatreader , pythonOlder }: buildPythonPackage rec { pname = "mne-python"; - version = "1.6.0"; - format = "setuptools"; + version = "1.6.1"; + pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "mne-tools"; - repo = pname; + repo = "mne-python"; rev = "refs/tags/v${version}"; - hash = "sha256-OoaXNHGL2svOpNL5GHcVRfQc9GxIRpZRhpZ5Hi1JTzM="; + hash = "sha256-U1aMqcUZ3BcwqwOYh/qfG5PhacwBVioAgNc52uaoJL0"; }; - propagatedBuildInputs = [ - decorator - jinja2 - matplotlib - numpy - pooch - scipy + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "--cov-report=" "" \ + --replace "--cov-branch" "" + ''; + + nativeBuildInputs = [ setuptools - tqdm + setuptools-scm ]; + propagatedBuildInputs = [ + numpy + scipy + matplotlib + tqdm + pooch + decorator + packaging + jinja2 + lazy-loader + ] ++ lib.optionals (pythonOlder "3.9") [ + importlib-resources + ]; + + passthru.optional-dependencies = { + hdf5 = [ + h5io + pymatreader + ]; + }; + nativeCheckInputs = [ - h5py - nibabel - pandas pytestCheckHook - scikit-learn pytest-timeout - ]; + pytest-harvest + ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); preCheck = '' - export HOME=$TMP + export HOME=$(mktemp -d) export MNE_SKIP_TESTING_DATASET_TESTS=true export MNE_SKIP_NETWORK_TESTS=1 ''; - # All tests pass, but Pytest hangs afterwards - probably some thread hasn't terminated - doCheck = false; - pythonImportsCheck = [ "mne" ]; @@ -68,6 +86,7 @@ buildPythonPackage rec { meta = with lib; { description = "Magnetoencephelography and electroencephalography in Python"; homepage = "https://mne.tools"; + changelog = "https://mne.tools/stable/changes/v${version}.html"; license = licenses.bsd3; maintainers = with maintainers; [ bcdarwin ]; }; From 9f56eed7b7f778ad930b3549483b663402665013 Mon Sep 17 00:00:00 2001 From: Maksym Balatsko Date: Sun, 1 Oct 2023 07:57:16 -0700 Subject: [PATCH 5/5] python3Packages.mne-python: add myself (mbalatsko) as maintainer --- pkgs/development/python-modules/mne-python/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/mne-python/default.nix b/pkgs/development/python-modules/mne-python/default.nix index c1e1a9561e24..4e93aaf3311c 100644 --- a/pkgs/development/python-modules/mne-python/default.nix +++ b/pkgs/development/python-modules/mne-python/default.nix @@ -88,6 +88,6 @@ buildPythonPackage rec { homepage = "https://mne.tools"; changelog = "https://mne.tools/stable/changes/v${version}.html"; license = licenses.bsd3; - maintainers = with maintainers; [ bcdarwin ]; + maintainers = with maintainers; [ bcdarwin mbalatsko ]; }; }