Skip to content

Commit 3e84de7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent b537d3f commit 3e84de7

File tree

14 files changed

+26
-18
lines changed

14 files changed

+26
-18
lines changed

.github/workflows/check_release_tag.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Check that the GitHub release tag matches the package version."""
2+
23
import argparse
34
import pathlib
45
import re

disk_objectstore/container.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
The main implementation of the ``Container`` class of the object store.
33
"""
4+
45
# pylint: disable=too-many-lines
56
import dataclasses
67
import io
@@ -176,14 +177,12 @@ def _get_config_file(self) -> Path:
176177
@overload
177178
def _get_session(
178179
self, create: bool = False, raise_if_missing: Literal[True] = True
179-
) -> Session:
180-
...
180+
) -> Session: ...
181181

182182
@overload
183183
def _get_session(
184184
self, create: bool = False, raise_if_missing: Literal[False] = False
185-
) -> Optional[Session]:
186-
...
185+
) -> Optional[Session]: ...
187186

188187
def _get_session(
189188
self, create: bool = False, raise_if_missing: bool = False
@@ -521,17 +520,15 @@ def _get_objects_stream_meta_generator(
521520
hashkeys: Sequence[str],
522521
skip_if_missing: bool,
523522
with_streams: Literal[False],
524-
) -> Iterator[Tuple[str, ObjectMeta]]:
525-
...
523+
) -> Iterator[Tuple[str, ObjectMeta]]: ...
526524

527525
@overload
528526
def _get_objects_stream_meta_generator(
529527
self,
530528
hashkeys: Sequence[str],
531529
skip_if_missing: bool,
532530
with_streams: Literal[True],
533-
) -> Iterator[Tuple[str, Optional[StreamSeekBytesType], ObjectMeta]]:
534-
...
531+
) -> Iterator[Tuple[str, Optional[StreamSeekBytesType], ObjectMeta]]: ...
535532

536533
def _get_objects_stream_meta_generator( # pylint: disable=too-many-branches,too-many-statements,too-many-locals
537534
self,
@@ -2653,9 +2650,9 @@ def repack_pack( # pylint: disable=too-many-branches,too-many-statements
26532650
source_compressed,
26542651
) in session.execute(stmt):
26552652
# This is the read handle of the bytes in the pack - it might be
2656-
read_handle: Union[
2657-
PackedObjectReader, ZlibStreamDecompresser
2658-
] = PackedObjectReader(read_pack, offset, length)
2653+
read_handle: Union[PackedObjectReader, ZlibStreamDecompresser] = (
2654+
PackedObjectReader(read_pack, offset, length)
2655+
)
26592656

26602657
# Determine if I should compress or not the destination - this function will
26612658
# try to do it in a cheap way (e.g. if the source is already compressed, will just

disk_objectstore/database.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Models for the container index file (SQLite DB)."""
2+
23
from pathlib import Path
34
from typing import Optional
45

disk_objectstore/dataclasses.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Definition of the dataclasses used as return values of
33
a number of methods.
44
"""
5+
56
from dataclasses import asdict, dataclass
67
from typing import TYPE_CHECKING, List, Optional, Union
78

disk_objectstore/utils.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Some might be useful also for end users, like the wrappers to get streams,
44
like the ``LazyOpener``.
55
"""
6+
67
# pylint: disable= too-many-lines
78
from __future__ import annotations
89

@@ -809,9 +810,9 @@ def __init__(
809810
self._decompressor = self.decompressobj_class()
810811
self._internal_buffer = b""
811812
self._pos = 0
812-
self._lazy_uncompressed_stream: None | (
813-
LazyLooseStream
814-
) = lazy_uncompressed_stream
813+
self._lazy_uncompressed_stream: None | (LazyLooseStream) = (
814+
lazy_uncompressed_stream
815+
)
815816
# If True, this class just proxies request to the underlying
816817
# uncompressed stream
817818
self._use_uncompressed_stream: bool = False
@@ -1326,11 +1327,9 @@ def safe_flush_to_disk(
13261327
fhandle.flush()
13271328

13281329
# Default fsync function, replaced on Mac OS X
1329-
_fsync_function: Callable[
1330-
[Any], Any
1331-
] = lambda fileno: os.fsync( # pylint: disable=unnecessary-lambda
1330+
_fsync_function: Callable[[Any], Any] = lambda fileno: os.fsync(
13321331
fileno
1333-
)
1332+
) # pylint: disable=unnecessary-lambda
13341333

13351334
# Flush to disk
13361335
if hasattr(fcntl, "F_FULLFSYNC") is not None and (

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Configuration file for pytest tests."""
2+
23
import hashlib
34
import os
45
import random

tests/test_basic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
This is also a way to verify the behavior of the underlying OS/filesystem.
44
"""
5+
56
import os
67
import subprocess
78
import sys

tests/test_benchmark.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test the performance of the container implementation."""
2+
23
import hashlib
34
import random
45

tests/test_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test the CLI commands"""
2+
23
import platform
34
from pathlib import Path
45

tests/test_concurrency.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test of the object-store container module."""
2+
23
import os
34
import subprocess
45
import sys

0 commit comments

Comments
 (0)