depot/third_party/nixpkgs/pkgs/development/python-modules/treeo/default.nix
Default email 81047829ea Project import generated by Copybara.
GitOrigin-RevId: 48d63e924a2666baf37f4f14a18f19347fbd54a2
2022-02-10 15:34:41 -05:00

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 ];
};
}