Coverage for polar/integrations/aws/s3/client.py: 83%

10 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-12-05 16:17 +0000

1from typing import TYPE_CHECKING 1a

2 

3import boto3 1a

4from botocore.config import Config 1a

5 

6from polar.config import settings 1a

7 

8if TYPE_CHECKING: 8 ↛ 9line 8 didn't jump to line 9 because the condition on line 8 was never true1a

9 from mypy_boto3_s3.client import S3Client 

10 

11 

12def get_client( 1a

13 *, signature_version: str = settings.AWS_SIGNATURE_VERSION 

14) -> "S3Client": 

15 return boto3.client( 1a

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 ) 

24 

25 

26client = get_client() 1a

27 

28__all__ = ("client", "get_client") 1a