diff --git a/pkgs/development/python-modules/hyperpyyaml/default.nix b/pkgs/development/python-modules/hyperpyyaml/default.nix index 0c9ebca661662..2ce4cae573d1f 100644 --- a/pkgs/development/python-modules/hyperpyyaml/default.nix +++ b/pkgs/development/python-modules/hyperpyyaml/default.nix @@ -30,18 +30,22 @@ buildPythonPackage rec { setuptools ]; + patches = [ ./unpin-ruamel-yaml.patch ]; + dependencies = [ pyyaml ruamel-yaml ]; + pythonRelaxDeps = [ + "ruamel-yaml" + ]; + nativeCheckInputs = [ pytestCheckHook ]; 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}"; diff --git a/pkgs/development/python-modules/hyperpyyaml/unpin-ruamel-yaml.patch b/pkgs/development/python-modules/hyperpyyaml/unpin-ruamel-yaml.patch new file mode 100644 index 0000000000000..8e33adc54aab7 --- /dev/null +++ b/pkgs/development/python-modules/hyperpyyaml/unpin-ruamel-yaml.patch @@ -0,0 +1,9 @@ +diff --git a/setup.py b/setup.py +--- a/setup.py ++++ b/setup.py +@@ -18,5 +18,5 @@ setuptools.setup( + ], + packages=["hyperpyyaml"], +- install_requires=["pyyaml>=5.1", "ruamel.yaml>=0.17.28,<0.19.0"], ++ install_requires=["pyyaml>=5.1", "ruamel.yaml>=0.17.28"], + ) diff --git a/pkgs/development/python-modules/ruamel-yaml/default.nix b/pkgs/development/python-modules/ruamel-yaml/default.nix index 3d811e098d7be..12115a1e145a5 100644 --- a/pkgs/development/python-modules/ruamel-yaml/default.nix +++ b/pkgs/development/python-modules/ruamel-yaml/default.nix @@ -19,6 +19,8 @@ buildPythonPackage rec { hash = "sha256-U+tmzSeEnv+Wjr+PC/YfRs2sLaHR81dt1MzumyXDGZM="; }; + patches = [ ./loader-max-depth.patch ]; + nativeBuildInputs = [ setuptools ]; # Tests use relative paths diff --git a/pkgs/development/python-modules/ruamel-yaml/loader-max-depth.patch b/pkgs/development/python-modules/ruamel-yaml/loader-max-depth.patch new file mode 100644 index 0000000000000..0019320fab5f0 --- /dev/null +++ b/pkgs/development/python-modules/ruamel-yaml/loader-max-depth.patch @@ -0,0 +1,35 @@ +diff --git a/loader.py b/loader.py +--- a/loader.py ++++ b/loader.py +@@ -28,6 +28,7 @@ class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, VersionedRe + preserve_quotes: Optional[bool] = None, + ) -> None: + self.comment_handling = None ++ self.max_depth = 0 + Reader.__init__(self, stream, loader=self) + Scanner.__init__(self, loader=self) + Parser.__init__(self, loader=self) +@@ -43,6 +44,7 @@ class SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, VersionedRe + preserve_quotes: Optional[bool] = None, + ) -> None: + self.comment_handling = None ++ self.max_depth = 0 + Reader.__init__(self, stream, loader=self) + Scanner.__init__(self, loader=self) + Parser.__init__(self, loader=self) +@@ -59,6 +61,7 @@ class Loader(Reader, Scanner, Parser, Composer, Constructor, VersionedResolver): + preserve_quotes: Optional[bool] = None, + ) -> None: + self.comment_handling = None ++ self.max_depth = 0 + Reader.__init__(self, stream, loader=self) + Scanner.__init__(self, loader=self) + Parser.__init__(self, loader=self) +@@ -82,6 +85,7 @@ class RoundTripLoader( + ) -> None: + # self.reader = Reader.__init__(self, stream) + self.comment_handling = None # issue 385 ++ self.max_depth = 0 + Reader.__init__(self, stream, loader=self) + RoundTripScanner.__init__(self, loader=self) + RoundTripParser.__init__(self, loader=self)