Unverified Commit dda59c96 authored by Emily's avatar Emily Committed by GitHub
Browse files

python3Packages: transition from pytestFlagsArray (round 3) and ban pytestFlagsArray (#513772)

parents b7c27844 82da9cf4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -168,6 +168,10 @@

- the `xorg` package set has been deprecated, packages have moved to the top level.

- `python3Packages.buildPythonPackage` and `python3Packages.buildPythonApplication` now throw errors in the presence of `pytestFlagsArray`.
  Please use [`pytestFlags` and `(enabled|disabled)(TestPaths|Tests|TestMarks)`](#using-pytestcheckhook) instead.
  If modifying the Nix expression is not feasible, users can remediate the error by overriding `pytestFlagsArray` with `null` or `[ ]`.

- `python3Packages.pygame` has been been renamed to `python3Packages.pygame-original`, the attribute `python3Packages.pygame` will from python 3.14 default to the more actively maintained `python3Packages.pygame-ce`

- `fastly` has been updated to major version 14. For more information, you can check the [release notes](https://github.com/fastly/cli/releases/tag/v14.0.0)
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ python3.pkgs.buildPythonApplication (finalAttrs: {
    python3.pkgs.pytestCheckHook
  ];

  pytestFlagsArray = [
  pytestFlags = [
    # Nixpkgs' default is `--capture=fd`, and with it, 2 command mock tests
    # fail, see: https://github.com/lucc/khard/issues/353
    "--capture=no"
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ python3Packages.buildPythonApplication (finalAttrs: {
    pytestCheckHook
  ];

  pytestFlagsArray = [
  enabledTestPaths = [
    "openfreebuds/driver/huawei/test/"
    "openfreebuds/test/test_event_bus.py"
  ];
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ python3Packages.buildPythonApplication (finalAttrs: {

  # Run subset of tests that don't require YubiKey hardware
  doCheck = true;
  pytestFlagsArray = [
  enabledTestPaths = [
    "tests"
  ];

+16 −0
Original line number Diff line number Diff line
@@ -112,6 +112,9 @@ lib.extendMkDerivation {
    "dependencies"
    "optional-dependencies"
    "build-system"

    # Deprecated arguments
    "pytestFlagsArray"
  ];

  extendDrvArgs =
@@ -439,6 +442,19 @@ lib.extendMkDerivation {
      # Longer-term we should get rid of `checkPhase` and use `installCheckPhase`.
      installCheckPhase = attrs.checkPhase;
    }
    // (
      let
        deprecatedFlagNotEmpty =
          attrs ? pytestFlagsArray && attrs.pytestFlagsArray != null && attrs.pytestFlagsArray != [ ];
        pos = builtins.unsafeGetAttrPos "pytestFlagsArray" attrs;
      in
      {
        ${if deprecatedFlagNotEmpty then "pytestFlagsArray" else null} = throw ''
          buildPythonPackage: Deprecated flag pytestFlagsArray found at ${pos.file}:${toString pos.line}
            Use pytestFlags or (enabled|disabled)(TestPaths|Tests|TestMarks) instead.
        '';
      }
    )
    //
      lib.mapAttrs
        (
Loading