1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 fsspec,
11 numpy,
12 packaging,
13 psutil,
14 pyre-extensions,
15 tabulate,
16 tensorboard,
17 torch,
18 tqdm,
19 typing-extensions,
20}:
21
22buildPythonPackage rec {
23 pname = "torchtnt";
24 version = "0.2.4";
25 pyproject = true;
26
27 # no tag / releases on github
28 src = fetchPypi {
29 inherit pname version;
30 hash = "sha256-Js9OcYllr8KT52FYtHKDciBVvPeelNDmfnC12/YcDJs=";
31 };
32
33 # requirements.txt is not included in Pypi archive
34 postPatch = ''
35 substituteInPlace setup.py \
36 --replace-fail 'read_requirements("requirements.txt")' "[]" \
37 --replace-fail 'read_requirements("dev-requirements.txt")' "[]"
38 '';
39
40 build-system = [
41 setuptools
42 ];
43
44 dependencies = [
45 fsspec
46 numpy
47 packaging
48 psutil
49 pyre-extensions
50 setuptools
51 tabulate
52 tensorboard
53 torch
54 tqdm
55 typing-extensions
56 ];
57
58 pythonImportsCheck = [
59 "torchtnt"
60 ];
61
62 # Tests are not included in Pypi archive
63 doCheck = false;
64
65 meta = {
66 description = "Lightweight library for PyTorch training tools and utilities";
67 homepage = "https://github.com/pytorch/tnt";
68 license = lib.licenses.bsd3;
69 maintainers = with lib.maintainers; [ nim65s ];
70 };
71}