From a97e433cbc523fdb26af10efe5460ec3fb8b036b Mon Sep 17 00:00:00 2001 From: Kirill Radzikhovskyy Date: Mon, 6 Apr 2026 08:22:36 +1000 Subject: [PATCH] python3Packages.hyperpyyaml: fix compatibility with ruamel-yaml 0.19 --- .../python-modules/hyperpyyaml/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/hyperpyyaml/default.nix b/pkgs/development/python-modules/hyperpyyaml/default.nix index 0c9ebca66166..72b74de94d96 100644 --- a/pkgs/development/python-modules/hyperpyyaml/default.nix +++ b/pkgs/development/python-modules/hyperpyyaml/default.nix @@ -26,6 +26,19 @@ buildPythonPackage rec { hash = "sha256-/7OrIR61zQYl2+RjiOOlaqUGWBieon5fe8sgmEvKowo="; }; + postPatch = '' + # https://github.com/speechbrain/HyperPyYAML/pull/33 + substituteInPlace hyperpyyaml/core.py \ + --replace-fail \ + " hparams = yaml.load(yaml_stream, Loader=loader)" \ + " if not hasattr(loader, 'max_depth'): + loader.max_depth = 0 + hparams = yaml.load(yaml_stream, Loader=loader)" + ''; + + # https://github.com/speechbrain/HyperPyYAML/pull/33 + pythonRelaxDeps = [ "ruamel.yaml" ]; + build-system = [ setuptools ]; @@ -40,8 +53,6 @@ buildPythonPackage rec { pythonImportsCheck = [ "hyperpyyaml" ]; meta = { - # https://github.com/speechbrain/HyperPyYAML/pull/32 - broken = lib.versionAtLeast ruamel-yaml.version "0.19"; description = "Extensions to YAML syntax for better python interaction"; homepage = "https://github.com/speechbrain/HyperPyYAML"; changelog = "https://github.com/speechbrain/HyperPyYAML/releases/tag/${src.tag}";