python312Packages.flaxlib: add update script

This commit is contained in:
Gaetan Lepage 2024-11-06 00:09:00 +01:00
parent 4d530aebe3
commit 981dbd7f40
2 changed files with 15 additions and 0 deletions

View File

@ -31,6 +31,9 @@
# optional-dependencies
matplotlib,
writeScript,
tomlq,
}:
buildPythonPackage rec {
@ -112,6 +115,14 @@ buildPythonPackage rec {
"test_vmap_and_cond_passthrough_error" # AssertionError: "at vmap.*'broadcast'.*got axis spec ...
];
passthru = {
updateScript = writeScript "update.sh" ''
nix-update flax # does not --build by default
nix-build . -A flax.src # src is essentially a passthru
nix-update flaxlib --version="$(${lib.getExe tomlq} <result/Cargo.toml .something.version)" --commit
'';
};
meta = {
description = "Neural network library for JAX";
homepage = "https://github.com/google/flax";

View File

@ -52,6 +52,10 @@ buildPythonPackage rec {
# This package does not have tests (yet ?)
doCheck = false;
passthru = {
inherit (flax) updateScript;
};
meta = {
description = "Rust library used internally by flax";
homepage = "https://github.com/google/flax/tree/main/flaxlib";