From 6d1e8bf3b06454ec06ad968f51ff0e18d34bf2ed Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 22 Oct 2026 20:04:01 +0000 Subject: [PATCH 1/2] python3Packages.pyro-ppl: fix build --- .../python-modules/pyro-ppl/default.nix | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/pyro-ppl/default.nix b/pkgs/development/python-modules/pyro-ppl/default.nix index 81104e090efd..1dc12f6b8750 100644 --- a/pkgs/development/python-modules/pyro-ppl/default.nix +++ b/pkgs/development/python-modules/pyro-ppl/default.nix @@ -70,10 +70,15 @@ buildPythonPackage (finalAttrs: { "pyro.optim" ]; - # Added for the tests/distributions/test_spanning_tree.py - preCheck = '' - export TORCH_EXTENSIONS_DIR=$(mktemp -d) - ''; + preCheck = + # Added for the tests/distributions/test_spanning_tree.py + '' + export TORCH_EXTENSIONS_DIR=$(mktemp -d) + '' + # Avoid a race between xdist workers when tests/perf/test_benchmark.py creates it at import + + '' + mkdir -p .benchmarks + ''; nativeCheckInputs = [ graphviz @@ -83,7 +88,14 @@ buildPythonPackage (finalAttrs: { scipy ]; - pytestFlags = [ "--stage=unit" ]; + pytestFlags = [ + "--stage=unit" + + # FutureWarning: `torch.jit.{trace,trace_method,save,load}` is not supported in Python 3.14+ + # Upstream only ignores the "is deprecated" variant of these warnings. + # Note: `-W` messages are matched literally as a prefix, not as regexes. + "-Wignore:`torch.jit.:FutureWarning" + ]; disabledTests = [ "test_stable_with_log_prob_param_fit" From 92a6cffbc31ecf0d75770d006384ede9574a3ae8 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 22 Oct 2026 20:04:43 +0000 Subject: [PATCH 2/2] python3Packages.funsor: fix build --- pkgs/development/python-modules/funsor/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/python-modules/funsor/default.nix b/pkgs/development/python-modules/funsor/default.nix index 4c57b7fbb58c..430e5df516bc 100644 --- a/pkgs/development/python-modules/funsor/default.nix +++ b/pkgs/development/python-modules/funsor/default.nix @@ -47,6 +47,14 @@ buildPythonPackage (finalAttrs: { ./torch-arg-constraints-property.patch ]; + # `torch.cholesky` and `Tensor.cholesky` were removed in torch 2.14 + postPatch = '' + substituteInPlace test/pyro/test_convert.py test/pyro/test_hmm.py \ + --replace-fail "torch.cholesky(cov)" "torch.linalg.cholesky(cov)" + substituteInPlace test/test_gaussian.py \ + --replace-fail "u = x.cholesky()" "u = torch.linalg.cholesky(x)" + ''; + build-system = [ setuptools ]; dependencies = [ @@ -76,6 +84,11 @@ buildPythonPackage (finalAttrs: { export FUNSOR_BACKEND=torch ''; + pytestFlags = [ + # FutureWarning: `torch.jit.trace` is not supported in Python 3.14+ and may break. + "-Wignore:`torch.jit.:FutureWarning" + ]; + pythonImportsCheck = [ "funsor" ]; meta = {