File tree Expand file tree Collapse file tree 6 files changed +12
-13
lines changed
service-library/src/servicelib/zip_stream Expand file tree Collapse file tree 6 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 2121from servicelib .utils import limited_gather
2222from servicelib .zip_stream import (
2323 DEFAULT_READ_CHUNK_SIZE ,
24- MULTIPART_UPLOADS_MIN_TOTAL_SIZE ,
2524 FileSize ,
2625 FileStream ,
2726 FileStreamCallable ,
3130from types_aiobotocore_s3 .literals import BucketLocationConstraintType
3231from types_aiobotocore_s3 .type_defs import ObjectIdentifierTypeDef
3332
34- from ._constants import MULTIPART_COPY_THRESHOLD
33+ from ._constants import MULTIPART_UPLOADS_MIN_TOTAL_SIZE
3534from ._error_handler import s3_exception_handler , s3_exception_handler_async_gen
3635from ._errors import S3DestinationNotEmptyError , S3KeyNotFoundError
3736from ._models import (
Original file line number Diff line number Diff line change 66MIN_MULTIPART_UPLOAD_CHUNK_SIZE : Final [int ] = TypeAdapter (ByteSize ).validate_python (
77 "5MiB"
88)
9- MULTIPART_COPY_THRESHOLD : Final [ByteSize ] = TypeAdapter ( ByteSize ). validate_python (
10- "100MiB"
11- )
9+ MULTIPART_UPLOADS_MIN_TOTAL_SIZE : Final [ByteSize ] = TypeAdapter (
10+ ByteSize
11+ ). validate_python ( "100MiB" )
1212
1313PRESIGNED_LINK_MAX_SIZE : Final [ByteSize ] = TypeAdapter (ByteSize ).validate_python ("5GiB" )
1414S3_MAX_FILE_SIZE : Final [ByteSize ] = TypeAdapter (ByteSize ).validate_python ("5TiB" )
Original file line number Diff line number Diff line change 2424import pytest
2525from aiohttp import ClientSession
2626from aws_library .s3 ._client import S3ObjectKey , SimcoreS3API
27+ from aws_library .s3 ._constants import MULTIPART_UPLOADS_MIN_TOTAL_SIZE
2728from aws_library .s3 ._errors import (
2829 S3BucketInvalidError ,
2930 S3DestinationNotEmptyError ,
5960from servicelib .progress_bar import ProgressBarData
6061from servicelib .utils import limited_as_completed
6162from servicelib .zip_stream import (
62- MULTIPART_UPLOADS_MIN_TOTAL_SIZE ,
6363 ArchiveEntries ,
6464 DiskStreamReader ,
6565 get_zip_archive_stream ,
Original file line number Diff line number Diff line change 1- from ._constants import DEFAULT_READ_CHUNK_SIZE , MULTIPART_UPLOADS_MIN_TOTAL_SIZE
1+ from ._constants import DEFAULT_READ_CHUNK_SIZE , MIN_MULTIPART_UPLOAD_CHUNK_SIZE
22from ._input import DiskStreamReader
33from ._output import DiskStreamWriter
44from ._types import (
2020 "FileStream" ,
2121 "FileStreamCallable" ,
2222 "get_zip_archive_stream" ,
23- "MULTIPART_UPLOADS_MIN_TOTAL_SIZE " ,
23+ "MIN_MULTIPART_UPLOAD_CHUNK_SIZE " ,
2424)
Original file line number Diff line number Diff line change 33from pydantic import ByteSize , TypeAdapter
44
55DEFAULT_READ_CHUNK_SIZE : Final [int ] = TypeAdapter (ByteSize ).validate_python ("1MiB" )
6- MULTIPART_UPLOADS_MIN_TOTAL_SIZE : Final [ByteSize ] = TypeAdapter (
7- ByteSize
8- ). validate_python ( "100MiB" )
6+ MIN_MULTIPART_UPLOAD_CHUNK_SIZE : Final [int ] = TypeAdapter ( ByteSize ). validate_python (
7+ "5MiB"
8+ )
Original file line number Diff line number Diff line change 55from stream_zip import ZIP_32 , AsyncMemberFile , async_stream_zip
66
77from ..progress_bar import ProgressBarData
8- from ._constants import MULTIPART_UPLOADS_MIN_TOTAL_SIZE
8+ from ._constants import MIN_MULTIPART_UPLOAD_CHUNK_SIZE
99from ._types import ArchiveEntries , FileSize , FileStream
1010
1111
@@ -26,7 +26,7 @@ async def get_zip_archive_stream(
2626 archive_files : ArchiveEntries ,
2727 * ,
2828 progress_bar : ProgressBarData | None = None ,
29- chunk_size : int = MULTIPART_UPLOADS_MIN_TOTAL_SIZE ,
29+ chunk_size : int = MIN_MULTIPART_UPLOAD_CHUNK_SIZE ,
3030) -> FileStream :
3131 # NOTE: this is CPU bound task, even though the loop is not blocked,
3232 # the CPU is still used for compressing the content.
You can’t perform that action at this time.
0 commit comments