Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 24.05-beta 71 lines 1.4 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 pythonOlder, 6 pythonAtLeast, 7 ninja, 8 ignite, 9 numpy, 10 pybind11, 11 torch, 12 which, 13}: 14 15buildPythonPackage rec { 16 pname = "monai"; 17 version = "1.3.1"; 18 pyproject = true; 19 # upper bound due to use of `distutils`; remove after next release: 20 disabled = pythonOlder "3.8" || pythonAtLeast "3.12"; 21 22 src = fetchFromGitHub { 23 owner = "Project-MONAI"; 24 repo = "MONAI"; 25 rev = "refs/tags/${version}"; 26 hash = "sha256-YjEJbDM9+PiC3Kse8NA/b/yJBsReaK6yIyEB9uktiEc="; 27 }; 28 29 preBuild = '' 30 export MAX_JOBS=$NIX_BUILD_CORES; 31 ''; 32 33 nativeBuildInputs = [ 34 ninja 35 which 36 ]; 37 buildInputs = [ pybind11 ]; 38 propagatedBuildInputs = [ 39 numpy 40 torch 41 ignite 42 ]; 43 44 BUILD_MONAI = 1; 45 46 doCheck = false; # takes too long; tries to download data 47 48 pythonImportsCheck = [ 49 "monai" 50 "monai.apps" 51 "monai.data" 52 "monai.engines" 53 "monai.handlers" 54 "monai.inferers" 55 "monai.losses" 56 "monai.metrics" 57 "monai.optimizers" 58 "monai.networks" 59 "monai.transforms" 60 "monai.utils" 61 "monai.visualize" 62 ]; 63 64 meta = with lib; { 65 description = "Pytorch framework (based on Ignite) for deep learning in medical imaging"; 66 homepage = "https://github.com/Project-MONAI/MONAI"; 67 changelog = "https://github.com/Project-MONAI/MONAI/releases/tag/${version}"; 68 license = licenses.asl20; 69 maintainers = [ maintainers.bcdarwin ]; 70 }; 71}