about summary refs log tree commit diff
path: root/pkgs/development/python-modules/glances-api
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-11-24 08:43:43 +0100
committerFabian Affolter <mail@fabian-affolter.ch>2021-11-24 08:43:43 +0100
commit5565961762f118e44b3949621cbde4e0dd41f26b (patch)
tree0051006e9d3f9e181caeacb711f629976af4787b /pkgs/development/python-modules/glances-api
parent1799f8e87beb9d88c31401d53b92d245fc97857e (diff)
python3Packages.glances-api: 0.2.1 -> 0.3.2
Diffstat (limited to 'pkgs/development/python-modules/glances-api')
-rw-r--r--pkgs/development/python-modules/glances-api/default.nix39
1 files changed, 30 insertions, 9 deletions
diff --git a/pkgs/development/python-modules/glances-api/default.nix b/pkgs/development/python-modules/glances-api/default.nix
index 1ec6ce3342002..e9d68685a3f19 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=";
   };
 
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
   propagatedBuildInputs = [
-    aiohttp
-    async-timeout
+    httpx
   ];
 
-  # no tests are present
-  doCheck = false;
-  pythonImportsCheck = [ "glances_api" ];
+  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";