2022-01-03 16:56:52 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-04-03 18:54:34 +00:00
|
|
|
, fetchpatch
|
2022-01-03 16:56:52 +00:00
|
|
|
, jax
|
|
|
|
, jaxlib
|
|
|
|
, lib
|
|
|
|
, poetry-core
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "treeo";
|
2022-04-03 18:54:34 +00:00
|
|
|
# Note that there is a version 0.4.0, but it was released in error. At the
|
|
|
|
# time of writing (2022-03-29), v0.0.11 is the latest as reported on GitHub
|
|
|
|
# and PyPI.
|
|
|
|
version = "0.0.11";
|
2022-01-03 16:56:52 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cgarciae";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-04-03 18:54:34 +00:00
|
|
|
hash = "sha256-zs3F8i+G5OX/A9wOO60xVuvnm2QqrL+dHIrC0qwH37o=";
|
2022-01-03 16:56:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
# See https://github.com/cgarciae/treex/issues/68.
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/cgarciae/treeo/pull/14/commits/022915da2b3bf76406a7c79d1b4593bee7956f16.patch";
|
|
|
|
hash = "sha256-WGxJqqrf2g0yZe30RyG1xxbloiqj1awuf1Y4eh5y+z0=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/cgarciae/treeo/pull/14/commits/99f9488bd0c977780844fd79743167b0010d359b.patch";
|
|
|
|
hash = "sha256-oKDYs+Ah0QXkhiJysIudQ6VLIiUiIcnQisxYp6GJuTc=";
|
|
|
|
})
|
|
|
|
];
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
# jax is not declared in the dependencies, but is necessary.
|
2022-01-03 16:56:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
jax
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ jaxlib ];
|
2022-01-03 16:56:52 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"treeo"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A small library for creating and manipulating custom JAX Pytree classes.";
|
|
|
|
homepage = "https://github.com/cgarciae/treeo";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ndl ];
|
|
|
|
};
|
|
|
|
}
|