2018-12-25 23:01:00 +00:00
|
|
|
{ lib, buildPythonApplication, fetchFromGitHub, isPy27, pyyaml, unidiff, configparser, enum34, future, functools32, mock, pytest }:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "detect-secrets";
|
2019-06-09 10:20:00 +01:00
|
|
|
version = "0.12.4";
|
2018-12-25 23:01:00 +00:00
|
|
|
|
|
|
|
# PyPI tarball doesn't ship tests
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Yelp";
|
|
|
|
repo = "detect-secrets";
|
|
|
|
rev = "v${version}";
|
2019-06-09 10:20:00 +01:00
|
|
|
sha256 = "01y5xd0irxxib4wnf5834gwa7ibb81h5y4dl8b26gyzgvm5zfpk1";
|
2018-12-25 23:01:00 +00:00
|
|
|
};
|
|
|
|
|
2019-01-13 21:31:10 +00:00
|
|
|
propagatedBuildInputs = [ pyyaml ]
|
2018-12-25 23:01:00 +00:00
|
|
|
++ lib.optionals isPy27 [ configparser enum34 future functools32 ];
|
|
|
|
|
2019-01-13 21:31:10 +00:00
|
|
|
checkInputs = [ mock pytest unidiff ];
|
2018-12-25 23:01:00 +00:00
|
|
|
|
|
|
|
# deselect tests which require git setup
|
|
|
|
checkPhase = ''
|
|
|
|
PYTHONPATH=$PWD:$PYTHONPATH pytest \
|
|
|
|
--deselect tests/main_test.py::TestMain \
|
|
|
|
--deselect tests/pre_commit_hook_test.py::TestPreCommitHook \
|
|
|
|
--deselect tests/core/baseline_test.py::TestInitializeBaseline
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "An enterprise friendly way of detecting and preventing secrets in code";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/Yelp/detect-secrets";
|
2018-12-25 23:01:00 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.marsam ];
|
|
|
|
};
|
|
|
|
}
|