@@ -0,0 +1,34 @@
1+{ lib, buildPythonApplication, fetchFromGitHub, isPy27, pyyaml, unidiff, configparser, enum34, future, functools32, mock, pytest }:
2+
3+buildPythonApplication rec {
4+ pname = "detect-secrets";
5+ version = "0.11.0";
6+
7+ # PyPI tarball doesn't ship tests
8+ src = fetchFromGitHub {
9+ owner = "Yelp";
10+ repo = "detect-secrets";
11+ rev = "v${version}";
12+ sha256 = "11r11q6d8aajqqnhhz4lsa93qf1x745331kl9jd3z4y4w91l4gdz";
13+ };
14+
15+ propagatedBuildInputs = [ pyyaml unidiff ]
16+ ++ lib.optionals isPy27 [ configparser enum34 future functools32 ];
17+
18+ checkInputs = [ mock pytest ];
19+
20+ # deselect tests which require git setup
21+ checkPhase = ''
22+ PYTHONPATH=$PWD:$PYTHONPATH pytest \
23+ --deselect tests/main_test.py::TestMain \
24+ --deselect tests/pre_commit_hook_test.py::TestPreCommitHook \
25+ --deselect tests/core/baseline_test.py::TestInitializeBaseline
26+ '';
27+
28+ meta = with lib; {
29+ description = "An enterprise friendly way of detecting and preventing secrets in code";
30+ homepage = https://github.com/Yelp/detect-secrets;
31+ license = licenses.asl20;
32+ maintainers = [ maintainers.marsam ];
33+ };
34+}