1{ lib
2, buildPythonPackage
3, chainer
4, fetchFromGitHub
5, jupyter
6, keras
7 #, mxnet
8, nbconvert
9, nbformat
10, nose
11, numpy
12, parameterized
13, pytestCheckHook
14, pythonOlder
15}:
16
17buildPythonPackage rec {
18 pname = "einops";
19 version = "0.4.1";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "arogozhnikov";
26 repo = pname;
27 rev = "v${version}";
28 hash = "sha256-n4R4lcRimuOncisCTs2zJWPlqZ+W2yPkvkWAnx4R91s=";
29 };
30
31 checkInputs = [
32 chainer
33 jupyter
34 keras
35 # mxnet (has issues with some CPUs, segfault)
36 nbconvert
37 nbformat
38 nose
39 numpy
40 parameterized
41 pytestCheckHook
42 ];
43
44 # No CUDA in sandbox
45 EINOPS_SKIP_CUPY = 1;
46
47 preCheck = ''
48 export HOME=$(mktemp -d);
49 '';
50
51 pythonImportsCheck = [
52 "einops"
53 ];
54
55 disabledTests = [
56 # Tests are failing as mxnet is not pulled-in
57 # https://github.com/NixOS/nixpkgs/issues/174872
58 "test_all_notebooks"
59 "test_dl_notebook_with_all_backends"
60 "test_backends_installed"
61 ];
62
63 disabledTestPaths = [
64 "tests/test_layers.py"
65 ];
66
67 meta = with lib; {
68 description = "Flexible and powerful tensor operations for readable and reliable code";
69 homepage = "https://github.com/arogozhnikov/einops";
70 license = licenses.mit;
71 maintainers = with maintainers; [ yl3dy ];
72 };
73}
74