Unverified Commit a09378c0 authored by dotlambda's avatar dotlambda Committed by GitHub
Browse files

treewide: use lib.concatAttrValues to obtain all optional-dependencies (#465847)

parents ec69ac12 82c4e4f1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -303,6 +303,7 @@ let
        elem
        elemAt
        isList
        concatAttrValues
        ;
      inherit (self.strings)
        concatStrings
+23 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ let
    id
    warn
    ;
  inherit (lib.attrsets) mapAttrs attrNames;
  inherit (lib.attrsets) mapAttrs attrNames attrValues;
  inherit (lib) max;
in
rec {
@@ -1997,4 +1997,26 @@ rec {
  */
  mutuallyExclusive = a: b: length a == 0 || !(any (x: elem x a) b);

  /**
    Concatenate all attributes of an attribute set.
    This assumes that every attribute of the set is a list.

    # Inputs

    `set`

    : Attribute set with attributes that are lists

    # Examples
    :::{.example}
    ## `lib.concatAttrValues` usage example

    ```nix
    concatAttrValues { a = [ 1 2 ]; b = [ 3 ]; }
    => [ 1 2 3 ]
    ```

    :::
  */
  concatAttrValues = set: concatLists (attrValues set);
}
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ python3Packages.buildPythonApplication rec {
      pytest-aiohttp
      pytestCheckHook
    ]
    ++ lib.flatten (lib.attrValues optional-dependencies);
    ++ lib.concatAttrValues optional-dependencies;

  nativeBuildInputs = lib.optionals enableDbusUi [
    wrapGAppsHook3
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ pythonPackages.buildPythonApplication rec {
      gst-python
      opencv4
    ]
    ++ lib.flatten (builtins.attrValues optional-dependencies);
    ++ lib.concatAttrValues optional-dependencies;

  optional-dependencies = with pythonPackages; {
    speech-to-text = [
+1 −1
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ python3Packages.buildPythonApplication rec {
    "unidecode"
  ];

  nativeCheckInputs = lib.flatten (lib.attrValues optional-dependencies);
  nativeCheckInputs = lib.concatAttrValues optional-dependencies;

  pythonImportsCheck = [ "calibreweb" ];

Loading