File tree Expand file tree Collapse file tree 3 files changed +2
-30
lines changed Expand file tree Collapse file tree 3 files changed +2
-30
lines changed Original file line number Diff line number Diff line change @@ -36,17 +36,15 @@ python = "^3.6"
36
36
grequests = " ^0.6.0"
37
37
requests = " ^2.25.1"
38
38
tqdm = " ^4.60.0"
39
- boto3 = " ^1.17.53"
40
- mypy = " ^0.812"
41
- coverage = " ^5.5"
42
39
43
40
[tool .poetry .dev-dependencies ]
44
41
poetry = " ^1.1.5"
45
42
pytest = " ^6.2.3"
46
43
pylint = " ^2.7.4"
47
44
black = " ^20.8b1"
48
45
flake8 = " ^3.9.1"
49
- boto3 = " ^1.17.51"
46
+ mypy = " ^0.812"
47
+ coverage = " ^5.5"
50
48
51
49
52
50
[build-system ]
Original file line number Diff line number Diff line change 1
1
from pathlib import Path
2
2
from urllib .parse import urlparse
3
- import boto3
4
3
from nucleus import DatasetItem , BoxPrediction
5
4
import time
6
5
36
35
]
37
36
38
37
39
- def get_signed_url (url ):
40
- bucket , key = get_s3_details (url )
41
- return s3_sign (bucket , key )
42
-
43
-
44
- def get_s3_details (url ):
45
- # Expects S3 URL format to be https://<BUCKET>.s3.amazonaws.com/<KEY>
46
- parsed = urlparse (url )
47
- bucket = parsed .netloc [: parsed .netloc .find ("." )]
48
- return bucket , parsed .path [1 :]
49
-
50
-
51
- def s3_sign (bucket , key ):
52
- s3 = boto3 .client ("s3" )
53
- return s3 .generate_presigned_url (
54
- ClientMethod = "get_object" ,
55
- Params = {
56
- "Bucket" : bucket ,
57
- "Key" : key ,
58
- },
59
- ExpiresIn = PRESIGN_EXPIRY_SECONDS ,
60
- )
61
-
62
-
63
38
def reference_id_from_url (url ):
64
39
return Path (url ).name
65
40
Original file line number Diff line number Diff line change 1
1
import pytest
2
2
3
3
from helpers import (
4
- get_signed_url ,
5
4
TEST_INDEX_EMBEDDINGS_FILE ,
6
5
TEST_IMG_URLS ,
7
6
TEST_DATASET_NAME ,
You can’t perform that action at this time.
0 commit comments