Skip to content

Commit cb479f3

Browse files
author
Andrei Neagu
committed
moved imports to more appropriate places
1 parent 0addf04 commit cb479f3

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

packages/models-library/src/models_library/data_streams.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from pydantic import ByteSize
55

6-
FileNameInArchive: TypeAlias = str
76
DataStream: TypeAlias = AsyncIterable[bytes]
87

98
DataStreamCallable: TypeAlias = Callable[[], DataStream]

packages/service-library/src/servicelib/data_streams/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from ._constants import DEFAULT_READ_CHUNK_SIZE
22
from ._input import DiskStreamReader
3-
from ._models import ArchiveEntries, ArchiveFileEntry, StreamData
3+
from ._models import StreamData
44
from ._output import DiskStreamWriter
5-
from ._zipper import get_zip_data_stream
5+
from ._stream_zip import ArchiveEntries, ArchiveFileEntry, get_zip_data_stream
66

77
__all__: tuple[str, ...] = (
88
"ArchiveEntries",
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
from dataclasses import dataclass
2-
from typing import TypeAlias
32

4-
from models_library.data_streams import (
5-
DataSize,
6-
DataStream,
7-
DataStreamCallable,
8-
FileNameInArchive,
9-
)
3+
from models_library.data_streams import DataSize, DataStream, DataStreamCallable
104

115
from ..progress_bar import ProgressBarData
126

@@ -22,7 +16,3 @@ async def with_progress_data_stream(
2216
async for chunk in self.data_stream_callable():
2317
await progress_bar.update(len(chunk))
2418
yield chunk
25-
26-
27-
ArchiveFileEntry: TypeAlias = tuple[FileNameInArchive, StreamData]
28-
ArchiveEntries: TypeAlias = list[ArchiveFileEntry]

packages/service-library/src/servicelib/data_streams/_stream_zip.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
from collections.abc import AsyncIterable
22
from datetime import UTC, datetime
33
from stat import S_IFREG
4+
from typing import TypeAlias
45

56
from models_library.data_streams import DataSize, DataStream
67
from stream_zip import ZIP_32, AsyncMemberFile, async_stream_zip
78

89
from ..progress_bar import ProgressBarData
9-
from ._models import ArchiveEntries
10+
from ._models import StreamData
11+
12+
FileNameInArchive: TypeAlias = str
13+
ArchiveFileEntry: TypeAlias = tuple[FileNameInArchive, StreamData]
14+
ArchiveEntries: TypeAlias = list[ArchiveFileEntry]
1015

1116

1217
async def _member_files_iter(

0 commit comments

Comments
 (0)