From 833eebc021af388fd917d74bb68bb6c76c6caa96 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 6 Nov 2024 02:35:07 +0100 Subject: [PATCH 1/4] python312Packages.bidsschematools: init at 0.11.3 --- .../bidsschematools/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/bidsschematools/default.nix diff --git a/pkgs/development/python-modules/bidsschematools/default.nix b/pkgs/development/python-modules/bidsschematools/default.nix new file mode 100644 index 0000000000000..c27bbfd85f3dc --- /dev/null +++ b/pkgs/development/python-modules/bidsschematools/default.nix @@ -0,0 +1,45 @@ +{ + lib, + buildPythonPackage, + pythonOlder, + fetchPypi, + setuptools, + click, + pyyaml, + jsonschema, +}: + +buildPythonPackage rec { + pname = "bidsschematools"; + version = "0.11.3"; + pyproject = true; + + disabled = pythonOlder "3.9"; + + src = fetchPypi { + pname = "bidsschematools"; + inherit version; + hash = "sha256-GvR3pOXXmdpjH2xdL+trhLW6ZdsTpEWUdNUlVQ4gFXo="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + click + pyyaml + jsonschema + ]; + + pythonImportsCheck = [ + "bidsschematools" + ]; + + meta = { + description = "Python tools for working with the BIDS schema"; + homepage = "https://github.com/bids-standard/bids-specification/tree/master/tools/schemacode"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ wegank ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6f9e572d92a34..f0ef277cf7b7a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1601,6 +1601,8 @@ self: super: with self; { bids-validator = callPackage ../development/python-modules/bids-validator { }; + bidsschematools = callPackage ../development/python-modules/bidsschematools { }; + biliass = callPackage ../development/python-modules/biliass { }; bilibili-api-python = callPackage ../development/python-modules/bilibili-api-python { }; From cd2d4944bedfac8de96e70844c25cc3719219fb7 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 6 Nov 2024 02:35:20 +0100 Subject: [PATCH 2/4] python312Packages.bids-validator: fix build --- .../python-modules/bids-validator/default.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/bids-validator/default.nix b/pkgs/development/python-modules/bids-validator/default.nix index 3162ba276cf74..061e85b734cc3 100644 --- a/pkgs/development/python-modules/bids-validator/default.nix +++ b/pkgs/development/python-modules/bids-validator/default.nix @@ -7,6 +7,9 @@ # build-system setuptools, versioneer, + + # dependencies + bidsschematools, }: buildPythonPackage rec { @@ -14,7 +17,7 @@ buildPythonPackage rec { version = "1.14.7.post0"; pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.8"; src = fetchPypi { pname = "bids_validator"; @@ -22,21 +25,22 @@ buildPythonPackage rec { hash = "sha256-5gBaUAt1+KlhWT+2fUYIUQfa2xFvWaXDtSSqBpeUW2Y="; }; - nativeBuildInputs = [ + build-system = [ setuptools versioneer ]; - # needs packages which are not available in nixpkgs - doCheck = false; + dependencies = [ + bidsschematools + ]; pythonImportsCheck = [ "bids_validator" ]; - meta = with lib; { + meta = { description = "Validator for the Brain Imaging Data Structure"; homepage = "https://github.com/bids-standard/bids-validator"; changelog = "https://github.com/bids-standard/bids-validator/releases/tag/v${version}"; - license = licenses.mit; - maintainers = [ ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ wegank ]; }; } From 221b2afe734658cc09f2b9fdec0cc1783990b0f0 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 6 Nov 2024 02:35:30 +0100 Subject: [PATCH 3/4] python312Packages.pybids: fix build --- pkgs/development/python-modules/pybids/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/pybids/default.nix b/pkgs/development/python-modules/pybids/default.nix index 80db75b9551a8..aaf3efd234cd9 100644 --- a/pkgs/development/python-modules/pybids/default.nix +++ b/pkgs/development/python-modules/pybids/default.nix @@ -12,6 +12,7 @@ nibabel, bids-validator, sqlalchemy, + universal-pathlib, pytestCheckHook, versioneer, }: @@ -31,12 +32,12 @@ buildPythonPackage rec { "sqlalchemy" ]; - nativeBuildInputs = [ + build-system = [ setuptools versioneer ] ++ versioneer.optional-dependencies.toml; - propagatedBuildInputs = [ + dependencies = [ bids-validator click formulaic @@ -46,6 +47,7 @@ buildPythonPackage rec { pandas scipy sqlalchemy + universal-pathlib ]; pythonImportsCheck = [ "bids" ]; @@ -64,12 +66,12 @@ buildPythonPackage rec { "test_to_df" ]; - meta = with lib; { + meta = { description = "Python tools for querying and manipulating BIDS datasets"; homepage = "https://github.com/bids-standard/pybids"; changelog = "https://github.com/bids-standard/pybids/blob/${version}/CHANGELOG.rst"; - license = licenses.mit; - maintainers = [ ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ wegank ]; mainProgram = "pybids"; }; } From 65835ab8d2a4339d9a7404b28ab1ea6e536a3531 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Thu, 7 Nov 2024 00:58:03 +0100 Subject: [PATCH 4/4] python312Packages.templateflow: fix build --- .../python-modules/templateflow/default.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/templateflow/default.nix b/pkgs/development/python-modules/templateflow/default.nix index f00ce991ea3e2..32f922065e56c 100644 --- a/pkgs/development/python-modules/templateflow/default.nix +++ b/pkgs/development/python-modules/templateflow/default.nix @@ -4,6 +4,8 @@ fetchFromGitHub, pythonOlder, setuptools-scm, + hatchling, + hatch-vcs, nipreps-versions, pybids, requests, @@ -24,8 +26,13 @@ buildPythonPackage rec { hash = "sha256-COS767n2aC65m6AJihZb4NhJ4ZK9YkTAZR7Hcnc/LMs="; }; - nativeBuildInputs = [ setuptools-scm ]; - propagatedBuildInputs = [ + build-system = [ + setuptools-scm + hatchling + hatch-vcs + ]; + + dependencies = [ nipreps-versions pybids requests @@ -33,7 +40,12 @@ buildPythonPackage rec { ]; doCheck = false; # most tests try to download data - #pythonImportsCheck = [ "templateflow" ]; # touches $HOME/.cache, hence needs https://github.com/NixOS/nixpkgs/pull/120300 + + postFixup = '' + export HOME=$(mktemp -d) + ''; + + pythonImportsCheck = [ "templateflow" ]; meta = with lib; { homepage = "https://templateflow.org/python-client";