Unverified Commit cfd4b92f authored by Yueh-Shun Li's avatar Yueh-Shun Li Committed by GitHub
Browse files

buildPython*: restructure in preparation for fixed-point argument support and...

buildPython*: restructure in preparation for fixed-point argument support and `overridePythonAttrs` deprecation (#375921)
parents 06b00550 3678c2ea
Loading
Loading
Loading
Loading
+230 −223
Original line number Diff line number Diff line
@@ -205,6 +205,10 @@ in
  ...
}@attrs:

let
  # Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
  self = stdenv.mkDerivation (
    finalAttrs:
    let
      format' =
        assert (pyproject != null) -> (format == null);
@@ -270,10 +274,7 @@ let

      isSetuptoolsDependency = isSetuptoolsDependency' (attrs.pname or null);

  # Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
  self = toPythonModule (
    stdenv.mkDerivation (
      finalAttrs:
    in
    (cleanAttrs attrs)
    // {

@@ -448,10 +449,16 @@ let
        unittestFlagsArray = attrs.unittestFlagsArray;
      }
    )
    )
  );

in
  # This derivation transformation function must be independent to `attrs`
  # for fixed-point arguments support in the future.
  transformDrv =
    drv:
    extendDerivation (
  disabled -> throw "${name} not supported for interpreter ${python.executable}"
) { } self
      drv.disabled
      -> throw "${lib.removePrefix namePrefix drv.name} not supported for interpreter ${python.executable}"
    ) { } (toPythonModule drv);

in
transformDrv self