From 4eea3ae9b0f72df1e4e229efbe7a703855742ce0 Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 3 Nov 2023 19:24:19 +0900 Subject: [PATCH] python311Packages.flufl-i18n: refactor --- .../development/python-modules/flufl/i18n.nix | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/flufl/i18n.nix b/pkgs/development/python-modules/flufl/i18n.nix index e749c10e00e2..bd5bcb62fe6c 100644 --- a/pkgs/development/python-modules/flufl/i18n.nix +++ b/pkgs/development/python-modules/flufl/i18n.nix @@ -1,21 +1,19 @@ { lib , buildPythonPackage , fetchPypi +, pythonOlder , atpublic , pdm-pep517 +, pytestCheckHook +, sybil }: buildPythonPackage rec { pname = "flufl-i18n"; version = "4.1.1"; - format = "pyproject"; + pyproject = true; - nativeBuildInputs = [ pdm-pep517 ]; - propagatedBuildInputs = [ atpublic ]; - - doCheck = false; - - pythonImportsCheck = [ "flufl.i18n" ]; + disabled = pythonOlder "3.7"; src = fetchPypi { pname = "flufl.i18n"; @@ -23,6 +21,26 @@ buildPythonPackage rec { hash = "sha256-wKz6aggkJ9YBJ+o75XjC4Ddnn+Zi9hlYDnliwTc7DNs="; }; + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "--cov=flufl --cov-report=term --cov-report=xml" "" + ''; + + nativeBuildInputs = [ pdm-pep517 ]; + + propagatedBuildInputs = [ atpublic ]; + + pythonImportsCheck = [ "flufl.i18n" ]; + + nativeCheckInputs = [ + pytestCheckHook + sybil + ]; + + pythonNamespaces = [ + "flufl" + ]; + meta = with lib; { description = "A high level API for internationalizing Python libraries and applications"; homepage = "https://gitlab.com/warsaw/flufl.i18n";