Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, gibberish-detector
5, isPy27
6, mock
7, pkgs
8, pyahocorasick
9, pytestCheckHook
10, pyyaml
11, requests
12, responses
13, unidiff
14}:
15
16buildPythonPackage rec {
17 pname = "detect-secrets";
18 version = "1.1.0";
19 disabled = isPy27;
20
21 src = fetchFromGitHub {
22 owner = "Yelp";
23 repo = pname;
24 rev = "v${version}";
25 sha256 = "sha256-dG2YaWXAMINxBGKNMlVfGTR9QHdnepiZmN+G88X4Wak=";
26 leaveDotGit = true;
27 };
28
29 propagatedBuildInputs = [
30 gibberish-detector
31 pyyaml
32 pyahocorasick
33 requests
34 ];
35
36 checkInputs = [
37 mock
38 pytestCheckHook
39 responses
40 unidiff
41 pkgs.gitMinimal
42 ];
43
44 preCheck = ''
45 export HOME=$(mktemp -d);
46 '';
47
48 disabledTests = [
49 # Tests are failing for various reasons. Needs to be adjusted with the next update
50 "test_basic"
51 "test_handles_each_path_separately"
52 "test_handles_multiple_directories"
53 "test_load_and_output"
54 "test_make_decisions"
55 "test_restores_line_numbers"
56 "test_saves_to_baseline"
57 "test_scan_all_files"
58 "test_start_halfway"
59 ];
60
61 pythonImportsCheck = [ "detect_secrets" ];
62
63 meta = with lib; {
64 description = "An enterprise friendly way of detecting and preventing secrets in code";
65 homepage = "https://github.com/Yelp/detect-secrets";
66 license = licenses.asl20;
67 maintainers = with maintainers; [ marsam ];
68 };
69}