summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/torchtnt/default.nix
blob: 0b1520d50e95ae517b3d1bffb8970f81b652838f (plain)
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
{
  lib,
  buildPythonPackage,
  fetchPypi,

  # build-system
  setuptools,

  # dependencies
  fsspec,
  numpy,
  packaging,
  psutil,
  pyre-extensions,
  tabulate,
  tensorboard,
  torch,
  tqdm,
  typing-extensions,
}:

buildPythonPackage rec {
  pname = "torchtnt";
  version = "0.2.4";
  pyproject = true;

  # no tag / releases on github
  src = fetchPypi {
    inherit pname version;
    hash = "sha256-Js9OcYllr8KT52FYtHKDciBVvPeelNDmfnC12/YcDJs=";
  };

  # requirements.txt is not included in Pypi archive
  postPatch = ''
    substituteInPlace setup.py \
      --replace-fail 'read_requirements("requirements.txt")' "[]" \
      --replace-fail 'read_requirements("dev-requirements.txt")' "[]"
  '';

  build-system = [
    setuptools
  ];

  dependencies = [
    fsspec
    numpy
    packaging
    psutil
    pyre-extensions
    setuptools
    tabulate
    tensorboard
    torch
    tqdm
    typing-extensions
  ];

  pythonImportsCheck = [
    "torchtnt"
  ];

  # Tests are not included in Pypi archive
  doCheck = false;

  meta = {
    description = "Lightweight library for PyTorch training tools and utilities";
    homepage = "https://github.com/pytorch/tnt";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ nim65s ];
  };
}