python3Packages.hyperpyyaml: fix compatibility with ruamel-yaml 0.19 (#507090)

This commit is contained in:
Gaétan Lepage
2026-04-05 23:31:16 +00:00
committed by GitHub
2 changed files with 32 additions and 9 deletions
@@ -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}";
@@ -3,6 +3,7 @@
stdenv,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
# build-system
hatchling,
@@ -61,7 +62,9 @@ buildPythonPackage rec {
];
pythonRelaxDeps = [
"torch"
"torchaudio"
"torchcodec"
];
dependencies = [
asteroid-filterbanks
@@ -121,13 +124,22 @@ buildPythonPackage rec {
"test_audio_resample"
];
disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
# Crashes the interpreter
# - On aarch64-darwin: Trace/BPT trap: 5
# - On x86_64-darwin: Fatal Python error: Illegal instruction
"tests/inference_test.py"
"tests/test_train.py"
];
disabledTestPaths =
lib.optionals stdenv.hostPlatform.isDarwin [
# Crashes the interpreter
# - On aarch64-darwin: Trace/BPT trap: 5
# - On x86_64-darwin: Fatal Python error: Illegal instruction
"tests/inference_test.py"
"tests/test_train.py"
]
++ lib.optionals (pythonAtLeast "3.14") [
# RuntimeError: Please call `iter(combined_loader)` first.
# https://github.com/Lightning-AI/pytorch-lightning/issues/20641
"tests/inference_test.py"
"tests/test_train.py"
# PicklingError: Can't pickle <class 'pyannote.database.registry.Debug'>
"tests/tasks/test_reproducibility.py"
];
meta = {
description = "Neural building blocks for speaker diarization: speech activity detection, speaker change detection, overlapped speech detection, speaker embedding";