summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/detect-secrets/default.nix
blob: c4e5d6f7a4395e60b3024ce3b1cca121ceda4e11 (plain)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  gibberish-detector,
  mock,
  pkgs,
  pyahocorasick,
  pytest7CheckHook,
  pyyaml,
  requests,
  responses,
  setuptools,
  unidiff,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage rec {
  pname = "detect-secrets";
  version = "1.5.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "Yelp";
    repo = "detect-secrets";
    tag = "v${version}";
    hash = "sha256-pNLAZUJhjZ3b01XaltJUJ9O7Blv6/pHQrRvURe7MJ5A=";
    leaveDotGit = true;
  };

  build-system = [ setuptools ];

  dependencies = [
    gibberish-detector
    pyyaml
    pyahocorasick
    requests
  ];

  nativeCheckInputs = [
    mock
    pytest7CheckHook
    responses
    unidiff
    pkgs.gitMinimal
    writableTmpDirAsHomeHook
  ];

  disabledTests = [
    # Tests are failing for various reasons. Needs to be adjusted with the next update
    "test_basic"
    "test_handles_each_path_separately"
    "test_handles_multiple_directories"
    "test_load_and_output"
    "test_make_decisions"
    "test_restores_line_numbers"
    "test_saves_to_baseline"
    "test_scan_all_files"
    "test_start_halfway"
  ];

  pythonImportsCheck = [ "detect_secrets" ];

  meta = {
    description = "Enterprise friendly way of detecting and preventing secrets in code";
    homepage = "https://github.com/Yelp/detect-secrets";
    changelog = "https://github.com/Yelp/detect-secrets/releases/tag/${src.tag}";
    license = lib.licenses.asl20;
    maintainers = [ ];
  };
}