python3Packages.pip: fix shell completions on cross (#567774)

This commit is contained in:
Martin Weinelt
2026-09-28 10:28:08 +00:00
committed by GitHub

View File

@@ -2,11 +2,13 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
# build-system
flit-core,
installShellFiles,
stdenv,
buildPackages,
python,
# docs
sphinx,
@@ -104,14 +106,19 @@ let
werkzeug
];
postInstall = ''
installManPage docs/build/man/*
installShellCompletion --cmd pip \
--bash <($out/bin/pip completion --bash --no-cache-dir) \
--fish <($out/bin/pip completion --fish --no-cache-dir) \
--zsh <($out/bin/pip completion --zsh --no-cache-dir)
'';
postInstall =
let
emulator = stdenv.hostPlatform.emulator buildPackages;
in
''
installManPage docs/build/man/*
''
+ lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ''
installShellCompletion --cmd pip \
--bash <(${emulator} ${python.interpreter} $out/bin/pip completion --bash --no-cache-dir) \
--fish <(${emulator} ${python.interpreter} $out/bin/pip completion --fish --no-cache-dir) \
--zsh <(${emulator} ${python.interpreter} $out/bin/pip completion --zsh --no-cache-dir)
'';
passthru.tests = {
inherit pip-tools;