summary refs log tree commit diff
path: root/pkgs/development/tools/poetry/default.nix
blob: ac2ab258df47084a044629e73c431378fb7a3227 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ lib, poetry2nix, python, fetchFromGitHub, runtimeShell }:


poetry2nix.mkPoetryApplication {

  inherit python;

  pyproject = ./pyproject.toml;
  poetrylock = ./poetry.lock;

  src = fetchFromGitHub (lib.importJSON ./src.json);

  # "Vendor" dependencies (for build-system support)
  postPatch = ''
    for path in ''${PYTHONPATH//:/ }; do
      echo "sys.path.insert(0, \"$path\")" >> poetry/__init__.py
    done
  '';

  # Propagating dependencies leads to issues downstream
  # We've already patched poetry to prefer "vendored" dependencies
  postFixup = ''
    rm $out/nix-support/propagated-build-inputs
  '';

  # Fails because of impurities (network, git etc etc)
  doCheck = false;

  meta = with lib; {
    platforms = platforms.all;
    maintainers = with maintainers; [ adisbladis jakewaksbaum ];
  };
}