Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at gcc-offload 75 lines 1.5 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 fetchpatch, 6 pythonOlder, 7 ninja, 8 numpy, 9 packaging, 10 pybind11, 11 torch, 12 which, 13}: 14 15buildPythonPackage rec { 16 pname = "monai"; 17 version = "1.4.0"; 18 pyproject = true; 19 20 disabled = pythonOlder "3.9"; 21 22 src = fetchFromGitHub { 23 owner = "Project-MONAI"; 24 repo = "MONAI"; 25 rev = "refs/tags/${version}"; 26 hash = "sha256-PovYyRLgoYwxqGeCBpWxX/kdClYtYK1bgy8yRa9eue8="; 27 # note: upstream consistently seems to modify the tag shortly after release, 28 # so best to wait a few days before updating 29 }; 30 31 preBuild = '' 32 export MAX_JOBS=$NIX_BUILD_CORES; 33 ''; 34 35 build-system = [ 36 ninja 37 which 38 ]; 39 40 buildInputs = [ pybind11 ]; 41 42 dependencies = [ 43 numpy 44 packaging 45 torch 46 ]; 47 48 env.BUILD_MONAI = 1; 49 50 doCheck = false; # takes too long; tries to download data 51 52 pythonImportsCheck = [ 53 "monai" 54 "monai.apps" 55 "monai.data" 56 "monai.engines" 57 "monai.handlers" 58 "monai.inferers" 59 "monai.losses" 60 "monai.metrics" 61 "monai.optimizers" 62 "monai.networks" 63 "monai.transforms" 64 "monai.utils" 65 "monai.visualize" 66 ]; 67 68 meta = with lib; { 69 description = "Pytorch framework (based on Ignite) for deep learning in medical imaging"; 70 homepage = "https://github.com/Project-MONAI/MONAI"; 71 changelog = "https://github.com/Project-MONAI/MONAI/releases/tag/${version}"; 72 license = licenses.asl20; 73 maintainers = [ maintainers.bcdarwin ]; 74 }; 75}