about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/whispers/default.nix
blob: 07c1f1e707e409eea58dd846d827eafe6b379da7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ lib
, fetchFromGitHub
, python3
}:

python3.pkgs.buildPythonApplication rec {
  pname = "whispers";
  version = "1.5.3";

  src = fetchFromGitHub {
    owner = "Skyscanner";
    repo = pname;
    rev = version;
    sha256 = "sha256-jruUGyoZCyMu015QKtlvfx5WRMfxo/eYUue9wUIWb6o=";
  };

  propagatedBuildInputs = with python3.pkgs; [
    astroid
    beautifulsoup4
    jproperties
    luhn
    lxml
    python-Levenshtein
    pyyaml
  ];

  checkInputs = with python3.pkgs; [
    pytest-mock
    pytestCheckHook
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace '"pytest-runner"' ""
  '';

  preCheck = ''
    # Some tests need the binary available in PATH
    export PATH=$out/bin:$PATH
  '';

  pythonImportsCheck = [
    "whispers"
  ];

  meta = with lib; {
    description = "Tool to identify hardcoded secrets in static structured text";
    homepage = "https://github.com/Skyscanner/whispers";
    license = with licenses; [ asl20 ];
    maintainers = with maintainers; [ fab ];
  };
}