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