1{
2 lib,
3 beautifulsoup4,
4 buildPythonPackage,
5 crossplane,
6 fetchFromGitHub,
7 jellyfish,
8 jproperties,
9 jsonschema-specifications,
10 jsonschema,
11 luhn,
12 lxml,
13 pytest-mock,
14 pytestCheckHook,
15 pythonOlder,
16 pyyaml,
17 semgrep,
18 setuptools,
19 six,
20 soupsieve,
21 wrapt,
22}:
23
24buildPythonPackage rec {
25 pname = "whispers";
26 version = "2.4.0";
27 pyproject = true;
28
29 disabled = pythonOlder "3.1";
30
31 src = fetchFromGitHub {
32 owner = "adeptex";
33 repo = "whispers";
34 tag = version;
35 hash = "sha256-hmFz6RI52CylsBIqO14hFX+2bvrPjpUBnfoDyVh9TbU=";
36 };
37
38 postPatch = ''
39 substituteInPlace setup.py \
40 --replace-fail '"pytest-runner"' ""
41 '';
42
43 pythonRelaxDeps = true;
44
45 build-system = [ setuptools ];
46
47 dependencies = [
48 beautifulsoup4
49 crossplane
50 jellyfish
51 jproperties
52 jsonschema
53 jsonschema-specifications
54 luhn
55 lxml
56 pyyaml
57 semgrep
58 six
59 soupsieve
60 wrapt
61 ];
62
63 nativeCheckInputs = [
64 pytest-mock
65 pytestCheckHook
66 ];
67
68 disabledTestPaths = [
69 # Pinning tests highly sensitive to semgrep version
70 "tests/unit/plugins/test_semgrep.py"
71 ];
72
73 preCheck = ''
74 # Pinning test highly sensitive to semgrep version
75 substituteInPlace tests/unit/test_main.py \
76 --replace-fail '("--ast", 434),' ""
77
78 # Some tests need the binary available in PATH
79 export PATH=$out/bin:$PATH
80 '';
81
82 pythonImportsCheck = [ "whispers" ];
83
84 meta = with lib; {
85 description = "Tool to identify hardcoded secrets in static structured text";
86 homepage = "https://github.com/adeptex/whispers";
87 changelog = "https://github.com/adeptex/whispers/releases/tag/${src.tag}";
88 license = licenses.asl20;
89 maintainers = with maintainers; [ fab ];
90 mainProgram = "whispers";
91 };
92}