From 47565ce057453622280bcdabf93e6252937cf6f9 Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Thu, 16 Jul 2026 15:39:31 +0100 Subject: [PATCH] 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