diff options
author | 2024-01-26 11:03:13 +0200 | |
---|---|---|
committer | 2024-01-26 11:03:13 +0200 | |
commit | 21b0291a014d17bc4681ae66b0d900c96279fc53 (patch) | |
tree | 318c09ca9ab005c2e1ed0a7b6f965e10a6878e08 | |
parent | authors: Add myself to the list. (diff) | |
download | snakeoil-21b0291a014d17bc4681ae66b0d900c96279fc53.tar.gz snakeoil-21b0291a014d17bc4681ae66b0d900c96279fc53.tar.bz2 snakeoil-21b0291a014d17bc4681ae66b0d900c96279fc53.zip |
reformat with black 24
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r-- | src/snakeoil/constraints.py | 6 | ||||
-rw-r--r-- | src/snakeoil/containers.py | 3 | ||||
-rw-r--r-- | src/snakeoil/data_source.py | 3 | ||||
-rw-r--r-- | src/snakeoil/demandload.py | 1 | ||||
-rw-r--r-- | src/snakeoil/fileutils.py | 1 | ||||
-rw-r--r-- | src/snakeoil/obj.py | 1 | ||||
-rw-r--r-- | src/snakeoil/osutils/native_readdir.py | 1 | ||||
-rw-r--r-- | src/snakeoil/stringio.py | 6 | ||||
-rw-r--r-- | src/snakeoil/struct_compat.py | 1 | ||||
-rw-r--r-- | src/snakeoil/tar.py | 1 | ||||
-rw-r--r-- | tests/cli/test_arghparse.py | 7 | ||||
-rw-r--r-- | tests/test_osutils.py | 7 | ||||
-rw-r--r-- | 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 c239727..5fe46ec 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 ebfc1b3..ee14baf 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 3b0ccb1..bb265d9 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 bfa6dce..1fc6b63 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 02355a8..fdd0f23 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 a8598bf..6239b20 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 6600a71..d13e1ae 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 1a392eb..339ec97 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 4ad5615..66c1290 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 6f74ef2..9cae35b 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 d0db449..c55e786 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 82959fe..5b5e742 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 0992754..23118b3 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", |