summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyshark/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pyshark/default.nix')
-rw-r--r--pkgs/development/python-modules/pyshark/default.nix43
1 files changed, 29 insertions, 14 deletions
diff --git a/pkgs/development/python-modules/pyshark/default.nix b/pkgs/development/python-modules/pyshark/default.nix
index 1bb91953983..ded9bcbbc4e 100644
--- a/pkgs/development/python-modules/pyshark/default.nix
+++ b/pkgs/development/python-modules/pyshark/default.nix
@@ -1,38 +1,53 @@
-{ lib, buildPythonPackage, fetchFromGitHub, py, lxml, pytestCheckHook, wireshark-cli }:
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, lxml
+, packaging
+, py
+, pytestCheckHook
+, pythonOlder
+, wireshark-cli
+}:
 
 buildPythonPackage rec {
   pname = "pyshark";
-  version = "0.4.3";
+  version = "0.4.5";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
 
   src = fetchFromGitHub {
     owner = "KimiNewt";
     repo = pname;
-    rev = "v${version}";
-    sha256 = "sha256-cveiFkkSplfQPgUEVWyV40KKHCtKJZsfvdV8JmEUmE4=";
+    # 0.4.5 was the last release which was tagged
+    # https://github.com/KimiNewt/pyshark/issues/541
+    rev = "8f8f13aba6ae716aa0a48175255063fe542fdc3b";
+    hash = "sha256-v9CC9hgTABAiJ0qiFZ/9/zMmHzJXKq3neGtTq/ucnT4=";
   };
 
+  sourceRoot = "${src.name}/src";
+
   propagatedBuildInputs = [
     py
     lxml
+    packaging
   ];
 
-  preConfigure = ''
-    cd src
-  '';
-
-  preCheck = ''
-    cd ..
-  '';
-
   checkInputs = [
     pytestCheckHook
     wireshark-cli
   ];
 
-  pythonImportsCheck = [ "pyshark" ];
+  pythonImportsCheck = [
+    "pyshark"
+  ];
+
+  pytestFlagsArray = [
+    "../tests/"
+  ];
 
   meta = with lib; {
-    description = "Python wrapper for tshark, allowing python packet parsing using wireshark dissectors";
+    description = "Python wrapper for tshark, allowing Python packet parsing using Wireshark dissectors";
     homepage = "https://github.com/KimiNewt/pyshark/";
     license = licenses.mit;
     maintainers = with maintainers; [ petabyteboy ];