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.
This commit is contained in:
Ben Brown
2026-07-16 15:39:31 +01:00
parent 6cba6003a1
commit 47565ce057

View File

@@ -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