[Git][reproducible-builds/diffoscope][master] 3 commits: Use our_check_output in the ODT comparator.

Chris Lamb (@lamby) gitlab at salsa.debian.org
Wed Jul 9 17:48:47 UTC 2025



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
90046c65 by Chris Lamb at 2025-07-09T10:42:52-07:00
Use our_check_output in the ODT comparator.


- - - - -
1566a189 by Chris Lamb at 2025-07-09T10:43:19-07:00
squash our_check_output


- - - - -
a7404b8a by Chris Lamb at 2025-07-09T10:48:34-07:00
Memoize a number of calls to --version. Thanks, Jade! (Closes: #412)


- - - - -


2 changed files:

- diffoscope/comparators/odt.py
- diffoscope/comparators/zip.py


Changes:

=====================================
diffoscope/comparators/odt.py
=====================================
@@ -17,13 +17,14 @@
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
 import re
+import functools
 import subprocess
 
 from diffoscope.tools import tool_required
 from diffoscope.difference import Difference
 
 from .utils.file import File
-from .utils.command import Command
+from .utils.command import Command, our_check_output
 
 
 class Odt2txt(Command):
@@ -37,9 +38,10 @@ class Odt2txt(Command):
         return ("odt2txt", "--width=-1", self.path)
 
     @staticmethod
+    @functools.lru_cache
     def odt2txt_variant():
         try:
-            out = subprocess.check_output(["odt2txt", "--version"])
+            out = our_check_output(["odt2txt", "--version"])
         except subprocess.CalledProcessError as e:
             out = e.output
         return out.decode("UTF-8").splitlines()[0].split()[0].strip()


=====================================
diffoscope/comparators/zip.py
=====================================
@@ -17,6 +17,8 @@
 # You should have received a copy of the GNU General Public License
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
+
+import functools
 import re
 import sys
 import shutil
@@ -35,6 +37,7 @@ from .utils.archive import Archive, ArchiveMember
 from .utils.command import Command, our_check_output
 
 
+ at functools.lru_cache()
 def zipdetails_version():
     return our_check_output(["zipdetails", "--version"]).decode("UTF-8")
 



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/2d752e7ead892714bed836ee3d95e9500be06ee6...a7404b8a57ad9eaf98aae211b66940314e674e29

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/2d752e7ead892714bed836ee3d95e9500be06ee6...a7404b8a57ad9eaf98aae211b66940314e674e29
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20250709/a9cdbd32/attachment.htm>


More information about the rb-commits mailing list