2022-01-03 16:56:52 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, jax
|
|
|
|
, jaxlib
|
|
|
|
, lib
|
|
|
|
, poetry-core
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "treeo";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "0.4.0";
|
2022-01-03 16:56:52 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cgarciae";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "176r1kgsdlylvdrxmhnzni81p8m9cfnsn4wwn6fnmsgam2qbp76j";
|
2022-01-03 16:56:52 +00:00
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'typing-extensions = "^3.10.0"' 'typing-extensions = "*"'
|
|
|
|
'';
|
|
|
|
|
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
|
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
checkInputs = [ 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 ];
|
|
|
|
};
|
|
|
|
}
|