From 550f53b3e6cfa58df8f7ff33bb5f0a9e0fca48f6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 18 May 2024 11:31:40 +0200 Subject: [PATCH 1/2] python312Packages.isoweek: refactor - switch to unittestCheckHook - add pythonImportsCheck --- .../python-modules/isoweek/default.nix | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/isoweek/default.nix b/pkgs/development/python-modules/isoweek/default.nix index e16d27c47bcf..23be48c71a73 100644 --- a/pkgs/development/python-modules/isoweek/default.nix +++ b/pkgs/development/python-modules/isoweek/default.nix @@ -1,18 +1,39 @@ -{ lib, fetchPypi, buildPythonPackage }: +{ lib +, fetchPypi +, buildPythonPackage +, setuptools +, unittestCheckHook +, pythonOlder +}: buildPythonPackage rec { pname = "isoweek"; version = "1.3.3"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "1s7zsf0pab0l9gn6456qadnz5i5h90hafcjwnhx5mq23qjxggwvk"; + hash = "sha256-c/P3usRD4Fo6tFwypyBIsMTybVPYFGLsSxQsdYHT/+g="; }; + build-system = [ + setuptools + ]; + + nativeCheckInputs = [ + unittestCheckHook + ]; + + pythonImportsCheck = [ + "isoweek" + ]; + meta = with lib; { - description = "The module provide the class Week. Instances represent specific weeks spanning Monday to Sunday."; + description = "Module work with ISO weeks"; homepage = "https://github.com/gisle/isoweek"; + changelog = "https://github.com/gisle/isoweek/releases/tag/v${version}"; license = licenses.bsd2; maintainers = with maintainers; [ mrmebelman ]; }; From c28748ef965d4a376af826458a334fce15841b69 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 18 May 2024 11:32:39 +0200 Subject: [PATCH 2/2] python312Packages.isoweek: format with nixfmt --- .../python-modules/isoweek/default.nix | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/pkgs/development/python-modules/isoweek/default.nix b/pkgs/development/python-modules/isoweek/default.nix index 23be48c71a73..70c38d790430 100644 --- a/pkgs/development/python-modules/isoweek/default.nix +++ b/pkgs/development/python-modules/isoweek/default.nix @@ -1,9 +1,10 @@ -{ lib -, fetchPypi -, buildPythonPackage -, setuptools -, unittestCheckHook -, pythonOlder +{ + lib, + fetchPypi, + buildPythonPackage, + setuptools, + unittestCheckHook, + pythonOlder, }: buildPythonPackage rec { @@ -18,17 +19,11 @@ buildPythonPackage rec { hash = "sha256-c/P3usRD4Fo6tFwypyBIsMTybVPYFGLsSxQsdYHT/+g="; }; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; - nativeCheckInputs = [ - unittestCheckHook - ]; + nativeCheckInputs = [ unittestCheckHook ]; - pythonImportsCheck = [ - "isoweek" - ]; + pythonImportsCheck = [ "isoweek" ]; meta = with lib; { description = "Module work with ISO weeks"; @@ -38,4 +33,3 @@ buildPythonPackage rec { maintainers = with maintainers; [ mrmebelman ]; }; } -