From da5a9123715a28fcd152dc22da0378072b957f47 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 22 May 2024 12:52:10 +0200 Subject: [PATCH 1/3] python311Packages.skybellpy: refactor --- .../python-modules/skybellpy/default.nix | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/skybellpy/default.nix b/pkgs/development/python-modules/skybellpy/default.nix index 69837c5d6853..4b6426496a49 100644 --- a/pkgs/development/python-modules/skybellpy/default.nix +++ b/pkgs/development/python-modules/skybellpy/default.nix @@ -8,22 +8,28 @@ , pythonOlder , requests , requests-mock +, setuptools }: buildPythonPackage rec { pname = "skybellpy"; version = "0.6.3"; - format = "setuptools"; + pyproject = true; + disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "MisterWil"; - repo = pname; - rev = "v${version}"; - sha256 = "1ghvm0pcdyhq6xfjc2dkldd701x77w07077sx09xsk6q2milmvzz"; + repo = "skybellpy"; + rev = "refs/tags/v${version}"; + hash = "sha256-/+9KYxXYTN0T6PoccAA/pwdwWqOzCSZdNxj6xi6oG74="; }; - propagatedBuildInputs = [ + build-system = [ + setuptools + ]; + + dependencies = [ colorlog requests ]; @@ -35,13 +41,16 @@ buildPythonPackage rec { requests-mock ]; - pythonImportsCheck = [ "skybellpy" ]; + pythonImportsCheck = [ + "skybellpy" + ]; meta = with lib; { description = "Python wrapper for the Skybell alarm API"; - mainProgram = "skybellpy"; homepage = "https://github.com/MisterWil/skybellpy"; - license = with licenses; [ mit ]; + changelog = "https://github.com/MisterWil/skybellpy/releases/tag/v${version}"; + license = licenses.mit; maintainers = with maintainers; [ fab ]; + mainProgram = "skybellpy"; }; } From 844d52a299f8fa73852a8b5c5c57d268bcb79622 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 22 May 2024 12:52:28 +0200 Subject: [PATCH 2/3] python311Packages.skybellpy: format with nixfmt --- .../python-modules/skybellpy/default.nix | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/pkgs/development/python-modules/skybellpy/default.nix b/pkgs/development/python-modules/skybellpy/default.nix index 4b6426496a49..d459066e6c13 100644 --- a/pkgs/development/python-modules/skybellpy/default.nix +++ b/pkgs/development/python-modules/skybellpy/default.nix @@ -1,14 +1,15 @@ -{ lib -, buildPythonPackage -, colorlog -, fetchFromGitHub -, pytest-sugar -, pytest-timeout -, pytestCheckHook -, pythonOlder -, requests -, requests-mock -, setuptools +{ + lib, + buildPythonPackage, + colorlog, + fetchFromGitHub, + pytest-sugar, + pytest-timeout, + pytestCheckHook, + pythonOlder, + requests, + requests-mock, + setuptools, }: buildPythonPackage rec { @@ -25,9 +26,7 @@ buildPythonPackage rec { hash = "sha256-/+9KYxXYTN0T6PoccAA/pwdwWqOzCSZdNxj6xi6oG74="; }; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; dependencies = [ colorlog @@ -41,9 +40,7 @@ buildPythonPackage rec { requests-mock ]; - pythonImportsCheck = [ - "skybellpy" - ]; + pythonImportsCheck = [ "skybellpy" ]; meta = with lib; { description = "Python wrapper for the Skybell alarm API"; From 62d0d76f64b6a8f0e9a91ba37b30918f13c0bb52 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 22 May 2024 12:54:20 +0200 Subject: [PATCH 3/3] python312Packages.skybellpy: disable on Python 3.12 Still uses distrutils, https://github.com/MisterWil/skybellpy/issues/22 --- pkgs/development/python-modules/skybellpy/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/skybellpy/default.nix b/pkgs/development/python-modules/skybellpy/default.nix index d459066e6c13..c05b3b0b96ef 100644 --- a/pkgs/development/python-modules/skybellpy/default.nix +++ b/pkgs/development/python-modules/skybellpy/default.nix @@ -6,6 +6,7 @@ pytest-sugar, pytest-timeout, pytestCheckHook, + pythonAtLeast, pythonOlder, requests, requests-mock, @@ -17,7 +18,8 @@ buildPythonPackage rec { version = "0.6.3"; pyproject = true; - disabled = pythonOlder "3.6"; + # Still uses distrutils, https://github.com/MisterWil/skybellpy/issues/22 + disabled = pythonOlder "3.6" || pythonAtLeast "3.12"; src = fetchFromGitHub { owner = "MisterWil";