at 25.11-pre 1.8 kB view raw
1{ 2 lib, 3 stdenv, 4 appdirs, 5 buildPythonPackage, 6 fetchFromGitHub, 7 fetchpatch, 8 lxml, 9 packaging, 10 py, 11 pytestCheckHook, 12 pythonOlder, 13 termcolor, 14 wireshark-cli, 15}: 16 17buildPythonPackage rec { 18 pname = "pyshark"; 19 version = "0.6"; 20 format = "setuptools"; 21 22 disabled = pythonOlder "3.7"; 23 24 src = fetchFromGitHub { 25 owner = "KimiNewt"; 26 repo = pname; 27 tag = "v${version}"; 28 hash = "sha256-kzJDzUK6zknUyXPdKc4zMvWim4C5NQCSJSS45HI6hKM="; 29 }; 30 31 # `stripLen` does not seem to work here 32 patchFlags = [ "-p2" ]; 33 34 patches = [ 35 # fixes capture test 36 (fetchpatch { 37 url = "https://github.com/KimiNewt/pyshark/commit/7142c5bf88abcd4c65c81052a00226d6155dda42.patch"; 38 hash = "sha256-Ti7cwRyYSbF4a4pEEV9FntNevkV/JVXNqACQWzoma7g="; 39 }) 40 ]; 41 42 sourceRoot = "${src.name}/src"; 43 44 # propagate wireshark, so pyshark can find it when used 45 propagatedBuildInputs = [ 46 appdirs 47 lxml 48 packaging 49 py 50 termcolor 51 wireshark-cli 52 ]; 53 54 nativeCheckInputs = [ 55 py 56 pytestCheckHook 57 wireshark-cli 58 ]; 59 60 preCheck = '' 61 export HOME=$(mktemp -d) 62 ''; 63 64 disabledTests = 65 [ 66 # flaky 67 # KeyError: 'Packet of index 0 does not exist in capture' 68 "test_getting_packet_summary" 69 ] 70 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 71 # fails on darwin 72 # _pickle.PicklingError: logger cannot be pickled 73 "test_iterate_empty_psml_capture" 74 ]; 75 76 pythonImportsCheck = [ "pyshark" ]; 77 78 pytestFlagsArray = [ "../tests/" ]; 79 80 meta = with lib; { 81 description = "Python wrapper for tshark, allowing Python packet parsing using Wireshark dissectors"; 82 homepage = "https://github.com/KimiNewt/pyshark/"; 83 changelog = "https://github.com/KimiNewt/pyshark/releases/tag/${version}"; 84 license = licenses.mit; 85 maintainers = [ ]; 86 }; 87}