From 1395fd5ca75eac3c3dd12fcf3b7f32649243c1ef Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 7 Dec 2023 03:20:37 +0100 Subject: [PATCH] python311Packages.icecream: use pep517 build, enable tests and establish python 3.12 compatibilty. --- .../python-modules/icecream/default.nix | 46 +++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/icecream/default.nix b/pkgs/development/python-modules/icecream/default.nix index 601a55e80f6e..db9e56bb8b6e 100644 --- a/pkgs/development/python-modules/icecream/default.nix +++ b/pkgs/development/python-modules/icecream/default.nix @@ -1,18 +1,56 @@ -{ lib, buildPythonPackage, fetchPypi -, asttokens, colorama, executing, pygments +{ lib +, buildPythonPackage +, fetchPypi + +# build-system +, setuptools + +# dependencies +, asttokens +, colorama +, executing +, pygments + +# tests +, pytestCheckHook }: buildPythonPackage rec { pname = "icecream"; version = "2.1.3"; - format = "setuptools"; + pyproject = true; src = fetchPypi { inherit pname version; hash = "sha256-CqSnwzdOw2FTodCPgeMIDoPYrB7v2X0vT+lUTo+bSd4="; }; - propagatedBuildInputs = [ asttokens colorama executing pygments ]; + postPatch = '' + substituteInPlace tests/test_icecream.py \ + --replace assertRegexpMatches assertRegex + ''; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + asttokens + colorama + executing + pygments + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + # icecream.icecream.NoSourceAvailableError + "testSingledispatchArgumentToString" + # AssertionError: assert [[('REPL (e.g...ion?', None)]] == [[('a', '1')], [('c', '3')]] + "testEnableDisable" + ]; meta = with lib; { description = "A little library for sweet and creamy print debugging";