2021-09-22 15:38:15 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchFromGitHub
|
2023-01-20 10:41:00 +00:00
|
|
|
, hatchling
|
2023-11-16 04:20:00 +00:00
|
|
|
, jupyter
|
2022-06-16 17:23:12 +00:00
|
|
|
, nbconvert
|
|
|
|
, numpy
|
|
|
|
, parameterized
|
2023-11-16 04:20:00 +00:00
|
|
|
, pillow
|
2022-06-16 17:23:12 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2021-09-22 15:38:15 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "einops";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.8.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-09-22 15:38:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "arogozhnikov";
|
|
|
|
repo = pname;
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-6x9AttvSvgYrHaS5ESKOwyEnXxD2BitYTGtqqSKur+0=";
|
2021-09-22 15:38:15 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
nativeBuildInputs = [ hatchling ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-11-16 04:20:00 +00:00
|
|
|
jupyter
|
2022-06-16 17:23:12 +00:00
|
|
|
nbconvert
|
2021-09-22 15:38:15 +00:00
|
|
|
numpy
|
2022-04-03 18:54:34 +00:00
|
|
|
parameterized
|
2023-11-16 04:20:00 +00:00
|
|
|
pillow
|
2022-06-16 17:23:12 +00:00
|
|
|
pytestCheckHook
|
2021-09-22 15:38:15 +00:00
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
env.EINOPS_TEST_BACKENDS = "numpy";
|
2021-09-22 15:38:15 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
|
|
|
'';
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"einops"
|
|
|
|
];
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Tests are failing as mxnet is not pulled-in
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/174872
|
|
|
|
"test_all_notebooks"
|
|
|
|
"test_dl_notebook_with_all_backends"
|
|
|
|
"test_backends_installed"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/test_layers.py"
|
|
|
|
];
|
2021-09-22 15:38:15 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
meta = with lib; {
|
2021-09-22 15:38:15 +00:00
|
|
|
description = "Flexible and powerful tensor operations for readable and reliable code";
|
|
|
|
homepage = "https://github.com/arogozhnikov/einops";
|
2022-06-16 17:23:12 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ yl3dy ];
|
2021-09-22 15:38:15 +00:00
|
|
|
};
|
|
|
|
}
|
2022-06-16 17:23:12 +00:00
|
|
|
|