From e0c6fb80a36f66a2254188b662f21c80011ba28f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 13 Mar 2023 23:40:12 +0100 Subject: [PATCH] python310Packages.bc-detect-secrets: init at 1.4.14 --- .../bc-detect-secrets/default.nix | 80 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 82 insertions(+) create mode 100644 pkgs/development/python-modules/bc-detect-secrets/default.nix diff --git a/pkgs/development/python-modules/bc-detect-secrets/default.nix b/pkgs/development/python-modules/bc-detect-secrets/default.nix new file mode 100644 index 000000000000..8efa3f375a61 --- /dev/null +++ b/pkgs/development/python-modules/bc-detect-secrets/default.nix @@ -0,0 +1,80 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, gibberish-detector +, mock +, pkgs +, pyahocorasick +, pytestCheckHook +, pythonOlder +, pyyaml +, requests +, responses +, unidiff +}: + +buildPythonPackage rec { + pname = "bc-detect-secrets"; + version = "1.4.14"; + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "bridgecrewio"; + repo = "detect-secrets"; + rev = "refs/tags/${version}"; + hash = "sha256-WgUbVpn5KoayiWv3sYp+hZxqfQg73k0pXkxgUK8wrPg="; + }; + + propagatedBuildInputs = [ + pyyaml + requests + unidiff + ]; + + passthru.optional-dependencies = { + word_list = [ + pyahocorasick + ]; + gibberish = [ + gibberish-detector + ]; + }; + + nativeCheckInputs = [ + mock + pkgs.gitMinimal + pytestCheckHook + responses + ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); + + preCheck = '' + export HOME=$(mktemp -d); + ''; + + disabledTests = [ + # Tests are failing for various reasons (missing git repo, missing test data, etc.) + "test_baseline_filters_out_known_secrets" + "test_make_decisions" + "test_saves_to_baseline" + "test_start_halfway" + "TestCreate" + "TestDiff" + "TestGetFilesToScan" + "TestLineNumberChanges" + "TestModifiesBaselineFromVersionChange" + ]; + + pythonImportsCheck = [ + "detect_secrets" + ]; + + meta = with lib; { + description = "Tool to detect secrets in the code"; + homepage = "https://github.com/bridgecrewio/detect-secrets"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} + diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6347b20e730c..9a66218e17f4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1209,6 +1209,8 @@ self: super: with self; { bbox = callPackage ../development/python-modules/bbox { }; + bc-detect-secrets = callPackage ../development/python-modules/bc-detect-secrets { }; + bc-python-hcl2 = callPackage ../development/python-modules/bc-python-hcl2 { }; bcdoc = callPackage ../development/python-modules/bcdoc { };