1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 pythonOlder,
7 pytestCheckHook,
8 pythonRelaxDepsHook,
9 poetry-core,
10 jsonschema,
11 numpy,
12 pydicom,
13 simpleitk,
14}:
15
16buildPythonPackage rec {
17 pname = "pydicom-seg";
18 version = "0.4.1";
19 format = "pyproject";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "razorx89";
25 repo = pname;
26 rev = "refs/tags/v${version}";
27 hash = "sha256-2Y3fZHKfZqdp5EU8HfVsmJ5JFfVGZuAR7+Kj7qaTiPM=";
28 fetchSubmodules = true;
29 };
30
31 patches = [
32 # https://github.com/razorx89/pydicom-seg/pull/54
33 (fetchpatch {
34 name = "replace-poetry-with-poetry-core.patch";
35 url = "https://github.com/razorx89/pydicom-seg/commit/ac91eaefe3b0aecfe745869972c08de5350d2b61.patch";
36 hash = "sha256-xBOVjWZPjyQ8gSj6JLe9B531e11TI3FUFFtL+IelZOM=";
37 })
38 ];
39
40 pythonRelaxDeps = [ "jsonschema" ];
41
42 nativeBuildInputs = [
43 poetry-core
44 pythonRelaxDepsHook
45 ];
46
47 propagatedBuildInputs = [
48 jsonschema
49 numpy
50 pydicom
51 simpleitk
52 ];
53
54 nativeCheckInputs = [ pytestCheckHook ];
55
56 pythonImportsCheck = [ "pydicom_seg" ];
57
58 meta = with lib; {
59 description = "Medical segmentation file reading and writing";
60 homepage = "https://github.com/razorx89/pydicom-seg";
61 changelog = "https://github.com/razorx89/pydicom-seg/releases/tag/v${version}";
62 license = licenses.mit;
63 maintainers = with maintainers; [ bcdarwin ];
64 };
65}