From 47565ce057453622280bcdabf93e6252937cf6f9 Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Thu, 16 Jul 2026 15:39:31 +0100 Subject: [PATCH 1/2] python3Packages.detect-secrets: separate optional dependencies This provides the means to install `detect-secrets` without the optional dependencies that have thus far been installed by default. These continue to be installed by default in order to not break any existing usage. --- .../python-modules/detect-secrets/default.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/detect-secrets/default.nix b/pkgs/development/python-modules/detect-secrets/default.nix index c4e5d6f7a439..9872a632efc0 100644 --- a/pkgs/development/python-modules/detect-secrets/default.nix +++ b/pkgs/development/python-modules/detect-secrets/default.nix @@ -13,6 +13,8 @@ setuptools, unidiff, writableTmpDirAsHomeHook, + withGibberish ? true, + withWordList ? true, }: buildPythonPackage rec { @@ -31,11 +33,20 @@ buildPythonPackage rec { build-system = [ setuptools ]; dependencies = [ - gibberish-detector pyyaml - pyahocorasick requests - ]; + ] + ++ lib.optionals withGibberish optional-dependencies.gibberish + ++ lib.optionals withWordList optional-dependencies.word_list; + + optional-dependencies = { + gibberish = [ + gibberish-detector + ]; + word_list = [ + pyahocorasick + ]; + }; nativeCheckInputs = [ mock From 919ebdeb330cd7c04b73a420887f4a7054514ee9 Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Thu, 16 Jul 2026 15:56:04 +0100 Subject: [PATCH 2/2] python3Packages.detect-secrets: re-enable tests which now pass --- pkgs/development/python-modules/detect-secrets/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/development/python-modules/detect-secrets/default.nix b/pkgs/development/python-modules/detect-secrets/default.nix index 9872a632efc0..2b5e7229b48e 100644 --- a/pkgs/development/python-modules/detect-secrets/default.nix +++ b/pkgs/development/python-modules/detect-secrets/default.nix @@ -62,11 +62,8 @@ buildPythonPackage rec { "test_basic" "test_handles_each_path_separately" "test_handles_multiple_directories" - "test_load_and_output" "test_make_decisions" - "test_restores_line_numbers" "test_saves_to_baseline" - "test_scan_all_files" "test_start_halfway" ];