From cceefc0ee15ae3158be9c1739b6516d4367e473d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 12 May 2024 14:17:35 +0200 Subject: [PATCH 1/2] python312Packages.naturalsort: refactor --- .../python-modules/naturalsort/default.nix | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/naturalsort/default.nix b/pkgs/development/python-modules/naturalsort/default.nix index 9d7572fb0f70..a273e811c3b0 100644 --- a/pkgs/development/python-modules/naturalsort/default.nix +++ b/pkgs/development/python-modules/naturalsort/default.nix @@ -1,20 +1,41 @@ -{ lib, buildPythonPackage, fetchFromGitHub }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +, setuptools +}: buildPythonPackage rec { pname = "naturalsort"; version = "1.5.1"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "xolox"; repo = "python-naturalsort"; - rev = version; - sha256 = "0w43vlddzh97hffnvxp2zkrns9qyirx5g8ijxnxkbx1c4b4gq5ih"; + rev = "refs/tags/${version}"; + hash = "sha256-MBb8yCIs9DW77TKiV3qOHidt8/zi9m2dgyfB3xrdg3A="; }; + build-system = [ + setuptools + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "natsort" + ]; + meta = with lib; { description = "Simple natural order sorting API for Python that just works"; homepage = "https://github.com/xolox/python-naturalsort"; + changelog = "https://github.com/xolox/python-naturalsort/releases/tag/${version}"; license = licenses.mit; maintainers = with maintainers; [ eyjhb ]; }; From 7251e4804b70b42b379531734cecd8fef60ef86b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 12 May 2024 14:18:29 +0200 Subject: [PATCH 2/2] python312Packages.naturalsort: format with nixfmt --- .../python-modules/naturalsort/default.nix | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/naturalsort/default.nix b/pkgs/development/python-modules/naturalsort/default.nix index a273e811c3b0..8be9da8328f2 100644 --- a/pkgs/development/python-modules/naturalsort/default.nix +++ b/pkgs/development/python-modules/naturalsort/default.nix @@ -1,9 +1,10 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, pytestCheckHook -, pythonOlder -, setuptools +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pytestCheckHook, + pythonOlder, + setuptools, }: buildPythonPackage rec { @@ -20,17 +21,11 @@ buildPythonPackage rec { hash = "sha256-MBb8yCIs9DW77TKiV3qOHidt8/zi9m2dgyfB3xrdg3A="; }; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; - pythonImportsCheck = [ - "natsort" - ]; + pythonImportsCheck = [ "natsort" ]; meta = with lib; { description = "Simple natural order sorting API for Python that just works";