From 49fd2c26f6048396f3638cf01a376c56bc86bcff Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 29 Sep 2021 09:35:56 +0200 Subject: [PATCH 1/2] python3Packages.aiounifi: 26 -> 27 --- pkgs/development/python-modules/aiounifi/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/aiounifi/default.nix b/pkgs/development/python-modules/aiounifi/default.nix index 7d6276e53e64..14cc707b832a 100644 --- a/pkgs/development/python-modules/aiounifi/default.nix +++ b/pkgs/development/python-modules/aiounifi/default.nix @@ -3,13 +3,13 @@ buildPythonPackage rec { pname = "aiounifi"; - version = "26"; + version = "27"; disabled = ! isPy3k; src = fetchPypi { inherit pname version; - sha256 = "3dd0f9fc59edff5d87905ddef3eecc93f974c209d818d3a91061b05925da04af"; + sha256 = "sha256-e84EwhyHxO7KHbWFzCiXw285q2baUkE7J25tED3Yt2o="; }; propagatedBuildInputs = [ aiohttp ]; From b56d66f50710a548a248e757fb62de764998065a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 29 Sep 2021 09:41:51 +0200 Subject: [PATCH 2/2] python3Packages.aiounifi: enable tests --- .../python-modules/aiounifi/default.nix | 42 +++++++++++++------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/aiounifi/default.nix b/pkgs/development/python-modules/aiounifi/default.nix index 14cc707b832a..e537222f4dfb 100644 --- a/pkgs/development/python-modules/aiounifi/default.nix +++ b/pkgs/development/python-modules/aiounifi/default.nix @@ -1,26 +1,44 @@ -{ lib, buildPythonPackage, fetchPypi, isPy3k -, aiohttp }: +{ lib +, aiohttp +, aioresponses +, buildPythonPackage +, fetchFromGitHub +, pytest-aiohttp +, pytest-asyncio +, pytestCheckHook +, pythonOlder +}: buildPythonPackage rec { pname = "aiounifi"; version = "27"; - disabled = ! isPy3k; + disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit pname version; - sha256 = "sha256-e84EwhyHxO7KHbWFzCiXw285q2baUkE7J25tED3Yt2o="; + src = fetchFromGitHub { + owner = "Kane610"; + repo = pname; + rev = "v${version}"; + sha256 = "09bxyfrwhqwlfxwgbbnkyd7md9wz05y3fjvc9f0rrj70z7qcicnv"; }; - propagatedBuildInputs = [ aiohttp ]; + propagatedBuildInputs = [ + aiohttp + ]; - # upstream has no tests - doCheck = false; + checkInputs = [ + aioresponses + pytest-aiohttp + pytest-asyncio + pytestCheckHook + ]; + + pythonImportsCheck = [ "aiounifi" ]; meta = with lib; { - description = "An asynchronous Python library for communicating with Unifi Controller API"; - homepage = "https://pypi.python.org/pypi/aiounifi/"; - license = licenses.mit; + description = "Python library for communicating with Unifi Controller API"; + homepage = "https://github.com/Kane610/aiounifi"; + license = licenses.mit; maintainers = with maintainers; [ peterhoeg ]; }; }