nixpkgs-suyu/pkgs/development/python-modules/detect-secrets/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
1.3 KiB
Nix
Raw Normal View History

2021-01-24 00:19:12 +01:00
{ lib
, buildPythonPackage
2021-01-24 00:19:12 +01:00
, fetchFromGitHub
2021-07-04 13:29:05 +02:00
, gibberish-detector
2021-01-24 00:19:12 +01:00
, isPy27
, mock
, pkgs
2021-01-24 00:19:12 +01:00
, pyahocorasick
, pytestCheckHook
, pyyaml
, requests
, responses
, unidiff
}:
2018-12-26 00:01:00 +01:00
buildPythonPackage rec {
2018-12-26 00:01:00 +01:00
pname = "detect-secrets";
version = "1.2.0";
2021-01-24 00:19:12 +01:00
disabled = isPy27;
2018-12-26 00:01:00 +01:00
src = fetchFromGitHub {
owner = "Yelp";
2021-01-24 00:19:12 +01:00
repo = pname;
2018-12-26 00:01:00 +01:00
rev = "v${version}";
hash = "sha256-4VcV06iaL3NAj7qF8RyfWV1zgrt928AQfjGeuO2Pbjk=";
leaveDotGit = true;
2018-12-26 00:01:00 +01:00
};
2021-01-24 00:19:12 +01:00
propagatedBuildInputs = [
2021-07-04 13:29:05 +02:00
gibberish-detector
2021-01-24 00:19:12 +01:00
pyyaml
2021-07-04 13:29:05 +02:00
pyahocorasick
2021-01-24 00:19:12 +01:00
requests
];
2018-12-26 00:01:00 +01:00
2021-01-24 00:19:12 +01:00
checkInputs = [
mock
pytestCheckHook
responses
unidiff
pkgs.gitMinimal
2021-01-24 00:19:12 +01:00
];
2018-12-26 00:01:00 +01:00
2021-07-04 13:29:05 +02:00
preCheck = ''
export HOME=$(mktemp -d);
'';
2021-01-24 00:19:12 +01:00
disabledTests = [
2021-07-04 13:29:05 +02:00
# 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"
2021-07-04 13:29:05 +02:00
"test_saves_to_baseline"
"test_scan_all_files"
"test_start_halfway"
2021-01-24 00:19:12 +01:00
];
pythonImportsCheck = [ "detect_secrets" ];
2018-12-26 00:01:00 +01:00
meta = with lib; {
description = "An enterprise friendly way of detecting and preventing secrets in code";
homepage = "https://github.com/Yelp/detect-secrets";
2018-12-26 00:01:00 +01:00
license = licenses.asl20;
maintainers = with maintainers; [ marsam ];
2018-12-26 00:01:00 +01:00
};
}