From 8c17413af1884ba8371e0f69b98906688f844d51 Mon Sep 17 00:00:00 2001 From: Nolan Burfield Date: Wed, 11 Jun 2025 23:31:49 -0700 Subject: [PATCH] update with s3 endpoint --- lib_afr_s3storage/s3storage.py | 8 ++++++-- setup.py | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib_afr_s3storage/s3storage.py b/lib_afr_s3storage/s3storage.py index 36b3a2d..b1a81c1 100755 --- a/lib_afr_s3storage/s3storage.py +++ b/lib_afr_s3storage/s3storage.py @@ -17,7 +17,7 @@ class S3Storage: S3Storage class """ - def __init__( self, access_key=None, secret_access_key=None, data_center="us-lax-1" ): + def __init__( self, access_key=None, secret_access_key=None, data_center="us-lax-1", endpoint=None ): """ __init__ Init S3 Storage class. @@ -29,6 +29,10 @@ class S3Storage: self.access_key = access_key self.secret_access_key = secret_access_key self.data_center = data_center + self.endpoint = endpoint + + if endpoint is None: + self.endpoint = f"https://{data_center}.linodeobjects.com" self.client = None @@ -46,7 +50,7 @@ class S3Storage: linode_obj_config = { "aws_access_key_id": self.access_key, "aws_secret_access_key": self.secret_access_key, - "endpoint_url": f"https://{self.data_center}.linodeobjects.com", + "endpoint_url": self.endpoint, } self.client = boto3.client("s3", **linode_obj_config) diff --git a/setup.py b/setup.py index 03c8e03..2cdd1b7 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ with open('README.md', 'r') as f: setup( name='lib_afr_s3storage', - version='1.0.2', + version='2.0.0', author='', author_email='', description='', @@ -20,7 +20,7 @@ setup( packages=find_packages(), python_requires='>=3.7', install_requires=[ - 'boto3==1.33.6', - 'smart-open==6.4.0', + 'boto3==1.38.35', + 'smart-open==7.1.0', ], )