From fb0f3213f3ffa887a31055340d4a65a6d666ed8c Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Fri, 12 Jul 2024 08:35:33 -0700 Subject: [PATCH 1/3] python3Packages.expiringdict: remove nose Addresses NixOS/nixpkgs#326513 by applying mailgun/expiringdict#49 --- .../python-modules/expiringdict/default.nix | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/expiringdict/default.nix b/pkgs/development/python-modules/expiringdict/default.nix index 772b3d6363357..6478de1aff92d 100644 --- a/pkgs/development/python-modules/expiringdict/default.nix +++ b/pkgs/development/python-modules/expiringdict/default.nix @@ -2,11 +2,10 @@ lib, buildPythonPackage, fetchFromGitHub, + fetchpatch2, dill, - coverage, - coveralls, mock, - nose, + pytestCheckHook, }: buildPythonPackage rec { @@ -23,20 +22,20 @@ buildPythonPackage rec { hash = "sha256-vRhJSHIqc51I+s/wndtfANM44CKW3QS1iajqyoSBf0I="; }; + patches = [ + # apply mailgun/expiringdict#49 to address NixOS/nixpkgs#326513 + (fetchpatch2 { + url = "https://github.com/mailgun/expiringdict/commit/1c0f82232d20f8b3b31c9269a4d0e9510c1721a6.patch"; + hash = "sha256-IeeJVb2tOwRhEPNGqM30fNZyz3jFcnZNWC3I6K1+hSY="; + }) + ]; + nativeCheckInputs = [ dill - coverage - coveralls mock - nose + pytestCheckHook ]; - checkPhase = '' - runHook preCheck - nosetests -v --with-coverage --cover-package=expiringdict - runHook postCheck - ''; - pythonImportsCheck = [ "expiringdict" ]; meta = with lib; { From 34d1affd6e1bbc74715e5b064268d3b336cbed9e Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Fri, 12 Jul 2024 14:42:25 -0700 Subject: [PATCH 2/3] python3Packages.expiringdict: patch for Python 3.12 Applies mailgun/expiringdict#56 for compatibility with Python 3.12 --- pkgs/development/python-modules/expiringdict/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/python-modules/expiringdict/default.nix b/pkgs/development/python-modules/expiringdict/default.nix index 6478de1aff92d..4fc3366a7a42a 100644 --- a/pkgs/development/python-modules/expiringdict/default.nix +++ b/pkgs/development/python-modules/expiringdict/default.nix @@ -28,6 +28,12 @@ buildPythonPackage rec { url = "https://github.com/mailgun/expiringdict/commit/1c0f82232d20f8b3b31c9269a4d0e9510c1721a6.patch"; hash = "sha256-IeeJVb2tOwRhEPNGqM30fNZyz3jFcnZNWC3I6K1+hSY="; }) + + # apply mailgun/expiringdict#56 for compatibility with Python 3.12 + (fetchpatch2 { + url = "https://github.com/mailgun/expiringdict/commit/976faf3664d54049e443aca054f5819db834577b.patch"; + hash = "sha256-FNdnU6iUMyED5j8oAjhmJTR7zQeEc/Z5s64pdeT4F8w="; + }) ]; nativeCheckInputs = [ From ead5eba6b371b8a849ac4ed7f427fc2ebe09d6d2 Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Sat, 13 Jul 2024 05:36:26 -0700 Subject: [PATCH 3/3] python3Packages.expiringdict: use PEP 517 builder --- pkgs/development/python-modules/expiringdict/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/expiringdict/default.nix b/pkgs/development/python-modules/expiringdict/default.nix index 4fc3366a7a42a..e4904230a4978 100644 --- a/pkgs/development/python-modules/expiringdict/default.nix +++ b/pkgs/development/python-modules/expiringdict/default.nix @@ -6,12 +6,13 @@ dill, mock, pytestCheckHook, + setuptools }: buildPythonPackage rec { pname = "expiringdict"; version = "1.2.2"; - format = "setuptools"; + pyproject = true; # use fetchFromGitHub instead of fetchPypi because the test suite of # the package is not included into the PyPI tarball @@ -36,6 +37,8 @@ buildPythonPackage rec { }) ]; + build-system = [ setuptools ]; + nativeCheckInputs = [ dill mock