2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
pydicom,
|
|
|
|
pyfakefs,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
sqlalchemy,
|
2021-03-15 08:37:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pynetdicom";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "2.0.2";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2021-12-30 13:39:12 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-03-15 08:37:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pydicom";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "pynetdicom";
|
|
|
|
rev = "refs/tags/v${version}";
|
2022-05-18 14:49:53 +00:00
|
|
|
hash = "sha256-/JWQUtFBW4uqCbs/nUxj1pRBfTCXV4wcqTkqvzpdFrM=";
|
2021-03-15 08:37:03 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-python-3.11-test-attribute-errors";
|
|
|
|
url = "https://github.com/pydicom/pynetdicom/pull/754/commits/2126bd932d6dfb3f07045eb9400acb7eaa1b3069.patch";
|
|
|
|
hash = "sha256-t6Lg0sTZSWIE5q5pkBvEoHDQ+cklDn8SgNBcFk1myp4=";
|
2024-04-21 15:54:59 +00:00
|
|
|
})
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [ pydicom ];
|
2021-03-15 08:37:03 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-03-15 08:37:03 +00:00
|
|
|
pyfakefs
|
|
|
|
pytestCheckHook
|
|
|
|
sqlalchemy
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Some tests needs network capabilities
|
|
|
|
"test_str_types_empty"
|
2021-04-05 15:23:46 +00:00
|
|
|
"test_associate_reject"
|
2021-12-30 13:39:12 +00:00
|
|
|
"TestAEGoodAssociation"
|
2021-03-15 08:37:03 +00:00
|
|
|
"TestEchoSCP"
|
|
|
|
"TestEchoSCPCLI"
|
2022-04-27 09:35:20 +00:00
|
|
|
"TestEventHandlingAcceptor"
|
2022-05-18 14:49:53 +00:00
|
|
|
"TestEventHandlingRequestor"
|
2021-04-05 15:23:46 +00:00
|
|
|
"TestFindSCP"
|
|
|
|
"TestFindSCPCLI"
|
|
|
|
"TestGetSCP"
|
|
|
|
"TestGetSCPCLI"
|
|
|
|
"TestMoveSCP"
|
|
|
|
"TestMoveSCPCLI"
|
2022-04-27 09:35:20 +00:00
|
|
|
"TestPrimitive_N_GET"
|
2021-04-05 15:23:46 +00:00
|
|
|
"TestQRGetServiceClass"
|
|
|
|
"TestQRMoveServiceClass"
|
2022-04-27 09:35:20 +00:00
|
|
|
"TestSearch"
|
2022-01-13 20:06:32 +00:00
|
|
|
"TestState"
|
|
|
|
"TestStorageServiceClass"
|
2021-03-15 08:37:03 +00:00
|
|
|
"TestStoreSCP"
|
|
|
|
"TestStoreSCPCLI"
|
|
|
|
"TestStoreSCU"
|
|
|
|
"TestStoreSCUCLI"
|
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Ignore apps tests
|
|
|
|
"pynetdicom/apps/tests/"
|
2024-04-21 15:54:59 +00:00
|
|
|
] ++ lib.optionals (pythonAtLeast "3.12") [
|
|
|
|
# https://github.com/pydicom/pynetdicom/issues/924
|
|
|
|
"pynetdicom/tests/test_assoc.py"
|
|
|
|
"pynetdicom/tests/test_transport.py"
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "pynetdicom" ];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
# https://github.com/pydicom/pynetdicom/issues/923
|
|
|
|
"-W"
|
|
|
|
"ignore::pytest.PytestRemovedIn8Warning"
|
2021-12-30 13:39:12 +00:00
|
|
|
];
|
2021-03-15 08:37:03 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python implementation of the DICOM networking protocol";
|
|
|
|
homepage = "https://github.com/pydicom/pynetdicom";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://github.com/pydicom/pynetdicom/releases/tag/v${version}";
|
2021-03-15 08:37:03 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
2021-04-05 15:23:46 +00:00
|
|
|
# Tests are not passing on Darwin/Aarch64, thus it's assumed that it doesn't work
|
|
|
|
broken = stdenv.isDarwin || stdenv.isAarch64;
|
2021-03-15 08:37:03 +00:00
|
|
|
};
|
|
|
|
}
|