From bc3024d45426ec12db1a61ce0ed3a7fbf55edbcb Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 12 May 2024 12:26:13 +0200 Subject: python312Packages.coordinates: refactor - add pythonImportsCheck - switch to pytestCheckHook --- .../python-modules/coordinates/default.nix | 35 ++++++++++++++-------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'pkgs') diff --git a/pkgs/development/python-modules/coordinates/default.nix b/pkgs/development/python-modules/coordinates/default.nix index e699e1b9a015f..f18f903493c1d 100644 --- a/pkgs/development/python-modules/coordinates/default.nix +++ b/pkgs/development/python-modules/coordinates/default.nix @@ -1,33 +1,42 @@ -{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder -, pytest +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, pytestCheckHook +, setuptools }: buildPythonPackage rec { pname = "coordinates"; version = "0.4.0"; - format = "setuptools"; + pyproject = true; - disabled = pythonOlder "3.5"; + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "clbarnes"; repo = "coordinates"; - rev = "v${version}"; - sha256 = "1zha594rshjg3qjq9mrai2hfldya282ihasp2i3km7b2j4gjdw2b"; + rev = "refs/tags/v${version}"; + hash = "sha256-S/AmH5FinTpHFFcrGAUSyjfqoIgq14QlHk9CnUkqCv4="; }; - nativeCheckInputs = [ pytest ]; + build-system = [ + setuptools + ]; - checkPhase = '' - runHook preCheck - pytest tests/ - runHook postCheck - ''; + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "coordinates" + ]; meta = with lib; { description = "Convenience class for doing maths with explicit coordinates"; homepage = "https://github.com/clbarnes/coordinates"; + changelog = "https://github.com/clbarnes/coordinates/releases/tag/v${version}"; license = licenses.mit; - maintainers = [ ]; + maintainers = with maintainers; [ ]; }; } -- cgit 1.4.1 From 454a5f23d61f92265e652e3c263bebc27e48117b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 12 May 2024 12:28:12 +0200 Subject: python312Packages.coordinates: format with nixfmt --- .../python-modules/coordinates/default.nix | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'pkgs') diff --git a/pkgs/development/python-modules/coordinates/default.nix b/pkgs/development/python-modules/coordinates/default.nix index f18f903493c1d..454a2b7083cb1 100644 --- a/pkgs/development/python-modules/coordinates/default.nix +++ b/pkgs/development/python-modules/coordinates/default.nix @@ -1,9 +1,10 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, pythonOlder -, pytestCheckHook -, setuptools +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + pytestCheckHook, + setuptools, }: buildPythonPackage rec { @@ -20,17 +21,11 @@ buildPythonPackage rec { hash = "sha256-S/AmH5FinTpHFFcrGAUSyjfqoIgq14QlHk9CnUkqCv4="; }; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; - nativeCheckInputs = [ - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; - pythonImportsCheck = [ - "coordinates" - ]; + pythonImportsCheck = [ "coordinates" ]; meta = with lib; { description = "Convenience class for doing maths with explicit coordinates"; -- cgit 1.4.1