python3Packages.brax: fix mujoco incompatibility

This commit is contained in:
Gaetan Lepage
2026-06-22 22:26:49 +00:00
parent b5ab03f4c5
commit a1fac10c75
@@ -54,13 +54,21 @@ buildPythonPackage (finalAttrs: {
./dont-use-device_put_replicated-compat.patch
];
# TypeError: clip() got an unexpected keyword argument 'a_min'
postPatch = ''
substituteInPlace brax/fluid.py \
--replace-fail \
"box = 6.0 * jp.clip(jp.sum(diag_inertia_v, axis=-1), a_min=1e-12)" \
"box = 6.0 * jp.clip(jp.sum(diag_inertia_v, axis=-1), min=1e-12)"
'';
postPatch =
# TypeError: clip() got an unexpected keyword argument 'a_min'
''
substituteInPlace brax/fluid.py \
--replace-fail \
"box = 6.0 * jp.clip(jp.sum(diag_inertia_v, axis=-1), a_min=1e-12)" \
"box = 6.0 * jp.clip(jp.sum(diag_inertia_v, axis=-1), min=1e-12)"
''
# mujoco >= 3.10 changed mj_fullM's signature from (m, dst, qM) to (m, d, dst).
+ ''
substituteInPlace brax/generalized/mass_test.py \
--replace-fail \
"mujoco.mj_fullM(model, mj_mass_mx, mj_next.qM)" \
"mujoco.mj_fullM(model, mj_next, mj_mass_mx)"
'';
build-system = [
hatchling