[Git][reproducible-builds/diffoscope][master] 3 commits: Bump minimum version of Black to 20.8b1. (Re: #972518)

Chris Lamb gitlab at salsa.debian.org
Tue Oct 20 10:15:20 UTC 2020



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
2fbd283f by Chris Lamb at 2020-10-20T11:07:05+01:00
Bump minimum version of Black to 20.8b1. (Re: #972518)

- - - - -
0be16053 by Chris Lamb at 2020-10-20T11:14:35+01:00
Update tests to support 4.11.1. (Closes: #972518)

- - - - -
45b44dc8 by Chris Lamb at 2020-10-20T11:14:48+01:00
Move test_ocaml to the assert_diff helper.

- - - - -


10 changed files:

- diffoscope/comparators/deb.py
- diffoscope/comparators/elf.py
- diffoscope/comparators/java.py
- diffoscope/comparators/lz4.py
- diffoscope/comparators/utils/file.py
- diffoscope/comparators/zst.py
- setup.py
- tests/comparators/test_ocaml.py
- tests/data/ocaml_expected_diff
- tests/test_source.py


Changes:

=====================================
diffoscope/comparators/deb.py
=====================================
@@ -137,8 +137,10 @@ class DebFile(File):
             return None
 
         if not hasattr(self, "_control"):
-            control_file = self.as_container.control_tar.as_container.lookup_file(
-                "./control"
+            control_file = (
+                self.as_container.control_tar.as_container.lookup_file(
+                    "./control"
+                )
             )
             if control_file:
                 with open(control_file.path, "rb") as f:


=====================================
diffoscope/comparators/elf.py
=====================================
@@ -554,8 +554,10 @@ class ElfContainer(DecompilableContainer):
         debug_file_path = "./usr/lib/debug/.build-id/{0}/{1}.debug".format(
             build_id[:2], build_id[2:]
         )
-        debug_file = dbgsym_package.as_container.data_tar.as_container.lookup_file(
-            debug_file_path
+        debug_file = (
+            dbgsym_package.as_container.data_tar.as_container.lookup_file(
+                debug_file_path
+            )
         )
         if not debug_file:
             logger.debug(


=====================================
diffoscope/comparators/java.py
=====================================
@@ -96,7 +96,8 @@ class ClassFile(File):
                 # Save our exception
                 last_exc = exc
                 logger.debug(
-                    "Unable to find %s. Falling back...", decompiler,
+                    "Unable to find %s. Falling back...",
+                    decompiler,
                 )
 
         # Re-raise the last exception we would have raised from the previous


=====================================
diffoscope/comparators/lz4.py
=====================================
@@ -47,7 +47,9 @@ class Lz4Container(Archive):
         logger.debug("lz4 extracting to %s", dest_path)
         with open(dest_path, "wb") as fp:
             subprocess.check_call(
-                ["lz4", "-d", "-c", self.source.path], stdout=fp, stderr=None,
+                ["lz4", "-d", "-c", self.source.path],
+                stdout=fp,
+                stderr=None,
             )
         return dest_path
 


=====================================
diffoscope/comparators/utils/file.py
=====================================
@@ -267,13 +267,17 @@ class File(metaclass=abc.ABCMeta):
             )
 
             logger.debug(
-                "Instantiating a %s for %s", formatted_class, self.name,
+                "Instantiating a %s for %s",
+                formatted_class,
+                self.name,
             )
             try:
                 self._as_container = klass(self)
 
                 logger.debug(
-                    "Returning a %s for %s", formatted_class, self.name,
+                    "Returning a %s for %s",
+                    formatted_class,
+                    self.name,
                 )
                 return self._as_container
             except RequiredToolNotFound as exc:
@@ -286,8 +290,10 @@ class File(metaclass=abc.ABCMeta):
                     infix = type(self).DESCRIPTION
                 except AttributeError:
                     infix = "this file format"
-                msg = "Format-specific differences are supported for {}.".format(
-                    infix
+                msg = (
+                    "Format-specific differences are supported for {}.".format(
+                        infix
+                    )
                 )
                 self._comments.append(exc.get_comment(msg))
 
@@ -460,7 +466,8 @@ class File(metaclass=abc.ABCMeta):
     def cmp_external(self, other):
         return (
             subprocess.call(
-                ("cmp", "-s", self.path, other.path), close_fds=True,
+                ("cmp", "-s", self.path, other.path),
+                close_fds=True,
             )
             == 0
         )


=====================================
diffoscope/comparators/zst.py
=====================================
@@ -47,7 +47,9 @@ class ZstContainer(Archive):
         logger.debug("zstd extracting to %s", dest_path)
         with open(dest_path, "wb") as fp:
             subprocess.check_call(
-                ["zstd", "-d", "-c", self.source.path], stdout=fp, stderr=None,
+                ["zstd", "-d", "-c", self.source.path],
+                stdout=fp,
+                stderr=None,
             )
         return dest_path
 


=====================================
setup.py
=====================================
@@ -47,8 +47,13 @@ setup(
     packages=find_packages(exclude=["tests", "tests.*"]),
     tests_require=["pytest"],
     cmdclass={"test": PyTest},
-    entry_points={"console_scripts": ["diffoscope=diffoscope.main:main"],},
-    install_requires=["python-magic", "libarchive-c",],
+    entry_points={
+        "console_scripts": ["diffoscope=diffoscope.main:main"],
+    },
+    install_requires=[
+        "python-magic",
+        "libarchive-c",
+    ],
     extras_require={
         "distro_detection": ["distro"],
         "cmdline": ["argcomplete", "progressbar"],


=====================================
tests/comparators/test_ocaml.py
=====================================
@@ -24,7 +24,7 @@ from diffoscope.comparators.ocaml import OcamlInterfaceFile
 from diffoscope.comparators.binary import FilesystemFile
 from diffoscope.comparators.utils.specialize import specialize
 
-from ..utils.data import get_data
+from ..utils.data import assert_diff
 from ..utils.tools import skip_unless_tool_is_at_least
 from ..utils.nonexisting import assert_non_existing
 
@@ -57,7 +57,7 @@ def ocaml_version():
     return out.decode("utf-8").split()[-1]
 
 
- at skip_unless_tool_is_at_least("ocamlobjinfo", ocaml_version, "4.08.1")
+ at skip_unless_tool_is_at_least("ocamlobjinfo", ocaml_version, "4.11.1")
 def test_identification(cmi1):
     assert isinstance(cmi1, OcamlInterfaceFile)
 
@@ -67,18 +67,17 @@ def differences(cmi1, cmi2):
     return cmi1.compare(cmi2).details
 
 
- at skip_unless_tool_is_at_least("ocamlobjinfo", ocaml_version, "4.08.1")
+ at skip_unless_tool_is_at_least("ocamlobjinfo", ocaml_version, "4.11.1")
 def test_no_differences(cmi1):
     difference = cmi1.compare(cmi1)
     assert difference is None
 
 
- at skip_unless_tool_is_at_least("ocamlobjinfo", ocaml_version, "4.08.1")
+ at skip_unless_tool_is_at_least("ocamlobjinfo", ocaml_version, "4.11.1")
 def test_diff(differences):
-    expected_diff = get_data("ocaml_expected_diff")
-    assert differences[0].unified_diff == expected_diff
+    assert_diff(differences[0], "ocaml_expected_diff")
 
 
- at skip_unless_tool_is_at_least("ocamlobjinfo", ocaml_version, "4.08.1")
+ at skip_unless_tool_is_at_least("ocamlobjinfo", ocaml_version, "4.11.1")
 def test_compare_non_existing(monkeypatch, cmi1):
     assert_non_existing(monkeypatch, cmi1, has_null_source=False)


=====================================
tests/data/ocaml_expected_diff
=====================================
@@ -2,7 +2,7 @@
 -Unit name: Test1
 +Unit name: Test2
  Interfaces imported:
--	4bf3070814d7fb8e8d365d95481f8cad	Test1
-+	333f54d1aae1264e7ad64cbb437cbc4f	Test2
- 	ad45f251bbf98d3a0bf3b883546ecfc8	Stdlib
- 	a2b1a9d869fd05813beb35645bd9cd94	CamlinternalFormatBasics
+-	3e47d8b00458748ef1a9311764531b2c	Test1
++	de7049745527b20997c517c338bb83cb	Test2
+ 	c21c5d26416461b543321872a551ea0d	Stdlib
+ 	3a3ca1838627f7762f49679ce0278ad1	CamlinternalFormatBasics


=====================================
tests/test_source.py
=====================================
@@ -242,7 +242,7 @@ def black_version():
     return out.decode("utf-8").rsplit(" ", 1)[-1]
 
 
- at skip_unless_tool_is_at_least("black", black_version, "19.10b0")
+ at skip_unless_tool_is_at_least("black", black_version, "20.8b1")
 def test_code_is_black_clean():
     output = subprocess.check_output(
         ("black", "--diff", "."), stderr=subprocess.PIPE



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/e3790cc8190c9a76db59adea0f4d67f22a814079...45b44dc86a204b5bc045b9939e77916b2467016f

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/e3790cc8190c9a76db59adea0f4d67f22a814079...45b44dc86a204b5bc045b9939e77916b2467016f
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/20201020/bbd44f66/attachment.htm>


More information about the rb-commits mailing list