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