Skip to content

Commit

Permalink
Fix end of files and apply formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aris-aiven committed Apr 17, 2024
1 parent c182a72 commit 1f6ca93
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 44 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/01_question.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ about: Got stuck or missing something from the docs? Ask away!
# Where would you expect to find this information?

<!-- Feel free to point us where with links or even proposing new sections or pages in the documentation. -->

1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/02_bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ about: Spotted a problem? Let us know
# What else do we need to know?

<!-- Include your platform, version, and any other information that seems relevant. -->

1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ Resolves: #xxxxx
# Why this way

<!-- Provide a small explanation on why this is the approach you took for solving this problem. -->

1 change: 0 additions & 1 deletion .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ jobs:
git diff-index --quiet HEAD || git commit -m "From $GITHUB_REF $(echo ${GITHUB_SHA} | cut -c 1-8)"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git push
1 change: 0 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ coverage:
if_ci_failed: error #success, failure, error, ignore
only_pulls: false
if_not_found: failure

1 change: 0 additions & 1 deletion docs/api__object_storage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ Swift

.. autoclass:: rohmu.object_storage.swift.SwiftTransfer
:members:

6 changes: 2 additions & 4 deletions rohmu/atomic_opener.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def atomic_opener(
encoding: Optional[str] = None,
_fd_spy: Callable[[int], None] = lambda unused: None,
_after_link_hook: Callable[[], None] = lambda: None,
) -> ContextManager[BinaryIO]:
...
) -> ContextManager[BinaryIO]: ...


@overload
Expand All @@ -43,8 +42,7 @@ def atomic_opener(
encoding: Optional[str] = None,
_fd_spy: Callable[[int], None] = lambda unused: None,
_after_link_hook: Callable[[], None] = lambda: None,
) -> ContextManager[TextIO]:
...
) -> ContextManager[TextIO]: ...


def atomic_opener(
Expand Down
1 change: 1 addition & 0 deletions rohmu/common/strenum.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2023 Aiven, Helsinki, Finland. https://aiven.io/
# See LICENSE for details
"""rohmu - StrEnum"""

from __future__ import annotations

from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions rohmu/compressor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2016 Ohmu Ltd
# See LICENSE for details
"""Rohmu - compressor interface"""

from .errors import InvalidConfigurationError
from .filewrap import Sink, Stream
from .snappyfile import SnappyFile
Expand Down
1 change: 1 addition & 0 deletions rohmu/dates.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2017 Ohmu Ltd
# See LICENSE for details
"""Rohmu - timestamp handling"""

import datetime
import dateutil.parser
import dateutil.tz
Expand Down
1 change: 1 addition & 0 deletions rohmu/encryptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Copyright (c) 2023 Aiven, Helsinki, Finland. https://aiven.io/
See LICENSE for details
"""

from .common.constants import IO_BLOCK_SIZE
from .errors import UninitializedError
from .filewrap import FileWrap, Sink, Stream
Expand Down
1 change: 1 addition & 0 deletions rohmu/filewrap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2016 Ohmu Ltd
# See LICENSE for details
"""Rohmu - file transformation wrapper"""

from .errors import UninitializedError
from .typing import BinaryData, FileLike, HasRead, HasWrite
from typing import Callable, Optional
Expand Down
1 change: 1 addition & 0 deletions rohmu/object_storage/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Copyright (c) 2022 Aiven, Helsinki, Finland. https://aiven.io/
# See LICENSE for details
"""Rohmu - object_storage.base"""

from __future__ import annotations

from contextlib import suppress
Expand Down
3 changes: 1 addition & 2 deletions rohmu/object_storage/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,8 +729,7 @@ def _read_bytes(self, length: int, *, initial_data: Optional[bytes] = None) -> b


class MediaDownloadProtocol(Protocol):
def next_chunk(self) -> tuple[MediaDownloadProgress, bool]:
...
def next_chunk(self) -> tuple[MediaDownloadProgress, bool]: ...


class MediaIoBaseDownloadWithByteRange:
Expand Down
1 change: 1 addition & 0 deletions rohmu/snappyfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2016 Ohmu Ltd
# See LICENSE for details
"""Rohmu - file-like interface for snappy"""

from .common.constants import IO_BLOCK_SIZE
from .filewrap import FileWrap
from .typing import BinaryData, FileLike
Expand Down
48 changes: 16 additions & 32 deletions rohmu/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,68 +34,52 @@


class HasFileno(Protocol):
def fileno(self) -> int:
...
def fileno(self) -> int: ...


class HasRead(Protocol):
def read(self, n: int = -1, /) -> bytes:
...
def read(self, n: int = -1, /) -> bytes: ...


class HasWrite(Protocol):
def write(self, data: BinaryData) -> int:
...
def write(self, data: BinaryData) -> int: ...


class HasSeek(Protocol):
def seek(self, offset: int, whence: int = 0, /) -> int:
...
def seek(self, offset: int, whence: int = 0, /) -> int: ...


class HasName(Protocol):
name: str


class FileLike(Protocol):
def __enter__(self) -> FileLike:
...
def __enter__(self) -> FileLike: ...

def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> None:
...
) -> None: ...

def read(self, n: int = -1, /) -> bytes:
...
def read(self, n: int = -1, /) -> bytes: ...

def flush(self) -> None:
...
def flush(self) -> None: ...

def write(self, data: BinaryData) -> int:
...
def write(self, data: BinaryData) -> int: ...

def close(self) -> None:
...
def close(self) -> None: ...

def fileno(self) -> int:
...
def fileno(self) -> int: ...

def tell(self) -> int:
...
def tell(self) -> int: ...

def seek(self, offset: int, whence: int = 0, /) -> int:
...
def seek(self, offset: int, whence: int = 0, /) -> int: ...


class Compressor(Protocol):
def compress(self, data: bytes) -> bytes:
...
def compress(self, data: bytes) -> bytes: ...

def flush(self) -> bytes:
...
def flush(self) -> bytes: ...


class Decompressor(Protocol):
def decompress(self, data: bytes) -> bytes:
...
def decompress(self, data: bytes) -> bytes: ...
1 change: 1 addition & 0 deletions rohmu/util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2022 Ohmu Ltd
# See LICENSE for details
"""Rohmu - common utility functions"""

from __future__ import annotations

from io import BytesIO, UnsupportedOperation
Expand Down
1 change: 1 addition & 0 deletions rohmu/zstdfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2016 Ohmu Ltd
# See LICENSE for details
"""Rohmu - file-like interface for zstd"""

from .common.constants import IO_BLOCK_SIZE
from .filewrap import FileWrap
from .typing import BinaryData, FileLike
Expand Down
1 change: 1 addition & 0 deletions test/common/test_statsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
This could be broader, but at least minimal functionality is tested here.
"""

from __future__ import annotations

from rohmu.common import statsd
Expand Down
1 change: 1 addition & 0 deletions test/test_dates.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2017 Ohmu Ltd
# See LICENSE for details
"""Rohmu test case"""

from rohmu.dates import parse_timestamp

import datetime
Expand Down

0 comments on commit 1f6ca93

Please sign in to comment.