2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchpatch,
|
|
|
|
fetchPypi,
|
|
|
|
setuptools,
|
|
|
|
numpy,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2022-01-13 20:06:32 +00:00
|
|
|
}:
|
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=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ numpy ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +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 ];
|
|
|
|
};
|
|
|
|
}
|