2022-01-13 20:06:32 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2024-01-13 08:15:51 +00:00
|
|
|
, fetchpatch
|
2022-01-13 20:06:32 +00:00
|
|
|
, fetchPypi
|
2024-01-13 08:15:51 +00:00
|
|
|
, setuptools
|
2022-01-13 20:06:32 +00:00
|
|
|
, numpy
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2020-08-20 17:08:02 +00:00
|
|
|
version = "3.3.0";
|
2022-01-13 20:06:32 +00:00
|
|
|
pname = "opt-einsum";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2022-01-13 20:06:32 +00:00
|
|
|
pname = "opt_einsum";
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-WfZHX3e7w33PfNdIUZwOxgci6R5jyhFOaIIcDFSkZUk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
patches = [
|
|
|
|
# https://github.com/dgasmith/opt_einsum/pull/208
|
|
|
|
(fetchpatch {
|
|
|
|
name = "python312-compatibility.patch";
|
|
|
|
url = "https://github.com/dgasmith/opt_einsum/commit/0beacf96923bbb2dd1939a9c59398a38ce7a11b1.patch";
|
|
|
|
hash = "sha256-dmmEzhy17huclo1wOubpBUDc2L7vqEU5b/6a5loM47A=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-01-13 20:06:32 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"opt_einsum"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-01-13 20:06:32 +00:00
|
|
|
description = "Optimizing NumPy's einsum function with order optimization and GPU support";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/dgasmith/opt_einsum";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ teh ];
|
|
|
|
};
|
|
|
|
}
|