awsimple 3.3.0__py3-none-any.whl → 3.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- awsimple/__version__.py +1 -1
- awsimple/s3.py +5 -4
- {awsimple-3.3.0.dist-info → awsimple-3.4.0.dist-info}/METADATA +3 -3
- {awsimple-3.3.0.dist-info → awsimple-3.4.0.dist-info}/RECORD +8 -8
- {awsimple-3.3.0.dist-info → awsimple-3.4.0.dist-info}/WHEEL +1 -1
- {awsimple-3.3.0.dist-info → awsimple-3.4.0.dist-info}/LICENSE +0 -0
- {awsimple-3.3.0.dist-info → awsimple-3.4.0.dist-info}/LICENSE.txt +0 -0
- {awsimple-3.3.0.dist-info → awsimple-3.4.0.dist-info}/top_level.txt +0 -0
awsimple/__version__.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
__application_name__ = "awsimple"
|
|
2
2
|
__title__ = __application_name__
|
|
3
3
|
__author__ = "abel"
|
|
4
|
-
__version__ = "3.
|
|
4
|
+
__version__ = "3.4.0"
|
|
5
5
|
__author_email__ = "j@abel.co"
|
|
6
6
|
__url__ = "https://github.com/jamesabel/awsimple"
|
|
7
7
|
__download_url__ = "https://github.com/jamesabel/awsimple"
|
awsimple/s3.py
CHANGED
|
@@ -18,7 +18,6 @@ from botocore.client import Config
|
|
|
18
18
|
from botocore.exceptions import ClientError, EndpointConnectionError, ConnectionClosedError, SSLError
|
|
19
19
|
from boto3.s3.transfer import TransferConfig
|
|
20
20
|
from s3transfer import S3UploadFailedError
|
|
21
|
-
import urllib3
|
|
22
21
|
import urllib3.exceptions
|
|
23
22
|
from typeguard import typechecked
|
|
24
23
|
from hashy import get_string_sha512, get_file_sha512, get_bytes_sha512, get_dls_sha512 # type: ignore
|
|
@@ -33,6 +32,8 @@ json_extension = ".json"
|
|
|
33
32
|
|
|
34
33
|
log = getLogger(__application_name__)
|
|
35
34
|
|
|
35
|
+
connection_errors = (S3UploadFailedError, ClientError, EndpointConnectionError, SSLError, urllib3.exceptions.ProtocolError, ConnectionClosedError)
|
|
36
|
+
|
|
36
37
|
|
|
37
38
|
class BucketNotFound(AWSimpleException):
|
|
38
39
|
def __init__(self, bucket_name):
|
|
@@ -232,7 +233,7 @@ class S3Access(CacheAccess):
|
|
|
232
233
|
try:
|
|
233
234
|
self.client.upload_file(str(file_path), self.bucket_name, s3_key, ExtraArgs=extra_args, Config=self.get_s3_transfer_config())
|
|
234
235
|
uploaded_flag = True
|
|
235
|
-
except
|
|
236
|
+
except connection_errors as e:
|
|
236
237
|
log.warning(f"{file_path} to {self.bucket_name}:{s3_key} : {transfer_retry_count=} : {e}")
|
|
237
238
|
time.sleep(self.retry_sleep_time)
|
|
238
239
|
except RuntimeError as e:
|
|
@@ -284,7 +285,7 @@ class S3Access(CacheAccess):
|
|
|
284
285
|
else:
|
|
285
286
|
s3_object.put(Body=json_as_bytes, Metadata=meta_data)
|
|
286
287
|
uploaded_flag = True
|
|
287
|
-
except
|
|
288
|
+
except connection_errors as e:
|
|
288
289
|
log.warning(f"{self.bucket_name}:{s3_key} : {transfer_retry_count=} : {e}")
|
|
289
290
|
transfer_retry_count += 1
|
|
290
291
|
time.sleep(self.retry_sleep_time)
|
|
@@ -327,7 +328,7 @@ class S3Access(CacheAccess):
|
|
|
327
328
|
mtime_ts = s3_object_metadata.mtime.timestamp()
|
|
328
329
|
os.utime(dest_path, (mtime_ts, mtime_ts)) # set the file mtime to the mtime in S3
|
|
329
330
|
success = True
|
|
330
|
-
except
|
|
331
|
+
except connection_errors as e:
|
|
331
332
|
# ProtocolError can happen for a broken connection
|
|
332
333
|
log.warning(f"{self.bucket_name}/{s3_key} to {dest_path} ({Path(dest_path).absolute()}) : {transfer_retry_count=} : {e}")
|
|
333
334
|
time.sleep(self.retry_sleep_time)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: awsimple
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.4.0
|
|
4
4
|
Summary: Simple AWS API for S3, DynamoDB, SNS, and SQS
|
|
5
5
|
Home-page: https://github.com/jamesabel/awsimple
|
|
6
6
|
Download-URL: https://github.com/jamesabel/awsimple
|
|
@@ -14,8 +14,8 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
License-File: LICENSE.txt
|
|
16
16
|
Requires-Dist: boto3
|
|
17
|
-
Requires-Dist: typeguard
|
|
18
|
-
Requires-Dist: hashy
|
|
17
|
+
Requires-Dist: typeguard<3
|
|
18
|
+
Requires-Dist: hashy>=0.1.1
|
|
19
19
|
Requires-Dist: dictim
|
|
20
20
|
Requires-Dist: appdirs
|
|
21
21
|
Requires-Dist: tobool
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
awsimple/__init__.py,sha256=8aFfqWFAvRPweoZkKncvHAW2ytTW_5-AJ0nnmYqgUBw,916
|
|
2
|
-
awsimple/__version__.py,sha256=
|
|
2
|
+
awsimple/__version__.py,sha256=QeAaw-gHVlOTWxX7VxuppELAYFtQHcjChg8cH2N11_Q,323
|
|
3
3
|
awsimple/aws.py,sha256=n5Mte2l0uUyLtxHx-Cv2RdVF2H2pvNiQPlrwrwddKcc,7636
|
|
4
4
|
awsimple/cache.py,sha256=tdLeMw2IYW9Y4lGT2SAGUI7u_aTX_TFQs2udXcqW6fI,7163
|
|
5
5
|
awsimple/dynamodb.py,sha256=xVPnRdedm19ORpmC1G0fMaQMnf9D72Ebq2lXKSLgtmc,39076
|
|
@@ -7,12 +7,12 @@ awsimple/dynamodb_miv.py,sha256=4xPxQDYkIM-BVDGyAre6uqwJHsxguEbHbof8ztt-V7g,4645
|
|
|
7
7
|
awsimple/logs.py,sha256=A2RmTT90pfFTthfENd7GSsEHSIBJXO8ICHPdA7sEsHY,4278
|
|
8
8
|
awsimple/mock.py,sha256=eScbnxFF9xAosOAsL-NZgp_P-fezB6StQMkb85Y3TNo,574
|
|
9
9
|
awsimple/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
awsimple/s3.py,sha256=
|
|
10
|
+
awsimple/s3.py,sha256=lwMS8Xr06TB2LkQ7z8yaK6pnH9oOFU3-DEI3Ba6dEwo,23874
|
|
11
11
|
awsimple/sns.py,sha256=dOx3VUS04xxeG1krGudN4A5fqoIpXeHqXNkBvfbr_6Q,3292
|
|
12
12
|
awsimple/sqs.py,sha256=ejV9twP15X8-mZ9IHGEUlYWqufEcasYuPf1xlGQt2a8,15506
|
|
13
|
-
awsimple-3.
|
|
14
|
-
awsimple-3.
|
|
15
|
-
awsimple-3.
|
|
16
|
-
awsimple-3.
|
|
17
|
-
awsimple-3.
|
|
18
|
-
awsimple-3.
|
|
13
|
+
awsimple-3.4.0.dist-info/LICENSE,sha256=d956YAgtDaxgxQmccyUk__EfhORZyBjvmJ8pq6zYTxk,1093
|
|
14
|
+
awsimple-3.4.0.dist-info/LICENSE.txt,sha256=d956YAgtDaxgxQmccyUk__EfhORZyBjvmJ8pq6zYTxk,1093
|
|
15
|
+
awsimple-3.4.0.dist-info/METADATA,sha256=nNYscDeRiwPL6X9UU36J7foOlyC9oiKUawl8VLdimGw,6087
|
|
16
|
+
awsimple-3.4.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
|
17
|
+
awsimple-3.4.0.dist-info/top_level.txt,sha256=mwqCoH_8vAaK6iYioiRbasXmVCQM7AK3grNWOKp2VHE,9
|
|
18
|
+
awsimple-3.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|