From 2c837efd05e967d6ec451e867ff15d734d4d9446 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Fri, 10 May 2024 16:03:52 +0200 Subject: [PATCH] python311Packages.setuptools-gettext: use pyproject, clean up, adopt --- .../setuptools-gettext/default.nix | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/setuptools-gettext/default.nix b/pkgs/development/python-modules/setuptools-gettext/default.nix index 394f4c4693fa..ab9961af3395 100644 --- a/pkgs/development/python-modules/setuptools-gettext/default.nix +++ b/pkgs/development/python-modules/setuptools-gettext/default.nix @@ -1,16 +1,22 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, pythonOlder -, setuptools +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + pythonAtLeast, + setuptools, + tomli, + pytestCheckHook, + gettext, }: buildPythonPackage rec { pname = "setuptools-gettext"; version = "0.1.11"; - format = "setuptools"; + pyproject = true; - disabled = pythonOlder "3.7"; + # >=3.12 doesn't work because the package depends on `distutils` + disabled = pythonOlder "3.7" || pythonAtLeast "3.12"; src = fetchFromGitHub { owner = "breezy-team"; @@ -19,19 +25,22 @@ buildPythonPackage rec { hash = "sha256-yLKn4wwGgRdlsISAT71lD2vkIefsTJRB+OEA030adZY="; }; - propagatedBuildInputs = [ - setuptools + build-system = [ setuptools ]; + + dependencies = [ setuptools ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; + + pythonImportsCheck = [ "setuptools_gettext" ]; + + nativeCheckInputs = [ + pytestCheckHook + gettext ]; - pythonImportsCheck = [ - "setuptools_gettext" - ]; - - meta = with lib; { + meta = { changelog = "https://github.com/breezy-team/setuptools-gettext/releases/tag/v${version}"; description = "setuptools plugin for building mo files"; homepage = "https://github.com/breezy-team/setuptools-gettext"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ ]; + license = lib.licenses.gpl2Plus; + maintainers = with lib.maintainers; [ tomasajt ]; }; }