From d103f5e5fa4391ed148181952a8c75b6f577e50d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 19 Jan 2024 20:47:33 +0100 Subject: [PATCH] python311Packages.unify: refactor --- .../python-modules/unify/default.nix | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/unify/default.nix b/pkgs/development/python-modules/unify/default.nix index 58bee2b6e52e..fc0cd0d4f67e 100644 --- a/pkgs/development/python-modules/unify/default.nix +++ b/pkgs/development/python-modules/unify/default.nix @@ -1,26 +1,47 @@ { lib , buildPythonPackage , fetchFromGitHub +, pythonOlder +, setuptools +, pytestCheckHook , untokenize -, unittestCheckHook }: buildPythonPackage rec { pname = "unify"; version = "0.5"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.9"; - # PyPi release is missing tests (see https://github.com/myint/unify/pull/18) src = fetchFromGitHub { owner = "myint"; repo = "unify"; - rev = "v${version}"; - sha256 = "1l6xxygaigacsxf0g5f7w5gpqha1ava6mcns81kqqy6vw91pyrbi"; + rev = "refs/tags/v${version}"; + hash = "sha256-cWV/Q+LbeIxnQNqyatRWQUF8X+HHlQdc10y9qJ7v3dA="; }; - propagatedBuildInputs = [ untokenize ]; + nativeBuildInputs = [ + setuptools + ]; - nativeCheckInputs = [ unittestCheckHook ]; + propagatedBuildInputs = [ + untokenize + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "unify" + ]; + + disabledTests = [ + # https://github.com/myint/unify/issues/21 + "test_format_code" + "test_format_code_with_backslash_in_comment" + ]; meta = with lib; { description = "Modifies strings to all use the same quote where possible";