mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-30 17:49:58 +03:00
pdm: install shell completion
This commit is contained in:
parent
cf59adeb8c
commit
deed69c590
@ -6,6 +6,9 @@
|
||||
, fetchPypi
|
||||
, nix-update-script
|
||||
, runtimeShell
|
||||
, installShellFiles
|
||||
, testers
|
||||
, pdm
|
||||
}:
|
||||
let
|
||||
python = python3.override {
|
||||
@ -44,6 +47,7 @@ buildPythonApplication rec {
|
||||
|
||||
nativeBuildInputs = [
|
||||
pdm-backend
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
@ -76,6 +80,23 @@ buildPythonApplication rec {
|
||||
truststore
|
||||
];
|
||||
|
||||
makeWrapperArgs = [
|
||||
"--set PDM_CHECK_UPDATE 0"
|
||||
];
|
||||
|
||||
preInstall = ''
|
||||
# Silence network warning during pypaInstallPhase
|
||||
# by disabling latest version check
|
||||
export PDM_CHECK_UPDATE=0
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
installShellCompletion --cmd pdm \
|
||||
--bash <($out/bin/pdm completion bash) \
|
||||
--fish <($out/bin/pdm completion fish) \
|
||||
--zsh <($out/bin/pdm completion zsh)
|
||||
'';
|
||||
|
||||
nativeCheckInputs = [
|
||||
pytestCheckHook
|
||||
pytest-mock
|
||||
@ -91,7 +112,7 @@ buildPythonApplication rec {
|
||||
preCheck = ''
|
||||
export HOME=$TMPDIR
|
||||
substituteInPlace tests/cli/test_run.py \
|
||||
--replace "/bin/bash" "${runtimeShell}"
|
||||
--replace-warn "/bin/bash" "${runtimeShell}"
|
||||
'';
|
||||
|
||||
disabledTests = [
|
||||
@ -104,6 +125,10 @@ buildPythonApplication rec {
|
||||
|
||||
__darwinAllowLocalNetworking = true;
|
||||
|
||||
passthru.tests.version = testers.testVersion {
|
||||
package = pdm;
|
||||
};
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = with lib; {
|
||||
|
Loading…
Reference in New Issue
Block a user