1{
2 lib,
3 astroid,
4 beautifulsoup4,
5 buildPythonPackage,
6 crossplane,
7 fetchFromGitHub,
8 jellyfish,
9 jproperties,
10 luhn,
11 lxml,
12 pytest-mock,
13 pytestCheckHook,
14 pythonOlder,
15 pyyaml,
16 setuptools,
17}:
18
19buildPythonPackage rec {
20 pname = "whispers";
21 version = "2.2.1";
22 pyproject = true;
23
24 disabled = pythonOlder "3.7";
25
26 src = fetchFromGitHub {
27 owner = "adeptex";
28 repo = "whispers";
29 rev = "refs/tags/${version}";
30 hash = "sha256-YPfTe2txQY/sVEIGSMTA1b3Ye3j8qT+YdWp3AVqpdLI=";
31 };
32
33 postPatch = ''
34 substituteInPlace setup.py \
35 --replace-fail '"pytest-runner"' ""
36 '';
37
38 build-system = [ setuptools ];
39
40 dependencies = [
41 astroid
42 beautifulsoup4
43 crossplane
44 jellyfish
45 jproperties
46 luhn
47 lxml
48 pyyaml
49 ];
50
51 nativeCheckInputs = [
52 pytest-mock
53 pytestCheckHook
54 ];
55
56 preCheck = ''
57 # Some tests need the binary available in PATH
58 export PATH=$out/bin:$PATH
59 '';
60
61 pythonImportsCheck = [ "whispers" ];
62
63 meta = with lib; {
64 description = "Tool to identify hardcoded secrets in static structured text";
65 homepage = "https://github.com/adeptex/whispers";
66 changelog = "https://github.com/adeptex/whispers/releases/tag/${version}";
67 license = with licenses; [ asl20 ];
68 maintainers = with maintainers; [ fab ];
69 mainProgram = "whispers";
70 };
71}