1{ lib 2, stdenv 3, buildPythonPackage 4, fetchFromGitHub 5, fetchpatch 6, pydicom 7, pyfakefs 8, pytestCheckHook 9, sqlalchemy 10, pythonOlder 11}: 12 13buildPythonPackage rec { 14 pname = "pynetdicom"; 15 version = "2.0.2"; 16 format = "setuptools"; 17 18 disabled = pythonOlder "3.7"; 19 20 src = fetchFromGitHub { 21 owner = "pydicom"; 22 repo = pname; 23 rev = "v${version}"; 24 hash = "sha256-/JWQUtFBW4uqCbs/nUxj1pRBfTCXV4wcqTkqvzpdFrM="; 25 }; 26 27 patches = [ 28 (fetchpatch { 29 name = "fix-python-3.11-test-attribute-errors"; 30 url = "https://github.com/pydicom/pynetdicom/pull/754/commits/2126bd932d6dfb3f07045eb9400acb7eaa1b3069.patch"; 31 hash = "sha256-t6Lg0sTZSWIE5q5pkBvEoHDQ+cklDn8SgNBcFk1myp4="; 32 }) 33 ]; 34 35 propagatedBuildInputs = [ 36 pydicom 37 ]; 38 39 nativeCheckInputs = [ 40 pyfakefs 41 pytestCheckHook 42 sqlalchemy 43 ]; 44 45 disabledTests = [ 46 # Some tests needs network capabilities 47 "test_str_types_empty" 48 "test_associate_reject" 49 "TestAEGoodAssociation" 50 "TestEchoSCP" 51 "TestEchoSCPCLI" 52 "TestEventHandlingAcceptor" 53 "TestEventHandlingRequestor" 54 "TestFindSCP" 55 "TestFindSCPCLI" 56 "TestGetSCP" 57 "TestGetSCPCLI" 58 "TestMoveSCP" 59 "TestMoveSCPCLI" 60 "TestPrimitive_N_GET" 61 "TestQRGetServiceClass" 62 "TestQRMoveServiceClass" 63 "TestSearch" 64 "TestState" 65 "TestStorageServiceClass" 66 "TestStoreSCP" 67 "TestStoreSCPCLI" 68 "TestStoreSCU" 69 "TestStoreSCUCLI" 70 ]; 71 72 disabledTestPaths = [ 73 # Ignore apps tests 74 "pynetdicom/apps/tests/" 75 ]; 76 77 pythonImportsCheck = [ 78 "pynetdicom" 79 ]; 80 81 meta = with lib; { 82 description = "Python implementation of the DICOM networking protocol"; 83 homepage = "https://github.com/pydicom/pynetdicom"; 84 license = with licenses; [ mit ]; 85 maintainers = with maintainers; [ fab ]; 86 # Tests are not passing on Darwin/Aarch64, thus it's assumed that it doesn't work 87 broken = stdenv.isDarwin || stdenv.isAarch64; 88 }; 89}