Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package whipper for openSUSE:Factory checked 
in at 2021-08-11 11:47:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/whipper (Old)
 and      /work/SRC/openSUSE:Factory/.whipper.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "whipper"

Wed Aug 11 11:47:10 2021 rev:7 rq:911189 version:0.10.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/whipper/whipper.changes  2021-06-01 
10:41:08.109188289 +0200
+++ /work/SRC/openSUSE:Factory/.whipper.new.1899/whipper.changes        
2021-08-11 11:47:37.521717041 +0200
@@ -1,0 +2,6 @@
+Tue Aug 10 06:52:50 UTC 2021 - Dr. Werner Fink <wer...@suse.de>
+
+- Add upstream commit as patch e0942417a1c267781a8b676789730457dcb2e6fa.patch
+  * Use custom YAML subclass to be compatible with ruamel_yaml>=0.17
+
+-------------------------------------------------------------------

New:
----
  e0942417a1c267781a8b676789730457dcb2e6fa.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ whipper.spec ++++++
--- /var/tmp/diff_new_pack.hwqw1a/_old  2021-08-11 11:47:39.041715212 +0200
+++ /var/tmp/diff_new_pack.hwqw1a/_new  2021-08-11 11:47:39.041715212 +0200
@@ -24,6 +24,8 @@
 Group:          Productivity/Multimedia/CD/Grabbers
 URL:            https://github.com/whipper-team/whipper
 Source0:        
%{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
+# PATCH_UPSTREAM
+Patch0:         e0942417a1c267781a8b676789730457dcb2e6fa.patch
 BuildRequires:  fdupes
 BuildRequires:  gobject-introspection
 BuildRequires:  libsndfile-devel
@@ -36,11 +38,11 @@
 BuildRequires:  cd-paranoia >= 10.2
 BuildRequires:  cdrdao
 BuildRequires:  python3-Twisted
+BuildRequires:  python3-discid
 BuildRequires:  python3-musicbrainzngs
 BuildRequires:  python3-mutagen
 BuildRequires:  python3-pycdio
 BuildRequires:  python3-pytest
-BuildRequires:  python3-discid
 BuildRequires:  python3-ruamel.yaml
 BuildRequires:  sox
 # /SECTION
@@ -49,11 +51,11 @@
 Requires:       cd-paranoia >= 10.2
 Requires:       cdrdao
 Requires:       flac
+Requires:       python3-discid
 Requires:       python3-gobject
 Requires:       python3-musicbrainzngs
 Requires:       python3-mutagen
 Requires:       python3-pycdio
-Requires:       python3-discid
 Requires:       python3-ruamel.yaml
 Requires:       sox
 Conflicts:      morituri
@@ -67,6 +69,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 echo "Version: %{version}" > PKG-INFO

++++++ e0942417a1c267781a8b676789730457dcb2e6fa.patch ++++++
>From e0942417a1c267781a8b676789730457dcb2e6fa Mon Sep 17 00:00:00 2001
From: Martin Weinelt <h...@darmstadt.ccc.de>
Date: Sun, 20 Jun 2021 15:18:37 +0200
Subject: [PATCH] Use custom YAML subclass to be compatible with
 ruamel_yaml>=0.17

Signed-off-by: Martin Weinelt <h...@darmstadt.ccc.de>
---
 whipper/common/yaml.py             | 18 ++++++++++++++++++
 whipper/result/logger.py           | 11 ++++++-----
 whipper/test/test_result_logger.py | 14 ++++++--------
 3 files changed, 30 insertions(+), 13 deletions(-)
 create mode 100644 whipper/common/yaml.py

diff --git a/whipper/common/yaml.py b/whipper/common/yaml.py
new file mode 100644
index 00000000..4edb0b36
--- /dev/null
+++ b/whipper/common/yaml.py
@@ -0,0 +1,18 @@
+from ruamel.yaml import YAML as ruamel_YAML
+from ruamel.yaml.compat import StringIO
+
+# https://yaml.readthedocs.io/en/latest/example.html#output-of-dump-as-a-string
+class YAML(ruamel_YAML):
+    def __init__(self, *args, **kwargs):
+        super().__init__()
+        self.width = 4000
+        self.default_flow_style = False
+
+    def dump(self, data, stream=None, **kw):
+        inefficient = False
+        if stream is None:
+            inefficient = True
+            stream = StringIO()
+        ruamel_YAML.dump(self, data, stream, **kw)
+        if inefficient:
+            return stream.getvalue()
diff --git a/whipper/result/logger.py b/whipper/result/logger.py
index b7043adc..f4471a00 100644
--- a/whipper/result/logger.py
+++ b/whipper/result/logger.py
@@ -1,12 +1,12 @@
 import time
 import hashlib
 import re
-import ruamel.yaml as yaml
 from ruamel.yaml.comments import CommentedMap as OrderedDict
 
 import whipper
 
 from whipper.common import common
+from whipper.common.yaml import YAML
 from whipper.result import result
 
 
@@ -148,11 +148,12 @@ def logRip(self, ripResult, epoch):
         data["EOF"] = "End of status report"
         riplog["Conclusive status report"] = data
 
+        yaml = YAML(
+            typ="rt",
+            pure=True
+        )
         riplog = yaml.dump(
-            riplog,
-            default_flow_style=False,
-            width=4000,
-            Dumper=yaml.RoundTripDumper
+            riplog
         )
         # Add a newline after the "Log creation date" line
         riplog = re.sub(
diff --git a/whipper/test/test_result_logger.py 
b/whipper/test/test_result_logger.py
index 411b61af..98c89ab5 100644
--- a/whipper/test/test_result_logger.py
+++ b/whipper/test/test_result_logger.py
@@ -3,8 +3,8 @@
 import os
 import re
 import unittest
-import ruamel.yaml
 
+from whipper.common.yaml import YAML
 from whipper.result.result import TrackResult, RipResult
 from whipper.result.logger import WhipperLogger
 
@@ -163,16 +163,14 @@ def testLogger(self):
             ))
         )
 
-        yaml = ruamel.yaml.YAML()
+        yaml = YAML(
+            typ='rt',
+            pure=True
+        )
         parsedLog = yaml.load(actual)
         self.assertEqual(
             actual,
-            ruamel.yaml.dump(
-                parsedLog,
-                default_flow_style=False,
-                width=4000,
-                Dumper=ruamel.yaml.RoundTripDumper
-            )
+            yaml.dump(parsedLog)
         )
         log_body = "\n".join(actualLines[:-1]).encode()
         self.assertEqual(

Reply via email to