From 23669eccf2d553d985b206ffb195ab6bff321d77 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Mon, 21 Oct 2024 10:25:50 +0800 Subject: [PATCH 1/3] rl-2411.section.md: update to inform the removal of (buildPythonPackage { ... }).overrideDerivation Clean up the leftover of commit 58bfe7412308 ("buildPython*: Deprecate and remove (buildPython* { ... }).override") (cherry picked from commit b4e9f423f494dce9f506916cea13c885ae92e595) --- nixos/doc/manual/release-notes/rl-2411.section.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index 6fce4f2a04dc..0256e07ca436 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -213,8 +213,9 @@ - The NVIDIA driver no longer defaults to the proprietary kernel module with versions >= 560. You will need to manually set `hardware.nvidia.open` to select the proprietary or open modules. -- The `(buildPythonPackage { ... }).override` attribute is now deprecated and removed in favour of `overridePythonAttrs`. +- The `(buildPythonPackage { ... }).override` and `(buildPythonPackage { ... }).overrideDerivation` attributes is now deprecated and removed in favour of `overridePythonAttrs` and `lib.overrideDerivation`. This change does not affect the override interface of most Python packages, as [`.override`](https://nixos.org/manual/nixpkgs/unstable/#sec-pkg-override) provided by `callPackage` shadows such a locally-defined `override` attribute. + The `.overrideDerivation` attribute of Python packages called with `callPackage` will also remain available after this change. - All Cinnamon and XApp packages have been moved to top-level (i.e., `cinnamon.nemo` is now `nemo`). From 5e26356aa33af2ae726bdc9ebd4a60c5119943ff Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Mon, 21 Oct 2024 10:15:20 +0800 Subject: [PATCH 2/3] python3Packages.pythonCatchConflictsHook: fix tests with lib.overrideDerivation Use lib.overrideDerivation instead of .overrideDerivation to fix the evaluation of python3Packages.pythonCatchConflictsHook.tests.catches-conflict-multiple-chains, as buildPythonPackage and buildPythonApplication no longer provide .overrideDerivation Clean up the leftover of commit 58bfe7412308 ("buildPython*: Deprecate and remove (buildPython* { ... }).override") (cherry picked from commit 3e8d53b9e8eebdbe1a33e9e8e76522ca3e2aa07e) --- pkgs/development/interpreters/python/hooks/default.nix | 1 + .../python/hooks/python-catch-conflicts-hook-tests.nix | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix index ca70d452c808..b4f7ca9cd837 100644 --- a/pkgs/development/interpreters/python/hooks/default.nix +++ b/pkgs/development/interpreters/python/hooks/default.nix @@ -122,6 +122,7 @@ in { }; passthru.tests = import ./python-catch-conflicts-hook-tests.nix { inherit pythonOnBuildForHost runCommand; + inherit lib; inherit (pkgs) coreutils gnugrep writeShellScript; }; } ./python-catch-conflicts-hook.sh) {}; diff --git a/pkgs/development/interpreters/python/hooks/python-catch-conflicts-hook-tests.nix b/pkgs/development/interpreters/python/hooks/python-catch-conflicts-hook-tests.nix index 3890df40cb74..2a77ef015015 100644 --- a/pkgs/development/interpreters/python/hooks/python-catch-conflicts-hook-tests.nix +++ b/pkgs/development/interpreters/python/hooks/python-catch-conflicts-hook-tests.nix @@ -1,4 +1,4 @@ -{ pythonOnBuildForHost, runCommand, writeShellScript, coreutils, gnugrep }: let +{ lib, pythonOnBuildForHost, runCommand, writeShellScript, coreutils, gnugrep }: let pythonPkgs = pythonOnBuildForHost.pkgs; @@ -38,7 +38,7 @@ ); # in order to test for a failing build, wrap it in a shell script - expectFailure = build: errorMsg: build.overrideDerivation (old: { + expectFailure = build: errorMsg: lib.overrideDerivation build (old: { builder = writeShellScript "test-for-failure" '' export PATH=${coreutils}/bin:${gnugrep}/bin:$PATH ${old.builder} "$@" > ./log 2>&1 From ba7101ffe856f58b79d1bc2c45f68d28e2f51b68 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Tue, 22 Oct 2024 14:25:51 +0800 Subject: [PATCH 3/3] python3Packages.scikit-image: fix tests with overridePythonAttrs buildPythonPackage no longer provide local .override attribute. Use overridePythonAttrs instead. (cherry picked from commit 38e77220352ec445632cc862fd8987cbefa75225) --- pkgs/development/python-modules/scikit-image/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/scikit-image/default.nix b/pkgs/development/python-modules/scikit-image/default.nix index b04e02faa6e3..93738259f2f8 100644 --- a/pkgs/development/python-modules/scikit-image/default.nix +++ b/pkgs/development/python-modules/scikit-image/default.nix @@ -157,7 +157,7 @@ let ]; passthru.tests = { - all-tests = self.override { doCheck = true; }; + all-tests = self.overridePythonAttrs { doCheck = true; }; }; meta = {