Unverified Commit e5b4f3fb authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #288460 from maxbrunet/feat/pdm/shell-completion

parents f96df2b3 deed69c5
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -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; {