Skip to content

Commit 2e99bc3

Browse files
committed
Clean up dependencies (boto3)
1 parent 99e53e1 commit 2e99bc3

File tree

3 files changed

+2
-30
lines changed

3 files changed

+2
-30
lines changed

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,15 @@ python = "^3.6"
3636
grequests = "^0.6.0"
3737
requests = "^2.25.1"
3838
tqdm = "^4.60.0"
39-
boto3 = "^1.17.53"
40-
mypy = "^0.812"
41-
coverage = "^5.5"
4239

4340
[tool.poetry.dev-dependencies]
4441
poetry = "^1.1.5"
4542
pytest = "^6.2.3"
4643
pylint = "^2.7.4"
4744
black = "^20.8b1"
4845
flake8 = "^3.9.1"
49-
boto3 = "^1.17.51"
46+
mypy = "^0.812"
47+
coverage = "^5.5"
5048

5149

5250
[build-system]

tests/helpers.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from pathlib import Path
22
from urllib.parse import urlparse
3-
import boto3
43
from nucleus import DatasetItem, BoxPrediction
54
import time
65

@@ -36,30 +35,6 @@
3635
]
3736

3837

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-
6338
def reference_id_from_url(url):
6439
return Path(url).name
6540

tests/test_indexing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pytest
22

33
from helpers import (
4-
get_signed_url,
54
TEST_INDEX_EMBEDDINGS_FILE,
65
TEST_IMG_URLS,
76
TEST_DATASET_NAME,

0 commit comments

Comments
 (0)