depot/third_party/nixpkgs/pkgs/development/python-modules/monai/default.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

65 lines
1.4 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, ninja
, ignite
, numpy
, pybind11
, torch
, which
}:
buildPythonPackage rec {
pname = "monai";
version = "1.2.0";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "Project-MONAI";
repo = "MONAI";
rev = "refs/tags/${version}";
hash = "sha256-nMxROOBkLPmw1GRKiZq6WGJq93LOpSg/7zIVOg+WzC8=";
};
# Ninja is not detected by setuptools for some reason even though it's present:
postPatch = ''
substituteInPlace "setup.cfg" --replace " ninja" ""
'';
preBuild = ''
export MAX_JOBS=$NIX_BUILD_CORES;
'';
nativeBuildInputs = [ ninja which ];
buildInputs = [ pybind11 ];
propagatedBuildInputs = [ numpy torch ignite ];
BUILD_MONAI = 1;
doCheck = false; # takes too long; tries to download data
pythonImportsCheck = [
"monai"
"monai.apps"
"monai.data"
"monai.engines"
"monai.handlers"
"monai.inferers"
"monai.losses"
"monai.metrics"
"monai.optimizers"
"monai.networks"
"monai.transforms"
"monai.utils"
"monai.visualize"
];
meta = with lib; {
description = "Pytorch framework (based on Ignite) for deep learning in medical imaging";
homepage = "https://github.com/Project-MONAI/MONAI";
changelog = "https://github.com/Project-MONAI/MONAI/releases/tag/${version}";
license = licenses.asl20;
maintainers = [ maintainers.bcdarwin ];
};
}