commit:     21b0291a014d17bc4681ae66b0d900c96279fc53
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 26 09:03:13 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Jan 26 09:03:13 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=21b0291a

reformat with black 24

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/snakeoil/constraints.py            |  6 +++---
 src/snakeoil/containers.py             |  3 ---
 src/snakeoil/data_source.py            |  3 ---
 src/snakeoil/demandload.py             |  1 -
 src/snakeoil/fileutils.py              |  1 -
 src/snakeoil/obj.py                    |  1 -
 src/snakeoil/osutils/native_readdir.py |  1 -
 src/snakeoil/stringio.py               |  6 ++----
 src/snakeoil/struct_compat.py          |  1 -
 src/snakeoil/tar.py                    |  1 -
 tests/cli/test_arghparse.py            |  7 ++++---
 tests/test_osutils.py                  |  7 ++++---
 tests/test_version.py                  | 21 ++++++++++++---------
 13 files changed, 25 insertions(+), 34 deletions(-)

diff --git a/src/snakeoil/constraints.py b/src/snakeoil/constraints.py
index c239727c..5fe46ec1 100644
--- a/src/snakeoil/constraints.py
+++ b/src/snakeoil/constraints.py
@@ -80,9 +80,9 @@ class Problem:
     def __init__(self):
         self.variables: dict[str, _Domain] = {}
         self.constraints: list[tuple[Constraint, frozenset[str]]] = []
-        self.vconstraints: dict[
-            str, list[tuple[Constraint, frozenset[str]]]
-        ] = defaultdict(list)
+        self.vconstraints: dict[str, list[tuple[Constraint, frozenset[str]]]] 
= (
+            defaultdict(list)
+        )
 
     def add_variable(self, domain: Iterable[Any], *variables: str):
         """Add variables to the problem, which use the specified domain.

diff --git a/src/snakeoil/containers.py b/src/snakeoil/containers.py
index ebfc1b39..ee14baf6 100644
--- a/src/snakeoil/containers.py
+++ b/src/snakeoil/containers.py
@@ -18,7 +18,6 @@ from .klass import steal_docs
 
 
 class InvertedContains(set):
-
     """Set that inverts all contains lookup results.
 
     Essentially, it's a set class usable for blacklist containment testing.
@@ -97,7 +96,6 @@ class SetMixin:
 
 
 class LimitedChangeSet(SetMixin):
-
     """
     Set used to limit the number of times a key can be removed/added.
 
@@ -263,7 +261,6 @@ class ProtectedSet(SetMixin):
 
 
 class RefCountingSet(dict):
-
     """
     Set implementation that implements refcounting for add/remove, removing 
the key only when its refcount is 0.
 

diff --git a/src/snakeoil/data_source.py b/src/snakeoil/data_source.py
index 3b0ccb16..bb265d9f 100644
--- a/src/snakeoil/data_source.py
+++ b/src/snakeoil/data_source.py
@@ -190,7 +190,6 @@ class base:
 
 
 class local_source(base):
-
     """locally accessible data source
 
     Literally a file on disk.
@@ -289,7 +288,6 @@ class bz2_source(base):
 
 
 class data_source(base):
-
     """
     base class encapsulating a purely virtual data source lacking an on disk 
location.
 
@@ -389,7 +387,6 @@ class bytes_data_source(data_source):
 
 
 class invokable_data_source(data_source):
-
     """
     data source that takes a callable instead of the actual data item
 

diff --git a/src/snakeoil/demandload.py b/src/snakeoil/demandload.py
index bfa6dce7..1fc6b63f 100644
--- a/src/snakeoil/demandload.py
+++ b/src/snakeoil/demandload.py
@@ -131,7 +131,6 @@ else:
 
 
 class Placeholder:
-
     """Object that knows how to replace itself when first accessed.
 
     See the module docstring for common problems with its use.

diff --git a/src/snakeoil/fileutils.py b/src/snakeoil/fileutils.py
index 02355a87..fdd0f23e 100644
--- a/src/snakeoil/fileutils.py
+++ b/src/snakeoil/fileutils.py
@@ -52,7 +52,6 @@ def mmap_or_open_for_read(path: str):
 
 
 class AtomicWriteFile_mixin:
-
     """File class that stores the changes in a tempfile.
 
     Upon invocation of the close method, this class will use

diff --git a/src/snakeoil/obj.py b/src/snakeoil/obj.py
index a8598bfb..6239b207 100644
--- a/src/snakeoil/obj.py
+++ b/src/snakeoil/obj.py
@@ -73,7 +73,6 @@ If that doesn't make sense to the reader, it's probably best 
that the reader not
 try to proxy builtin objects like tuples, lists, dicts, sets, etc.
 """
 
-
 __all__ = ("DelayedInstantiation", "DelayedInstantiation_kls", "make_kls", 
"popattr")
 
 from . import klass

diff --git a/src/snakeoil/osutils/native_readdir.py 
b/src/snakeoil/osutils/native_readdir.py
index 6600a719..d13e1ae1 100644
--- a/src/snakeoil/osutils/native_readdir.py
+++ b/src/snakeoil/osutils/native_readdir.py
@@ -1,6 +1,5 @@
 """Wrapper for readdir which grabs file type from d_type."""
 
-
 import errno
 import os
 from stat import (

diff --git a/src/snakeoil/stringio.py b/src/snakeoil/stringio.py
index 1a392eb4..339ec970 100644
--- a/src/snakeoil/stringio.py
+++ b/src/snakeoil/stringio.py
@@ -44,9 +44,7 @@ class _make_ro_cls(type):
         return x
 
 
-class text_readonly(io.StringIO, metaclass=_make_ro_cls):
-    ...
+class text_readonly(io.StringIO, metaclass=_make_ro_cls): ...
 
 
-class bytes_readonly(io.BytesIO, metaclass=_make_ro_cls):
-    ...
+class bytes_readonly(io.BytesIO, metaclass=_make_ro_cls): ...

diff --git a/src/snakeoil/struct_compat.py b/src/snakeoil/struct_compat.py
index 4ad5615e..66c1290c 100644
--- a/src/snakeoil/struct_compat.py
+++ b/src/snakeoil/struct_compat.py
@@ -17,7 +17,6 @@ base_struct = Struct
 
 # pylint: disable=function-redefined
 class Struct(base_struct):
-
     """
     Struct extension class adding `read` and `write` methods for handling files
     """

diff --git a/src/snakeoil/tar.py b/src/snakeoil/tar.py
index 6f74ef28..9cae35b2 100644
--- a/src/snakeoil/tar.py
+++ b/src/snakeoil/tar.py
@@ -27,7 +27,6 @@ del t
 
 
 class TarInfo(tarfile.TarInfo):
-
     """
     Customized TarInfo implementation.
 

diff --git a/tests/cli/test_arghparse.py b/tests/cli/test_arghparse.py
index d0db449e..c55e786f 100644
--- a/tests/cli/test_arghparse.py
+++ b/tests/cli/test_arghparse.py
@@ -284,9 +284,10 @@ class ParseStdinTest(BaseArgparseOptions):
             (["foo", "bar", "baz"], ["foo", "bar", "baz"]),
             (["\nfoo\n", " bar ", "\nbaz"], ["\nfoo", " bar", "\nbaz"]),
         ):
-            with mock.patch("sys.stdin") as stdin, mock.patch(
-                "builtins.open", mock.mock_open()
-            ) as mock_file:
+            with (
+                mock.patch("sys.stdin") as stdin,
+                mock.patch("builtins.open", mock.mock_open()) as mock_file,
+            ):
                 stdin.readlines.return_value = readlines
                 stdin.isatty.return_value = False
                 namespace = self.parser.parse_args(["-"])

diff --git a/tests/test_osutils.py b/tests/test_osutils.py
index 82959fe4..5b5e7427 100644
--- a/tests/test_osutils.py
+++ b/tests/test_osutils.py
@@ -141,9 +141,10 @@ class TestEnsureDirs:
         path.mkdir()
         path.chmod(0o750)
 
-        with mock.patch("snakeoil.osutils.os.chmod") as chmod, mock.patch(
-            "snakeoil.osutils.os.chown"
-        ) as chown:
+        with (
+            mock.patch("snakeoil.osutils.os.chmod") as chmod,
+            mock.patch("snakeoil.osutils.os.chown") as chown,
+        ):
             chmod.side_effect = OSError(5, "Input/output error")
 
             # chmod failure when file exists and trying to reset perms to match

diff --git a/tests/test_version.py b/tests/test_version.py
index 09927542..23118b36 100644
--- a/tests/test_version.py
+++ b/tests/test_version.py
@@ -23,9 +23,10 @@ class TestVersion:
         assert v.startswith("snakeoil 9.9.9")
 
     def test_get_version_git_dev(self):
-        with mock.patch("snakeoil.version.import_module") as import_module, 
mock.patch(
-            "snakeoil.version.get_git_version"
-        ) as get_git_version:
+        with (
+            mock.patch("snakeoil.version.import_module") as import_module,
+            mock.patch("snakeoil.version.get_git_version") as get_git_version,
+        ):
             import_module.side_effect = ImportError
             verinfo = {
                 "rev": "1ff76b021d208f7df38ac524537b6419404f1c64",
@@ -57,9 +58,10 @@ class TestVersion:
             assert result == f"snakeoil {verinfo['tag']} -- released 
{verinfo['date']}"
 
     def test_get_version_no_git_version(self):
-        with mock.patch("snakeoil.version.import_module") as import_module, 
mock.patch(
-            "snakeoil.version.get_git_version"
-        ) as get_git_version:
+        with (
+            mock.patch("snakeoil.version.import_module") as import_module,
+            mock.patch("snakeoil.version.get_git_version") as get_git_version,
+        ):
             import_module.side_effect = ImportError
             get_git_version.return_value = None
             result = version.get_version("snakeoil", "nonexistent", 
__version__)
@@ -113,9 +115,10 @@ class TestGitVersion:
             assert result == expected
 
     def test_get_git_version_good_tag(self):
-        with mock.patch("snakeoil.version._run_git") as run_git, mock.patch(
-            "snakeoil.version._get_git_tag"
-        ) as get_git_tag:
+        with (
+            mock.patch("snakeoil.version._run_git") as run_git,
+            mock.patch("snakeoil.version._get_git_tag") as get_git_tag,
+        ):
             # tagged, release version
             run_git.return_value = (
                 b"1ff76b021d208f7df38ac524537b6419404f1c64\nMon Sep 25 
13:50:24 2017 -0400",

Reply via email to