81047829ea
GitOrigin-RevId: 48d63e924a2666baf37f4f14a18f19347fbd54a2
46 lines
936 B
Nix
46 lines
936 B
Nix
{ buildPythonPackage
|
|
, fetchFromGitHub
|
|
, jax
|
|
, jaxlib
|
|
, lib
|
|
, poetry-core
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "treeo";
|
|
version = "0.4.0";
|
|
format = "pyproject";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "cgarciae";
|
|
repo = pname;
|
|
rev = version;
|
|
sha256 = "176r1kgsdlylvdrxmhnzni81p8m9cfnsn4wwn6fnmsgam2qbp76j";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace pyproject.toml \
|
|
--replace 'typing-extensions = "^3.10.0"' 'typing-extensions = "*"'
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
poetry-core
|
|
];
|
|
|
|
# jax is not declared in the dependencies, but is necessary.
|
|
propagatedBuildInputs = [
|
|
jax
|
|
];
|
|
|
|
checkInputs = [ jaxlib ];
|
|
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 ];
|
|
};
|
|
}
|