evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / pyshark / default.nix
blob7e4cff21d181264686e739ddf8bbcff5ed6d968a
2   lib,
3   stdenv,
4   appdirs,
5   buildPythonPackage,
6   fetchFromGitHub,
7   lxml,
8   packaging,
9   py,
10   pytestCheckHook,
11   pythonOlder,
12   termcolor,
13   wireshark-cli,
16 buildPythonPackage rec {
17   pname = "pyshark";
18   version = "0.6";
19   format = "setuptools";
21   disabled = pythonOlder "3.7";
23   src = fetchFromGitHub {
24     owner = "KimiNewt";
25     repo = pname;
26     rev = "refs/tags/v${version}";
27     hash = "sha256-kzJDzUK6zknUyXPdKc4zMvWim4C5NQCSJSS45HI6hKM=";
28   };
30   # `stripLen` does not seem to work here
31   patchFlags = [ "-p2" ];
33   sourceRoot = "${src.name}/src";
35   # propagate wireshark, so pyshark can find it when used
36   propagatedBuildInputs = [
37     appdirs
38     lxml
39     packaging
40     py
41     termcolor
42     wireshark-cli
43   ];
45   nativeCheckInputs = [
46     py
47     pytestCheckHook
48     wireshark-cli
49   ];
51   preCheck = ''
52     export HOME=$(mktemp -d)
53   '';
55   disabledTests =
56     [
57       # flaky
58       # KeyError: 'Packet of index 0 does not exist in capture'
59       "test_getting_packet_summary"
60     ]
61     ++ lib.optionals stdenv.hostPlatform.isDarwin [
62       # fails on darwin
63       # _pickle.PicklingError: logger cannot be pickled
64       "test_iterate_empty_psml_capture"
65     ];
67   pythonImportsCheck = [ "pyshark" ];
69   pytestFlagsArray = [ "../tests/" ];
71   meta = with lib; {
72     description = "Python wrapper for tshark, allowing Python packet parsing using Wireshark dissectors";
73     homepage = "https://github.com/KimiNewt/pyshark/";
74     changelog = "https://github.com/KimiNewt/pyshark/releases/tag/${version}";
75     license = licenses.mit;
76     maintainers = [ ];
77   };