Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
4abb280
webmacs: pass custom stdenv to buildPythonApplication with an override
leona-ya Jan 2, 2026
8d063fd
xpra: pass custom stdenv to buildPythonApplication with an override
leona-ya Jan 2, 2026
1127e9d
python3Packages.cupy: pass custom stdenv to buildPythonApplication wi…
leona-ya Jan 2, 2026
00a680d
python3Packages.openusd: remove superfluous stdenv parameter to build…
leona-ya Jan 2, 2026
2bd654f
python3Packages.psutil: remove superfluous stdenv parameter to buildP…
leona-ya Jan 2, 2026
abb6ad9
python3Packages.python-mapnik: remove superfluous stdenv parameter to…
leona-ya Jan 2, 2026
6a673c9
python3Packages.torchaudio: pass custom stdenv to buildPythonApplicat…
leona-ya Jan 2, 2026
8c40583
python3Packages.torchvision: pass custom stdenv to buildPythonApplica…
leona-ya Jan 2, 2026
c34997d
python3Packages.verilogae: pass custom stdenv to buildPythonApplicati…
leona-ya Jan 2, 2026
f8158a6
python3Packages.vllm: pass custom stdenv to buildPythonApplication wi…
leona-ya Jan 2, 2026
70efa53
python3Packages.dlib: pass custom stdenv to buildPythonApplication wi…
leona-ya Jan 2, 2026
5e028cc
python3Packages.llama-cpp-python: pass custom stdenv to buildPythonAp…
leona-ya Jan 2, 2026
5f4c3b6
python3Packages.warp-lang: pass custom stdenv to buildPythonApplicati…
leona-ya Jan 2, 2026
ee013f1
python3Packages.xformers: pass custom stdenv to buildPythonApplicatio…
leona-ya Jan 2, 2026
9667e93
test/overriding: remove python deprecated stdenv override tests
leona-ya Jan 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pkgs/applications/networking/browsers/webmacs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
herbstluftwm,
}:

mkDerivationWith python3Packages.buildPythonApplication rec {
inherit stdenv;

mkDerivationWith (python3Packages.buildPythonApplication.override { inherit stdenv; }) rec {
pname = "webmacs";
version = "0.8";
format = "setuptools";
Expand Down
9 changes: 5 additions & 4 deletions pkgs/by-name/xp/xpra/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
withHtml ? true,
xpra-html5,
udevCheckHook,
}@args:
}:

let
inherit (python3.pkgs) cython buildPythonApplication;
Expand Down Expand Up @@ -86,14 +86,15 @@ let
mkdir -p $out/include $out/lib/pkgconfig
substituteAll ${cudaPackages.libnvjpeg.dev}/share/pkgconfig/nvjpeg.pc $out/lib/pkgconfig/nvjpeg.pc
'';
effectiveBuildPythonApplication = buildPythonApplication.override {
stdenv = if withNvenc then cudaPackages.backendStdenv else stdenv;
};
in
buildPythonApplication rec {
effectiveBuildPythonApplication rec {
pname = "xpra";
version = "6.3.6";
format = "setuptools";

stdenv = if withNvenc then cudaPackages.backendStdenv else args.stdenv;

src = fetchFromGitHub {
owner = "Xpra-org";
repo = "xpra";
Expand Down
4 changes: 1 addition & 3 deletions pkgs/development/python-modules/cupy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,11 @@ let
outpaths ++ lib.concatMap (outpath: lib.map (output: outpath.${output}) outpath.outputs) outpaths;
};
in
buildPythonPackage rec {
buildPythonPackage.override { stdenv = cudaPackages.backendStdenv; } rec {
pname = "cupy";
version = "13.6.0";
pyproject = true;

stdenv = cudaPackages.backendStdenv;

src = fetchFromGitHub {
owner = "cupy";
repo = "cupy";
Expand Down
3 changes: 1 addition & 2 deletions pkgs/development/python-modules/dlib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
more-itertools,
}:

buildPythonPackage {
buildPythonPackage.override { inherit (dlib) stdenv; } {
inherit (dlib)
stdenv
pname
version
src
Expand Down
4 changes: 1 addition & 3 deletions pkgs/development/python-modules/llama-cpp-python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
let
stdenvTarget = if cudaSupport then gcc13Stdenv else stdenv;
in
buildPythonPackage rec {
buildPythonPackage.override { stdenv = stdenvTarget; } rec {
pname = "llama-cpp-python";
version = "0.3.16";
pyproject = true;
Expand Down Expand Up @@ -108,8 +108,6 @@ buildPythonPackage rec {
]
);

stdenv = stdenvTarget;

dependencies = [
diskcache
jinja2
Expand Down
3 changes: 1 addition & 2 deletions pkgs/development/python-modules/openusd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
python,
qt6,
setuptools,
stdenv,
onetbb,
withDocs ? false,
withOsl ? true,
Expand Down Expand Up @@ -61,8 +62,6 @@ buildPythonPackage rec {
hash = "sha256-gxikEC4MqTkhgYaRsCVYtS/VmXClSaCMdzpQ0LmiR7Q=";
};

stdenv = python.stdenv;

outputs = [ "out" ] ++ lib.optional withDocs "doc";

patches = [
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/python-modules/psutil/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ buildPythonPackage rec {
version = "7.1.3";
pyproject = true;

inherit stdenv;

src = fetchFromGitHub {
owner = "giampaolo";
repo = "psutil";
Expand Down
5 changes: 2 additions & 3 deletions pkgs/development/python-modules/python-mapnik/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
replaceVars,
isPyPy,
python,
stdenv,
setuptools,
pillow,
pycairo,
Expand All @@ -27,7 +28,7 @@
pybind11,
}:

buildPythonPackage rec {
buildPythonPackage {
pname = "python-mapnik";
version = "4.1.3.unstable-2025-09-25";
pyproject = true;
Expand All @@ -49,8 +50,6 @@ buildPythonPackage rec {
})
];

stdenv = python.stdenv;

build-system = [ setuptools ];

nativeBuildInputs = [
Expand Down
5 changes: 2 additions & 3 deletions pkgs/development/python-modules/torchaudio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,13 @@ let
else
throw "No GPU targets specified"
);
stdenv = torch.stdenv;
in
buildPythonPackage rec {
buildPythonPackage.override { inherit stdenv; } rec {
pname = "torchaudio";
version = "2.9.1";
pyproject = true;

stdenv = torch.stdenv;

src = fetchFromGitHub {
owner = "pytorch";
repo = "audio";
Expand Down
4 changes: 1 addition & 3 deletions pkgs/development/python-modules/torchvision/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ let
pname = "torchvision";
version = "0.24.1";
in
buildPythonPackage {
buildPythonPackage.override { stdenv = torch.stdenv; } {
format = "setuptools";
inherit pname version;

stdenv = torch.stdenv;

src = fetchFromGitHub {
owner = "pytorch";
repo = "vision";
Expand Down
4 changes: 1 addition & 3 deletions pkgs/development/python-modules/verilogae/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
zlib,
}:

buildPythonPackage rec {
buildPythonPackage.override { stdenv = llvmPackages.stdenv; } rec {
pname = "verilogae";
version = "24.0.0mob-unstable-2025-07-21";
pyproject = true;

stdenv = llvmPackages.stdenv;

src = fetchFromGitHub {
owner = "OpenVAF";
repo = "OpenVAF-Reloaded";
Expand Down
4 changes: 1 addition & 3 deletions pkgs/development/python-modules/vllm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,11 @@ let

in

buildPythonPackage rec {
buildPythonPackage.override { stdenv = torch.stdenv; } rec {
pname = "vllm";
version = "0.13.0";
pyproject = true;

stdenv = torch.stdenv;

src = fetchFromGitHub {
owner = "vllm-project";
repo = "vllm";
Expand Down
4 changes: 1 addition & 3 deletions pkgs/development/python-modules/warp-lang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ let

libmathdx = callPackage ./libmathdx.nix { };
in
buildPythonPackage {
buildPythonPackage.override { stdenv = effectiveStdenv; } {
pname = "warp-lang";
inherit version;
pyproject = true;
Expand All @@ -53,8 +53,6 @@ buildPythonPackage {
# provided by NVCC.
__structuredAttrs = true;

stdenv = effectiveStdenv;

src = fetchFromGitHub {
owner = "NVIDIA";
repo = "warp";
Expand Down
5 changes: 2 additions & 3 deletions pkgs/development/python-modules/xformers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ let
# version 0.0.32.post2 was confirmed to break CUDA.
# Remove this note once the latest published revision "just works".
version = "0.0.30";
effectiveStdenv = if cudaSupport then cudaPackages.backendStdenv else stdenv;
in
buildPythonPackage {
buildPythonPackage.override { stdenv = effectiveStdenv; } {
pname = "xformers";
inherit version;
pyproject = true;
Expand Down Expand Up @@ -66,8 +67,6 @@ buildPythonPackage {
TORCH_CUDA_ARCH_LIST = "${lib.concatStringsSep ";" torch.cudaCapabilities}";
};

stdenv = if cudaSupport then cudaPackages.backendStdenv else stdenv;

buildInputs =
lib.optional stdenv.hostPlatform.isDarwin openmp
++ lib.optionals cudaSupport (
Expand Down
14 changes: 0 additions & 14 deletions pkgs/test/overriding.nix
Original file line number Diff line number Diff line change
Expand Up @@ -446,20 +446,6 @@ let
expr = package-stub-libcxx.stdenv;
expected = pkgs.libcxxStdenv;
};
overridePythonAttrs-stdenv-deprecated = {
expr =
(package-stub.overridePythonAttrs (_: {
stdenv = pkgs.clangStdenv;
})).stdenv;
expected = pkgs.clangStdenv;
};
overridePythonAttrs-override-clangStdenv-deprecated-nested = {
expr =
(package-stub-gcc.overridePythonAttrs {
stdenv = pkgs.clangStdenv;
}).stdenv;
expected = pkgs.clangStdenv;
};
Comment on lines -449 to -462
Copy link
Contributor

@MattSturgeon MattSturgeon Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, I'd like to have a test that asserts the override still works and asserts the warning is printed. I don't think that's possible with the current overriding.nix.

I think we'd need to come up with something that evaluates test cases within a test derivation (similar to CI's eval or lib's lib/tests/test-with-nix.nix and ), that way we can capture the eval's stderr and make assertions on its content.

This is too complex to be in scope for this PR, and maybe too complex to be worth it for these two test cases. But maybe it'd be useful to have a way to implement more complex pkgs tests, like we already have for lib tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't really know a way how this would be done easily. Also yes, probably out of scope here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. If #477208 or another PR has a solution, it can revert this commit or introduce a new equivalent test. I don't want to block this PR by waiting for a solution.


overridePythonAttrs = {
expr = (applyOverridePythonAttrs package-stub).overridePythonAttrsFlag;
Expand Down
Loading