Coverage for polar/integrations/aws/s3/client.py: 83%
10 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 12:42 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 12:42 +0000
1from typing import TYPE_CHECKING
3import boto3
4from botocore.config import Config
6from polar.config import settings
8if TYPE_CHECKING: 8 ↛ 9line 8 didn't jump to line 9 because the condition on line 8 was never true
9 from mypy_boto3_s3.client import S3Client
12def get_client(
13 *, signature_version: str = settings.AWS_SIGNATURE_VERSION
14) -> "S3Client":
15 return boto3.client(
16 "s3",
17 endpoint_url=settings.S3_ENDPOINT_URL,
18 aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
19 aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
20 config=Config(
21 region_name=settings.AWS_REGION, signature_version=signature_version
22 ),
23 )
26client = get_client()
28__all__ = ("client", "get_client")