summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/einops/default.nix
blob: 84ac540577c986d2300f29185fd6985647646d09 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  hatchling,
  jupyter,
  nbconvert,
  numpy,
  parameterized,
  pillow,
  pytestCheckHook,
  writableTmpDirAsHomeHook,
  torch,
}:

buildPythonPackage rec {
  pname = "einops";
  version = "0.8.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "arogozhnikov";
    repo = "einops";
    tag = "v${version}";
    hash = "sha256-J9m5LMOleHf2UziUbOtwf+DFpu/wBDcAyHUor4kqrR8=";
  };

  build-system = [ hatchling ];

  nativeCheckInputs = [
    writableTmpDirAsHomeHook
    jupyter
    nbconvert
    numpy
    parameterized
    pillow
    pytestCheckHook
    torch
  ];

  env.EINOPS_TEST_BACKENDS = "numpy";

  pythonImportsCheck = [ "einops" ];

  disabledTestPaths = [
    # skip folder with notebook samples that depend on large packages
    # or accelerator access and have been unreliable
    "scripts/"
  ];

  __darwinAllowLocalNetworking = true;

  meta = {
    changelog = "https://github.com/arogozhnikov/einops/releases/tag/${src.tag}";
    description = "Flexible and powerful tensor operations for readable and reliable code";
    homepage = "https://github.com/arogozhnikov/einops";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ yl3dy ];
  };
}