nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, buildPythonApplication, fetchFromGitHub, isPy27, pyyaml, unidiff, configparser, enum34, future, functools32, mock, pytest }:
2
3buildPythonApplication rec {
4 pname = "detect-secrets";
5 version = "0.12.4";
6
7 # PyPI tarball doesn't ship tests
8 src = fetchFromGitHub {
9 owner = "Yelp";
10 repo = "detect-secrets";
11 rev = "v${version}";
12 sha256 = "01y5xd0irxxib4wnf5834gwa7ibb81h5y4dl8b26gyzgvm5zfpk1";
13 };
14
15 propagatedBuildInputs = [ pyyaml ]
16 ++ lib.optionals isPy27 [ configparser enum34 future functools32 ];
17
18 checkInputs = [ mock pytest unidiff ];
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}