From b136e211d17b5315283d0f1d63540195bb8ef2d7 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 4 Apr 2024 15:11:58 +0200 Subject: [PATCH 1/4] python311Packages.pynetdicom: ignore PytestRemovedIn8Warning --- .../python-modules/pynetdicom/default.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pynetdicom/default.nix b/pkgs/development/python-modules/pynetdicom/default.nix index 4a78f020f3b7..ff5a13a011d8 100644 --- a/pkgs/development/python-modules/pynetdicom/default.nix +++ b/pkgs/development/python-modules/pynetdicom/default.nix @@ -8,19 +8,20 @@ , pytestCheckHook , sqlalchemy , pythonOlder +, setuptools }: buildPythonPackage rec { pname = "pynetdicom"; version = "2.0.2"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "pydicom"; - repo = pname; - rev = "v${version}"; + repo = "pynetdicom"; + rev = "refs/tags/v${version}"; hash = "sha256-/JWQUtFBW4uqCbs/nUxj1pRBfTCXV4wcqTkqvzpdFrM="; }; @@ -32,6 +33,10 @@ buildPythonPackage rec { }) ]; + nativeBuildInputs = [ + setuptools + ]; + propagatedBuildInputs = [ pydicom ]; @@ -78,9 +83,15 @@ buildPythonPackage rec { "pynetdicom" ]; + pytestFlagsArray = [ + "-W" + "ignore::pytest.PytestRemovedIn8Warning" + ]; + meta = with lib; { description = "Python implementation of the DICOM networking protocol"; homepage = "https://github.com/pydicom/pynetdicom"; + changelog = "https://github.com/pydicom/pynetdicom/releases/tag/v${version}"; license = with licenses; [ mit ]; maintainers = with maintainers; [ fab ]; # Tests are not passing on Darwin/Aarch64, thus it's assumed that it doesn't work From c9520a8fe3797342a524ce3613dc2ede002f299b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 4 Apr 2024 15:12:51 +0200 Subject: [PATCH 2/4] python311Packages.pynetdicom: refactor --- pkgs/development/python-modules/pynetdicom/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pynetdicom/default.nix b/pkgs/development/python-modules/pynetdicom/default.nix index ff5a13a011d8..82d2951926f9 100644 --- a/pkgs/development/python-modules/pynetdicom/default.nix +++ b/pkgs/development/python-modules/pynetdicom/default.nix @@ -6,9 +6,9 @@ , pydicom , pyfakefs , pytestCheckHook -, sqlalchemy , pythonOlder , setuptools +, sqlalchemy }: buildPythonPackage rec { @@ -33,11 +33,11 @@ buildPythonPackage rec { }) ]; - nativeBuildInputs = [ + build-system = [ setuptools ]; - propagatedBuildInputs = [ + dependencies = [ pydicom ]; From 8ee2d481ea1886863d84afe480d5a2c90f7ade42 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 4 Apr 2024 15:13:10 +0200 Subject: [PATCH 3/4] python311Packages.pynetdicom: format with nixfmt --- .../python-modules/pynetdicom/default.nix | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/pynetdicom/default.nix b/pkgs/development/python-modules/pynetdicom/default.nix index 82d2951926f9..fb36063f4733 100644 --- a/pkgs/development/python-modules/pynetdicom/default.nix +++ b/pkgs/development/python-modules/pynetdicom/default.nix @@ -1,14 +1,15 @@ -{ lib -, stdenv -, buildPythonPackage -, fetchFromGitHub -, fetchpatch -, pydicom -, pyfakefs -, pytestCheckHook -, pythonOlder -, setuptools -, sqlalchemy +{ + lib, + stdenv, + buildPythonPackage, + fetchFromGitHub, + fetchpatch, + pydicom, + pyfakefs, + pytestCheckHook, + pythonOlder, + setuptools, + sqlalchemy, }: buildPythonPackage rec { @@ -30,16 +31,12 @@ buildPythonPackage rec { name = "fix-python-3.11-test-attribute-errors"; url = "https://github.com/pydicom/pynetdicom/pull/754/commits/2126bd932d6dfb3f07045eb9400acb7eaa1b3069.patch"; hash = "sha256-t6Lg0sTZSWIE5q5pkBvEoHDQ+cklDn8SgNBcFk1myp4="; - }) + }) ]; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; - dependencies = [ - pydicom - ]; + dependencies = [ pydicom ]; nativeCheckInputs = [ pyfakefs @@ -79,9 +76,7 @@ buildPythonPackage rec { "pynetdicom/apps/tests/" ]; - pythonImportsCheck = [ - "pynetdicom" - ]; + pythonImportsCheck = [ "pynetdicom" ]; pytestFlagsArray = [ "-W" From 286a5bf70fd27714864cf83f44755d63533ba421 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 4 Apr 2024 15:57:05 +0200 Subject: [PATCH 4/4] python312Packages.pynetdicom: disable failing tests on Python 3.12 --- pkgs/development/python-modules/pynetdicom/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/python-modules/pynetdicom/default.nix b/pkgs/development/python-modules/pynetdicom/default.nix index fb36063f4733..6f0407aacdff 100644 --- a/pkgs/development/python-modules/pynetdicom/default.nix +++ b/pkgs/development/python-modules/pynetdicom/default.nix @@ -7,6 +7,7 @@ pydicom, pyfakefs, pytestCheckHook, + pythonAtLeast, pythonOlder, setuptools, sqlalchemy, @@ -74,11 +75,16 @@ buildPythonPackage rec { disabledTestPaths = [ # Ignore apps tests "pynetdicom/apps/tests/" + ] ++ lib.optionals (pythonAtLeast "3.12") [ + # https://github.com/pydicom/pynetdicom/issues/924 + "pynetdicom/tests/test_assoc.py" + "pynetdicom/tests/test_transport.py" ]; pythonImportsCheck = [ "pynetdicom" ]; pytestFlagsArray = [ + # https://github.com/pydicom/pynetdicom/issues/923 "-W" "ignore::pytest.PytestRemovedIn8Warning" ];