Unverified Commit 3b9c0d92 authored by Mario Rodas's avatar Mario Rodas Committed by GitHub
Browse files

Merge pull request #284103 from bcdarwin/niworkflows

python311Packages.niworkflows: init at 1.10.0
parents 8c1a6046 7a483d6e
Loading
Loading
Loading
Loading
+46 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, flit-scm
, packaging
, setuptools-scm
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "nipreps-versions";
  version = "1.0.4";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "nipreps";
    repo = "version-schemes";
    rev = "refs/tags/${version}";
    hash = "sha256-B2wtLurzgk59kTooH51a2dewK7aEyA0dAm64Wp+tqhM=";
  };

  env.SETUPTOOLS_SCM_PRETEND_VERSION = version;

  nativeBuildInputs = [
    flit-scm
    setuptools-scm
  ];

  propagatedBuildInputs = [
    packaging
  ];

  nativeCheckInputs = [ pytestCheckHook ];
  pythonImportsCheck = [ "nipreps_versions" ];

  meta = with lib; {
    description = "Setuptools_scm plugin for nipreps version schemes";
    homepage = "https://github.com/nipreps/version-schemes";
    changelog = "https://github.com/nipreps/version-schemes/blob/${src.rev}/CHANGES.md";
    license = licenses.asl20;
    maintainers = with maintainers; [ bcdarwin ];
  };
}
+101 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, hatch-vcs
, hatchling
, pytestCheckHook
, attrs
, importlib-resources
, jinja2
, looseversion
, matplotlib
, nibabel
, nilearn
, nipype
, nitransforms
, numpy
, packaging
, pandas
, pybids
, pyyaml
, scikit-image
, scipy
, seaborn
, svgutils
, templateflow
, traits
, transforms3d
}:

buildPythonPackage rec {
  pname = "niworkflows";
  version = "1.10.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "nipreps";
    repo = "niworkflows";
    rev = "refs/tags/${version}";
    hash = "sha256-wQPk9imDvomg+NTWk+VeW1TE2QlvMyi1YYVVaznhktU=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml --replace '"traits < 6.4"' '"traits"'
  '';

  nativeBuildInputs = [
    hatch-vcs
    hatchling
  ];

  propagatedBuildInputs = [
    attrs
    importlib-resources
    jinja2
    looseversion
    matplotlib
    nibabel
    nilearn
    nipype
    nitransforms
    numpy
    packaging
    pandas
    pybids
    pyyaml
    scikit-image
    scipy
    seaborn
    svgutils
    templateflow
    traits
    transforms3d
  ];

  env.SETUPTOOLS_SCM_PRETEND_VERSION = version;

  nativeCheckInputs = [ pytestCheckHook ];
  preCheck = ''export HOME=$(mktemp -d)'';
  pytestFlagsArray = [ "niworkflows" ];
  # try to download data:
  disabledTests = [
    "test_GenerateCifti"
    "ROIsPlot"
    "ROIsPlot2"
    "test_SimpleShowMaskRPT"
    "test_cifti_surfaces_plot"
    "niworkflows.utils.misc.get_template_specs"
    "niworkflows.interfaces.cifti._prepare_cifti"
  ];
  disabledTestPaths = [ "niworkflows/tests/test_registration.py" ];

  pythonImportsCheck = [ "niworkflows" ];

  meta = with lib; {
    description = "Common workflows for MRI (anatomical, functional, diffusion, etc.)";
    homepage = "https://github.com/nipreps/niworkflows";
    changelog = "https://github.com/nipreps/niworkflows/blob/${src.rev}/CHANGES.rst";
    license = licenses.asl20;
    maintainers = with maintainers; [ bcdarwin ];
  };
}
+40 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, setuptools
, lxml
, matplotlib
, pytestCheckHook
, nose
}:

buildPythonPackage rec {
  pname = "svgutils";
  version = "0.3.4";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "btel";
    repo = "svg_utils";
    rev = "refs/tags/v${version}";
    hash = "sha256-ITvZx+3HMbTyaRmCb7tR0LKqCxGjqDdV9/2taziUD0c=";
  };

  nativeBuildInputs = [ setuptools ];

  propagatedBuildInputs = [
    lxml
    matplotlib
  ];

  nativeCheckInputs = [ pytestCheckHook nose ];

  pythonImportsCheck = [ "svgutils" ];

  meta = with lib; {
    description = "Python tools to create and manipulate SVG files";
    homepage = "https://github.com/btel/svg_utils";
    license = licenses.mit;
    maintainers = with maintainers; [ bcdarwin ];
  };
}
+45 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, pytestCheckHook
, setuptools-scm
, nipreps-versions
, pybids
, requests
, tqdm
}:

buildPythonPackage rec {
  pname = "templateflow";
  version = "23.1.0";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "templateflow";
    repo = "python-client";
    rev = "refs/tags/${version}";
    hash = "sha256-8AdXC1IFGfYZ5cvCAyBz0tD3zia+KBILX0tL9IcO2NA=";
  };

  nativeBuildInputs = [ setuptools-scm ];
  propagatedBuildInputs = [
    nipreps-versions
    pybids
    requests
    tqdm
  ];

  doCheck = false;  # most tests try to download data
  #pythonImportsCheck = [ "templateflow" ];  # touches $HOME/.cache, hence needs https://github.com/NixOS/nixpkgs/pull/120300

  meta = with lib; {
    homepage = "https://templateflow.org/python-client";
    description = "Python API to query TemplateFlow via pyBIDS";
    changelog = "https://github.com/templateflow/python-client/releases/tag/${version}";
    license = licenses.asl20;
    maintainers = with maintainers; [ bcdarwin ];
  };
}
+8 −0
Original line number Diff line number Diff line
@@ -8373,6 +8373,8 @@ self: super: with self; {
  ninja = callPackage ../development/python-modules/ninja { inherit (pkgs) ninja; };
  nipreps-versions = callPackage ../development/python-modules/nipreps-versions { };
  nipy = callPackage ../development/python-modules/nipy { };
  nipype = callPackage ../development/python-modules/nipype {
@@ -8385,6 +8387,8 @@ self: super: with self; {
  nitransforms = callPackage ../development/python-modules/nitransforms { };
  niworkflows = callPackage ../development/python-modules/niworkflows { };
  nix-kernel = callPackage ../development/python-modules/nix-kernel {
    inherit (pkgs) nix;
  };
@@ -14026,6 +14030,8 @@ self: super: with self; {
  svgelements = callPackage ../development/python-modules/svgelements { };
  svgutils = callPackage ../development/python-modules/svgutils { };
  svgwrite = callPackage ../development/python-modules/svgwrite { };
  sv-ttk = callPackage ../development/python-modules/sv-ttk { };
@@ -14165,6 +14171,8 @@ self: super: with self; {
  tempita = callPackage ../development/python-modules/tempita { };
  templateflow = callPackage ../development/python-modules/templateflow { };
  tempora = callPackage ../development/python-modules/tempora { };
  tenacity = callPackage ../development/python-modules/tenacity { };