about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/systembridgeconnector/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/systembridgeconnector/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/systembridgeconnector/default.nix32
1 files changed, 28 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/systembridgeconnector/default.nix b/nixpkgs/pkgs/development/python-modules/systembridgeconnector/default.nix
index 111517c6ca5e..04132ffe081a 100644
--- a/nixpkgs/pkgs/development/python-modules/systembridgeconnector/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/systembridgeconnector/default.nix
@@ -2,15 +2,19 @@
 , buildPythonPackage
 , pythonOlder
 , fetchFromGitHub
+, fetchpatch2
 , setuptools
 , aiohttp
 , incremental
 , systembridgemodels
+, pytest-aiohttp
+, pytest-socket
+, pytestCheckHook
 }:
 
 buildPythonPackage rec {
   pname = "systembridgeconnector";
-  version = "4.0.3";
+  version = "4.0.4";
   pyproject = true;
 
   disabled = pythonOlder "3.11";
@@ -19,9 +23,21 @@ buildPythonPackage rec {
     owner = "timmo001";
     repo = "system-bridge-connector";
     rev = "refs/tags/${version}";
-    hash = "sha256-AjdWDEotz5AUo+auxBqXu7EMv/Kt97DZ6vOrFunZ2Fw=";
+    hash = "sha256-Guh9qbRLp+b2SuFgBx7jf16vRShuHJBi3WOVn9Akce8=";
   };
 
+  patches = [
+    (fetchpatch2 {
+      url = "https://github.com/timmo001/system-bridge-connector/commit/25aa172775ee983dc4a29b8dda880aefbad70040.patch";
+      hash = "sha256-PedW1S1gZmWkS4sJBqSAx3aoA1KppYS5Xlhoaxqkcd4=";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace systembridgeconnector/_version.py \
+      --replace-fail ", dev=0" ""
+  '';
+
   nativeBuildInputs = [
     setuptools
   ];
@@ -34,8 +50,16 @@ buildPythonPackage rec {
 
   pythonImportsCheck = [ "systembridgeconnector" ];
 
-  # upstream has no tests
-  doCheck = false;
+  nativeCheckInputs = [
+    pytest-aiohttp
+    pytest-socket
+    pytestCheckHook
+  ];
+
+  disabledTests = [
+    # ConnectionClosedException: Connection closed to server
+    "test_get_files"
+  ];
 
   meta = {
     changelog = "https://github.com/timmo001/system-bridge-connector/releases/tag/${version}";