From c1db7c1157839a308329b62d2736f7857bbcafe5 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 21 May 2024 22:53:58 +0200 Subject: [PATCH 1/2] python312Packages.nanoleaf: refactor --- .../python-modules/nanoleaf/default.nix | 35 +++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/nanoleaf/default.nix b/pkgs/development/python-modules/nanoleaf/default.nix index a77998c994c5..86ac6ba900f7 100644 --- a/pkgs/development/python-modules/nanoleaf/default.nix +++ b/pkgs/development/python-modules/nanoleaf/default.nix @@ -1,25 +1,48 @@ -{ lib, buildPythonPackage, fetchPypi, requests }: +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, requests +, setuptools +}: buildPythonPackage rec { pname = "nanoleaf"; version = "0.4.1"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "17dmxibfjmwnrs6ng5cmvfis3cv6iw267xb8n1pijy15y9dz0s8s"; + hash = "sha256-GmnwW/IleBlvsGj1YwSPZrOho9uVlWeNzpZX6VbstZ0="; }; prePatch = '' sed -i '/^gitVersion =/d' setup.py - substituteInPlace setup.py --replace 'gitVersion' '"${version}"' + substituteInPlace setup.py \ + --replace-fail 'gitVersion' '"${version}"' ''; - propagatedBuildInputs = [ requests ]; + build-system = [ + setuptools + ]; + + dependencies = [ + requests + ]; + + # Module has no test + doCheck = false; + + pythonImportsCheck = [ + "nanoleaf" + ]; meta = with lib; { - description = "A python interface for Nanoleaf Aurora lighting"; + description = "Module for interacting with Nanoleaf Aurora lighting"; homepage = "https://github.com/software-2/nanoleaf"; + changelog = "https://github.com/software-2/nanoleaf/releases/tag/${version}"; license = licenses.mit; maintainers = with maintainers; [ ]; }; From 964fb46db07774bea4fd0a7ef690aa135b55cd17 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 21 May 2024 22:54:14 +0200 Subject: [PATCH 2/2] python312Packages.nanoleaf: format with nixfmt --- .../python-modules/nanoleaf/default.nix | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/nanoleaf/default.nix b/pkgs/development/python-modules/nanoleaf/default.nix index 86ac6ba900f7..995c56510d65 100644 --- a/pkgs/development/python-modules/nanoleaf/default.nix +++ b/pkgs/development/python-modules/nanoleaf/default.nix @@ -1,9 +1,10 @@ -{ lib -, buildPythonPackage -, fetchPypi -, pythonOlder -, requests -, setuptools +{ + lib, + buildPythonPackage, + fetchPypi, + pythonOlder, + requests, + setuptools, }: buildPythonPackage rec { @@ -24,20 +25,14 @@ buildPythonPackage rec { --replace-fail 'gitVersion' '"${version}"' ''; - build-system = [ - setuptools - ]; + build-system = [ setuptools ]; - dependencies = [ - requests - ]; + dependencies = [ requests ]; # Module has no test doCheck = false; - pythonImportsCheck = [ - "nanoleaf" - ]; + pythonImportsCheck = [ "nanoleaf" ]; meta = with lib; { description = "Module for interacting with Nanoleaf Aurora lighting";