1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, numpy
5, pytestCheckHook
6, pythonOlder
7, scipy
8, sparse
9}:
10
11buildPythonPackage rec {
12 pname = "tensorly";
13 version = "0.7.0";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = pname;
20 repo = pname;
21 rev = version;
22 sha256 = "sha256-VcX3pCczZQUYZaD7xrrkOcj0QPJt28cYTwpZm5D/X3c=";
23 };
24
25 propagatedBuildInputs = [
26 numpy
27 scipy
28 sparse
29 ];
30
31 checkInputs = [
32 pytestCheckHook
33 ];
34
35 postPatch = ''
36 # nose is not actually required for anything
37 # (including testing with the minimal dependencies)
38 substituteInPlace setup.py \
39 --replace ", 'nose'" ""
40 '';
41
42 pythonImportsCheck = [
43 "tensorly"
44 ];
45
46 pytestFlagsArray = [
47 "tensorly"
48 ];
49
50 disabledTests = [
51 # AssertionError: Partial_SVD took too long, maybe full_matrices set wrongly
52 "test_svd_time"
53 ];
54
55 meta = with lib; {
56 description = "Tensor learning in Python";
57 homepage = "https://tensorly.org/";
58 license = licenses.bsd3;
59 maintainers = with maintainers; [ bcdarwin ];
60 };
61}