about summary refs log tree commit diff
path: root/pkgs/development/python-modules/treex/default.nix
blob: cc98867484a66b28e28305d0b9424d49970a85f5 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
  buildPythonPackage,
  cloudpickle,
  dm-haiku,
  einops,
  fetchFromGitHub,
  flax,
  hypothesis,
  jaxlib,
  keras,
  lib,
  poetry-core,
  pytestCheckHook,
  pyyaml,
  rich,
  tensorflow,
  treeo,
  torchmetrics,
  torch,
}:

buildPythonPackage rec {
  pname = "treex";
  version = "0.6.11";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "cgarciae";
    repo = pname;
    rev = "refs/tags/${version}";
    hash = "sha256-ObOnbtAT4SlrwOms1jtn7/XKZorGISGY6VuhQlC3DaQ=";
  };

  # At the time of writing (2022-03-29), rich is currently at version 11.0.0.
  # The treeo dependency is compatible with a patch, but not marked as such in
  # treex. See https://github.com/cgarciae/treex/issues/68.
  pythonRelaxDeps = [
    "certifi"
    "flax"
    "rich"
    "treeo"
  ];

  nativeBuildInputs = [
    poetry-core
  ];

  buildInputs = [ jaxlib ];

  propagatedBuildInputs = [
    einops
    flax
    pyyaml
    rich
    treeo
    torch
  ];

  nativeCheckInputs = [
    cloudpickle
    dm-haiku
    hypothesis
    keras
    pytestCheckHook
    tensorflow
    torchmetrics
  ];

  pythonImportsCheck = [ "treex" ];

  meta = with lib; {
    description = "Pytree Module system for Deep Learning in JAX";
    homepage = "https://github.com/cgarciae/treex";
    license = licenses.mit;
    maintainers = with maintainers; [ ndl ];
  };
}