1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 setuptools, 6 matplotlib, 7 pydicom, 8 python-dateutil, 9 pytestCheckHook, 10 versionCheckHook, 11}: 12 13let 14 deid-data = buildPythonPackage { 15 pname = "deid-data"; 16 version = "unstable-2022-12-06"; 17 pyproject = true; 18 19 build-system = [ setuptools ]; 20 21 dependencies = [ pydicom ]; 22 23 src = fetchFromGitHub { 24 owner = "pydicom"; 25 repo = "deid-data"; 26 rev = "5750d25a5048fba429b857c16bf48b0139759644"; 27 hash = "sha256-c8NBAN53NyF9dPB7txqYtM0ac0Y+Ch06fMA1LrIUkbc="; 28 }; 29 30 meta = { 31 description = "Supplementary data for deid package"; 32 homepage = "https://github.com/pydicom/deid-data"; 33 license = lib.licenses.mit; 34 maintainers = [ lib.maintainers.bcdarwin ]; 35 }; 36 }; 37in 38buildPythonPackage rec { 39 pname = "deid"; 40 version = "0.4.6"; 41 pyproject = true; 42 43 # Pypi version has no tests 44 src = fetchFromGitHub { 45 owner = "pydicom"; 46 repo = "deid"; 47 # the github repo does not contain Pypi version tags: 48 rev = "f2e125e5a13ae1c3ccfeb55d9431d3a627a4d0db"; 49 hash = "sha256-Vk6MD3MNf1JejqACxjjHkFniK7YDgmdH7k1iQi+enEY="; 50 }; 51 52 build-system = [ setuptools ]; 53 54 dependencies = [ 55 matplotlib 56 pydicom 57 python-dateutil 58 ]; 59 60 nativeCheckInputs = [ 61 deid-data 62 pytestCheckHook 63 versionCheckHook 64 ]; 65 versionCheckProgramArg = "--version"; 66 67 pythonImportsCheck = [ "deid" ]; 68 69 meta = { 70 description = "Best-effort anonymization for medical images"; 71 mainProgram = "deid"; 72 changelog = "https://github.com/pydicom/deid/blob/${src.rev}/CHANGELOG.md"; 73 homepage = "https://pydicom.github.io/deid"; 74 license = lib.licenses.mit; 75 maintainers = with lib.maintainers; [ bcdarwin ]; 76 }; 77}