Commit 0aebd262 authored by Yueh-Shun Li's avatar Yueh-Shun Li
Browse files

python3Packages.buildPythonPackage: add internal helper getFinalPassthru

Add getFinalPassthru, an internal helper function that
produces informative error message
when an atttribute is not found in `finalAttrs.passthru`.
parent ca40fe77
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -204,6 +204,20 @@ let
  self = stdenv.mkDerivation (
    finalAttrs:
    let
      getFinalPassthru =
        let
          pos = unsafeGetAttrPos "passthru" finalAttrs;
        in
        attrName:
        finalAttrs.passthru.${attrName} or (throw (
          ''
            ${finalAttrs.name}: passthru.${attrName} missing after overrideAttrs overriding.
          ''
          + optionalString (pos != null) ''
            Last overridden at ${pos.file}:${toString pos.line}
          ''
        ));

      format' =
        assert (pyproject != null) -> (format == null);
        if pyproject != null then