From 37711ec8f927a5d2cff091ad3b9071fa1d432154 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 18 May 2024 21:05:20 +0200 Subject: [PATCH 1/2] python311Packages.mortgage: refactor - enable tests - add pythonImportsCheck --- .../python-modules/mortgage/default.nix | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/mortgage/default.nix b/pkgs/development/python-modules/mortgage/default.nix index ebe5b55b1dba..69454c78331a 100644 --- a/pkgs/development/python-modules/mortgage/default.nix +++ b/pkgs/development/python-modules/mortgage/default.nix @@ -1,31 +1,41 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub , pytestCheckHook , pythonOlder +, setuptools }: buildPythonPackage rec { pname = "mortgage"; version = "1.0.5"; - format = "setuptools"; + pyproject = true; - src = fetchPypi { - inherit version pname; - sha256 = "18fcb356c631e9cc27fa7019f6ff6021707e34b9ce3a3b7dc815661288709921"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "jlumbroso"; + repo = "mortgage"; + rev = "refs/tags/v${version}"; + hash = "sha256-UwSEKfMQqxpcF+7TF/+qD6l8gEO/qDCUklpZz1Nt/Ok="; }; + build-system = [ + setuptools + ]; + nativeCheckInputs = [ pytestCheckHook ]; - doCheck = false; # No tests in sdist + pythonImportsCheck = [ + "mortgage" + ]; - disabled = pythonOlder "3.5"; - - meta = { + meta = with lib; { description = "Mortgage calculator"; - license = lib.licenses.mit; + homepage = "https://github.com/jlumbroso/mortgage"; + license = licenses.mit; + maintainers = with maintainers; [ ]; }; - } From 223d5bf1ea01e4347260dab3721f2368f13b0f69 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 18 May 2024 21:06:06 +0200 Subject: [PATCH 2/2] python311Packages.mortgage: format with nixfmt --- .../python-modules/mortgage/default.nix | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/mortgage/default.nix b/pkgs/development/python-modules/mortgage/default.nix index 69454c78331a..6cc5ccc507f2 100644 --- a/pkgs/development/python-modules/mortgage/default.nix +++ b/pkgs/development/python-modules/mortgage/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-UwSEKfMQqxpcF+7TF/+qD6l8gEO/qDCUklpZz1Nt/Ok="; }; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; - pythonImportsCheck = [ - "mortgage" - ]; + pythonImportsCheck = [ "mortgage" ]; meta = with lib; { description = "Mortgage calculator";