Skip to content

Commit f5a3ce2

Browse files
committed
Swap LIGHTLY_SERVER_LOCATION to api.lightly.ai
Make all requests to the new API by changing the default API in communication.py, adjust the default API in all tests, and in the tox.ini file.
1 parent b9f7680 commit f5a3ce2

14 files changed

+16
-16
lines changed

lightly/api/communication.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from lightly.api.utils import getenv
1111
SERVER_LOCATION = getenv('LIGHTLY_SERVER_LOCATION',
12-
'https://api.whattolabel.com')
12+
'https://api.lightly.ai')
1313

1414

1515
def _post_request(dst_url, data=None, json=None,

tests/api/test_CreateInitialTag.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def setup(self, psuccess=1.):
2121

2222
# set up url
2323
self.dst_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
24-
b'https://api.whattolabel.com').decode()
24+
b'https://api.lightly.ai').decode()
2525
# route
2626
self.dst_url += f'/users/datasets/{self.dataset_id}/tags'
2727

tests/api/test_Get.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def setup(self, psuccess=1.):
1818

1919
# set up url
2020
self.dst_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
21-
b'https://api.whattolabel.com').decode()
21+
b'https://api.lightly.ai').decode()
2222
# route
2323
self.dst_url += '/sample/route/to/get'
2424
# query

tests/api/test_GetLatestVersion.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def setup(self, psuccess=1.):
2020

2121
# set up url
2222
self.dst_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
23-
b'https://api.whattolabel.com').decode()
23+
b'https://api.lightly.ai').decode()
2424
# route
2525
self.dst_url += '/pip/version'
2626
self.version = '0.0.0'

tests/api/test_GetPresignedURL.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def setup(self, n_data=1000, psuccess=1.):
2222

2323
# set up url
2424
self.dst_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
25-
b'https://api.whattolabel.com').decode()
25+
b'https://api.lightly.ai').decode()
2626
# route
2727
self.dst_url += f'/users/datasets/{self.dataset_id}'
2828
self.dst_url += f'/samples/{self.sample_id}/writeurl'

tests/api/test_GetSamples.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ def setup(self, mode='tag_exists', psuccess=1.):
2121
self.token = '123'
2222

2323
self.tag_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
24-
b'https://api.whattolabel.com').decode()
24+
b'https://api.lightly.ai').decode()
2525
self.tag_url += f'/users/datasets/{self.dataset_id}/tags/'
2626
self.tags = [
2727
{'name': 'initial-tag', '_id': '123'},
2828
{'name': 'test-tag', '_id': '456'},
2929
]
3030

3131
self.dst_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
32-
b'https://api.whattolabel.com').decode()
32+
b'https://api.lightly.ai').decode()
3333
self.dst_url += f'/users/datasets/{self.dataset_id}/tags/123/download'
3434
self.samples = 'sample_1.jpg\nsample_2.jpg'
3535

tests/api/test_GetTags.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def setup(self, psuccess=1.):
2525

2626
# set up url
2727
self.dst_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
28-
b'https://api.whattolabel.com').decode()
28+
b'https://api.lightly.ai').decode()
2929
# route
3030
self.dst_url += f'/users/datasets/{self.dataset_id}/tags'
3131
# query

tests/api/test_Post.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def setup(self, psuccess=1.):
1818

1919
# set up url
2020
self.dst_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
21-
b'https://api.whattolabel.com').decode()
21+
b'https://api.lightly.ai').decode()
2222
# route
2323
self.dst_url += '/sample/route/to/post'
2424

tests/api/test_Put.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def setup(self, psuccess=1.):
1818

1919
# set up url
2020
self.dst_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
21-
b'https://api.whattolabel.com').decode()
21+
b'https://api.lightly.ai').decode()
2222
# route
2323
self.dst_url += '/sample/route/to/put'
2424

tests/api/test_UploadEmbedding.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def setup(self, psuccess=1.):
2828
}
2929

3030
self.dst_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
31-
b'https://api.whattolabel.com').decode()
31+
b'https://api.lightly.ai').decode()
3232
self.dst_url += f'/users/datasets/{self.dataset_id}/embeddings'
3333

3434
def callback_1(self, request):

tests/api/test_UploadEmbeddings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def setup(self, n_data=1000):
2121

2222
# set up url
2323
self.dst_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
24-
b'https://api.whattolabel.com').decode()
24+
b'https://api.lightly.ai').decode()
2525
self.emb_url = f'{self.dst_url}/users/datasets/{self.dataset_id}/embeddings'
2626
self.tag_url = f'{self.dst_url}/users/datasets/{self.dataset_id}/tags/?token={self.token}'
2727

tests/api/test_UploadImages.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def setup(self, n_data=1000):
1818
self.dataset_id = 'XYZ'
1919
self.token = 'secret'
2020
self.dst_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
21-
b'https://api.whattolabel.com').decode()
21+
b'https://api.lightly.ai').decode()
2222

2323
self.gettag_url = f'{self.dst_url}/users/datasets/{self.dataset_id}/tags/?token={self.token}'
2424
self.sample_url = f'{self.dst_url}/users/datasets/{self.dataset_id}/samples/'

tests/api/test_UploadSample.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def setup(self, psuccess=1.):
2828
}
2929

3030
self.dst_url = os.getenvb(b'LIGHTLY_SERVER_LOCATION',
31-
b'https://api.whattolabel.com').decode()
31+
b'https://api.lightly.ai').decode()
3232
self.dst_url += f'/users/datasets/{self.dataset_id}/samples/'
3333

3434
def callback(self, request):

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ whitelist_externals = make
1010
pip
1111

1212
passenv = *
13-
setenv = LIGHTLY_SERVER_LOCATION = https://api-dev.whattolabel.com
13+
setenv = LIGHTLY_SERVER_LOCATION = https://api-dev.lightly.ai
1414

1515
commands =
1616
pip install torch==1.5.1+cu101 torchvision==0.6.1+cu101 -f https://download.pytorch.org/whl/torch_stable.html
@@ -25,7 +25,7 @@ whitelist_externals = make
2525
pip
2626

2727
passenv = *
28-
setenv = LIGHTLY_SERVER_LOCATION = https://api-dev.whattolabel.com
28+
setenv = LIGHTLY_SERVER_LOCATION = https://api-dev.lightly.ai
2929
CUDA_VISIBLE_DEVICES = -1
3030

3131
commands =

0 commit comments

Comments
 (0)