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 ]; }; } 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/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"; }; } 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"; 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 { };