Skip to content

Commit 65f6c74

Browse files
author
Matt Sokoloff
committed
Merge branch 'develop' of https://github.com/Labelbox/labelbox-python into ms/data-row-upload-mimetype
2 parents eaba770 + 0cc92fa commit 65f6c74

File tree

13 files changed

+55
-12
lines changed

13 files changed

+55
-12
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Changelog
22

3-
# Version 3.18.1 (2022-04-14)
3+
# Version 3.19.1 (2022-04-14)
44
## Fix
55
* `create_data_rows` and `create_data_rows_sync` now uploads the file with a mimetype
66
* Orgs that only allow DA uploads were getting errors when using these functions
77

8+
# Version 3.19.0 (2022-04-12)
9+
## Added
10+
* Added Tool object type RASTER_SEGMENTATION for Video and DICOM ontologies
11+
812
# Version 3.18.0 (2022-04-07)
913
## Added
1014
* Added beta support for exporting labels from model_runs

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@ test-prod: build
1919
docker run -it -v ${PWD}:/usr/src -w /usr/src \
2020
-e LABELBOX_TEST_ENVIRON="prod" \
2121
-e LABELBOX_TEST_API_KEY_PROD=${LABELBOX_TEST_API_KEY_PROD} \
22+
local/labelbox-python:test pytest $(PATH_TO_TEST)
23+
24+
test-onprem: build
25+
docker run -it -v ${PWD}:/usr/src -w /usr/src \
26+
-e LABELBOX_TEST_ENVIRON="onprem" \
27+
-e LABELBOX_TEST_API_KEY_ONPREM=${LABELBOX_TEST_API_KEY_ONPREM} \
28+
-e LABELBOX_TEST_ONPREM_HOSTNAME=${LABELBOX_TEST_ONPREM_HOSTNAME} \
2229
local/labelbox-python:test pytest $(PATH_TO_TEST)

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
| Notebook | Github | Google Colab |
1212
| --------------------------- | --------------------------------- | ------------ |
1313
| Fundamentals | [Github](basics/basics.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/basics/basics.ipynb) |
14+
| Batches | [Github](basics/batches.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/basics/batches.ipynb) |
1415
| Data Rows | [Github](basics/data_rows.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/basics/data_rows.ipynb) |
1516
| Data Row Metadata | [Github](basics/data_row_metadata.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/basics/data_row_metadata.ipynb) |
1617
| Datasets | [Github](basics/datasets.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/basics/datasets.ipynb) |

examples/basics/batches.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
},
2121
"source": [
2222
"<td>\n",
23-
"<a href=\"https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/basics/data_rows.ipynb\" target=\"_blank\"><img\n",
23+
"<a href=\"https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/basics/batches.ipynb\" target=\"_blank\"><img\n",
2424
"src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"></a>\n",
2525
"</td>\n",
2626
"\n",
2727
"<td>\n",
28-
"<a href=\"https://github.com/Labelbox/labelbox-python/tree/develop/examples/basics/data_rows.ipynb\" target=\"_blank\"><img\n",
28+
"<a href=\"https://github.com/Labelbox/labelbox-python/blob/develop/examples/basics/batches.ipynb\" target=\"_blank\"><img\n",
2929
"src=\"https://img.shields.io/badge/GitHub-100000?logo=github&logoColor=white\" alt=\"GitHub\"></a>\n",
3030
"</td>"
3131
]

labelbox/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "labelbox"
2-
__version__ = "3.18.1"
2+
__version__ = "3.19.1"
33

44
from labelbox.client import Client
55
from labelbox.schema.project import Project

labelbox/schema/ontology.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ class Tool:
225225
class Type(Enum):
226226
POLYGON = "polygon"
227227
SEGMENTATION = "superpixel"
228+
RASTER_SEGMENTATION = "raster-segmentation"
228229
POINT = "point"
229230
BBOX = "rectangle"
230231
LINE = "line"

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[pytest]
2-
addopts = -s -vv --reruns 5 --reruns-delay 10
2+
addopts = -s -vv -x --reruns 5 --reruns-delay 10
33
markers =
44
slow: marks tests as slow (deselect with '-m "not slow"')

tests/integration/annotation_import/test_label_import.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,18 @@ def test_create_from_url(client, project, annotation_import_test_helpers):
2020
annotation_import_test_helpers.check_running_state(label_import, name, url)
2121

2222

23-
def test_create_from_objects(client, project, object_predictions,
23+
def test_create_from_objects(client, configured_project, object_predictions,
2424
annotation_import_test_helpers):
25+
"""this test should check running state only to validate running, not completed"""
2526
name = str(uuid.uuid4())
2627

27-
label_import = LabelImport.create_from_objects(client=client,
28-
project_id=project.uid,
29-
name=name,
30-
labels=object_predictions)
31-
assert label_import.parent_id == project.uid
28+
label_import = LabelImport.create_from_objects(
29+
client=client,
30+
project_id=configured_project.uid,
31+
name=name,
32+
labels=object_predictions)
33+
34+
assert label_import.parent_id == configured_project.uid
3235
annotation_import_test_helpers.check_running_state(label_import, name)
3336
annotation_import_test_helpers.assert_file_content(
3437
label_import.input_file_url, object_predictions)

tests/integration/annotation_import/test_model_run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import time
2+
import os
3+
import pytest
24

35

46
def test_model_run(client, configured_project_with_label, rand_gen):
@@ -84,6 +86,8 @@ def test_model_run_export_labels(model_run_with_model_run_data_rows):
8486
assert len(labels) == 3
8587

8688

89+
@pytest.mark.skipif(condition=os.environ['LABELBOX_TEST_ENVIRON'] == "onprem",
90+
reason="does not work for onprem")
8791
def test_model_run_status(model_run_with_model_run_data_rows):
8892

8993
def get_model_run_status():

tests/integration/conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Environ(Enum):
2424
LOCAL = 'local'
2525
PROD = 'prod'
2626
STAGING = 'staging'
27+
ONPREM = 'onprem'
2728

2829

2930
@pytest.fixture(scope="session")
@@ -46,6 +47,12 @@ def graphql_url(environ: str) -> str:
4647
return 'https://api.labelbox.com/graphql'
4748
elif environ == Environ.STAGING:
4849
return 'https://staging-api.labelbox.com/graphql'
50+
elif environ == Environ.ONPREM:
51+
hostname = os.environ.get('LABELBOX_TEST_ONPREM_HOSTNAME', None)
52+
if hostname is None:
53+
raise Exception(f"Missing LABELBOX_TEST_ONPREM_INSTANCE")
54+
instance_id = hostname.split("-")[1].split(".")[0]
55+
return f"https://app.replicated-{instance_id}.labelbox.dev/api/_gql"
4956
return 'http://host.docker.internal:8080/graphql'
5057

5158

@@ -54,6 +61,8 @@ def testing_api_key(environ: str) -> str:
5461
return os.environ["LABELBOX_TEST_API_KEY_PROD"]
5562
elif environ == Environ.STAGING:
5663
return os.environ["LABELBOX_TEST_API_KEY_STAGING"]
64+
elif environ == Environ.ONPREM:
65+
return os.environ["LABELBOX_TEST_API_KEY_ONPREM"]
5766
return os.environ["LABELBOX_TEST_API_KEY_LOCAL"]
5867

5968

0 commit comments

Comments
 (0)