From 5565961762f118e44b3949621cbde4e0dd41f26b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 24 Nov 2021 08:43:43 +0100 Subject: [PATCH] python3Packages.glances-api: 0.2.1 -> 0.3.2 --- .../python-modules/glances-api/default.nix | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/glances-api/default.nix b/pkgs/development/python-modules/glances-api/default.nix index 1ec6ce334200..e9d68685a3f1 100644 --- a/pkgs/development/python-modules/glances-api/default.nix +++ b/pkgs/development/python-modules/glances-api/default.nix @@ -1,29 +1,50 @@ { lib , buildPythonPackage , fetchFromGitHub -, aiohttp -, async-timeout +, httpx +, poetry-core +, pytest-asyncio +, pytest-httpx +, pytestCheckHook +, pythonOlder }: buildPythonPackage rec { pname = "glances-api"; - version = "0.2.1"; + version = "0.3.2"; + format = "pyproject"; + + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "home-assistant-ecosystem"; repo = "python-glances-api"; rev = version; - sha256 = "sha256-mbkZZg2fmus4kOXFxHE/UV/nxemFAsoEZu8IUa7SPsg="; + sha256 = "sha256-zVK63SI8ZeVrY2iEEkgp8pq6RDheKeApb9/RWgZCKGI="; }; - propagatedBuildInputs = [ - aiohttp - async-timeout + nativeBuildInputs = [ + poetry-core ]; - # no tests are present - doCheck = false; - pythonImportsCheck = [ "glances_api" ]; + propagatedBuildInputs = [ + httpx + ]; + + checkInputs = [ + pytest-asyncio + pytest-httpx + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'httpx = ">=0.20,<1"' 'httpx = ">=0.19,<1"' + ''; + + pythonImportsCheck = [ + "glances_api" + ]; meta = with lib; { description = "Python API for interacting with Glances";