From bfb89ba7b951f817363ded3af657d6bfd0f234fb Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 22 May 2024 12:19:10 +0200 Subject: [PATCH 1/3] python312Packages.unifi-discovery: refactor --- .../unifi-discovery/default.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/unifi-discovery/default.nix b/pkgs/development/python-modules/unifi-discovery/default.nix index 760b9f96c89b..04af933a7e42 100644 --- a/pkgs/development/python-modules/unifi-discovery/default.nix +++ b/pkgs/development/python-modules/unifi-discovery/default.nix @@ -13,22 +13,27 @@ buildPythonPackage rec { pname = "unifi-discovery"; version = "1.1.8"; - format = "pyproject"; + pyproject = true; disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "bdraco"; - repo = pname; + repo = "unifi-discovery"; rev = "refs/tags/v${version}"; hash = "sha256-gE/2awyhDACrc0nuTvTPOcK2lFbPIZAXDPRnVJtWFco="; }; - nativeBuildInputs = [ + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "--cov=unifi_discovery --cov-report=term-missing:skip-covered" "" + ''; + + build-system = [ poetry-core ]; - propagatedBuildInputs = [ + dependencies = [ aiohttp pyroute2 ]; @@ -43,11 +48,6 @@ buildPythonPackage rec { "--asyncio-mode=auto" ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "--cov=unifi_discovery --cov-report=term-missing:skip-covered" "" - ''; - pythonImportsCheck = [ "unifi_discovery" ]; @@ -55,6 +55,7 @@ buildPythonPackage rec { meta = with lib; { description = "Module to discover Unifi devices"; homepage = "https://github.com/bdraco/unifi-discovery"; + changelog = "https://github.com/bdraco/unifi-discovery/releases/tag/v${version}"; license = with licenses; [ asl20 ]; maintainers = with maintainers; [ fab ]; }; From d916ccc8470aedd7818e7a637528b0c56548b140 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 22 May 2024 12:20:00 +0200 Subject: [PATCH 2/3] python312Packages.unifi-discovery: format with nixfmt --- .../unifi-discovery/default.nix | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/pkgs/development/python-modules/unifi-discovery/default.nix b/pkgs/development/python-modules/unifi-discovery/default.nix index 04af933a7e42..35003343fcb0 100644 --- a/pkgs/development/python-modules/unifi-discovery/default.nix +++ b/pkgs/development/python-modules/unifi-discovery/default.nix @@ -1,13 +1,14 @@ -{ lib -, aiohttp -, aioresponses -, buildPythonPackage -, fetchFromGitHub -, poetry-core -, pyroute2 -, pytest-asyncio -, pytestCheckHook -, pythonOlder +{ + lib, + aiohttp, + aioresponses, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + pyroute2, + pytest-asyncio, + pytestCheckHook, + pythonOlder, }: buildPythonPackage rec { @@ -29,9 +30,7 @@ buildPythonPackage rec { --replace-fail "--cov=unifi_discovery --cov-report=term-missing:skip-covered" "" ''; - build-system = [ - poetry-core - ]; + build-system = [ poetry-core ]; dependencies = [ aiohttp @@ -44,13 +43,9 @@ buildPythonPackage rec { pytestCheckHook ]; - pytestFlagsArray = [ - "--asyncio-mode=auto" - ]; + pytestFlagsArray = [ "--asyncio-mode=auto" ]; - pythonImportsCheck = [ - "unifi_discovery" - ]; + pythonImportsCheck = [ "unifi_discovery" ]; meta = with lib; { description = "Module to discover Unifi devices"; From 787ef6045f13b4aac312db48385793c42f484789 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 22 May 2024 12:28:30 +0200 Subject: [PATCH 3/3] python312Packages.unifi-discovery: limit platform support --- pkgs/development/python-modules/unifi-discovery/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/unifi-discovery/default.nix b/pkgs/development/python-modules/unifi-discovery/default.nix index 35003343fcb0..1bfcce4e430e 100644 --- a/pkgs/development/python-modules/unifi-discovery/default.nix +++ b/pkgs/development/python-modules/unifi-discovery/default.nix @@ -53,5 +53,6 @@ buildPythonPackage rec { changelog = "https://github.com/bdraco/unifi-discovery/releases/tag/v${version}"; license = with licenses; [ asl20 ]; maintainers = with maintainers; [ fab ]; + platforms = platforms.linux; }; }