Skip to content

Commit 2b57dc5

Browse files
authored
Merge branch 'develop' into mm/sdk-0-fix-test
2 parents ab67e6e + b0aace2 commit 2b57dc5

File tree

5 files changed

+18
-32
lines changed

5 files changed

+18
-32
lines changed

libs/labelbox/pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ dependencies = [
1111
"strenum>=0.4.15",
1212
"tqdm>=4.66.2",
1313
"geojson>=3.1.0",
14-
"mypy==1.10.1",
1514
"lbox-clients==1.1.2",
1615
]
1716
readme = "README.md"

libs/labelbox/src/labelbox/schema/timeunit.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class TimeUnit(Enum):
1414
WEEK (int): 604800 seconds (7 days)
1515
"""
1616

17-
SECOND: int = 1
18-
MINUTE: int = 60
19-
HOUR: int = 60 * 60
20-
DAY: int = 24 * 60 * 60
21-
WEEK: int = 7 * 24 * 60 * 60
17+
SECOND = 1
18+
MINUTE = 60
19+
HOUR = 60 * 60
20+
DAY = 24 * 60 * 60
21+
WEEK = 7 * 24 * 60 * 60

libs/labelbox/tests/integration/test_api_keys.py

+13-14
Original file line numberDiff line numberDiff line change
@@ -235,17 +235,16 @@ def test_create_api_key_insufficient_permissions(client):
235235
"""Test that creating an API key fails when the user has insufficient permissions."""
236236
user_email = client.get_user().email
237237

238-
assert client.get_user().org_role().name == "Admin"
239-
240-
# Attempt to create another API key using the limited permissions client
241-
# This should fail due to insufficient permissions
242-
with pytest.raises(LabelboxError) as excinfo:
243-
client.create_api_key(
244-
name=f"Test Key {uuid.uuid4()}",
245-
user=user_email,
246-
role="Admin",
247-
validity=5,
248-
time_unit=TimeUnit.MINUTE,
249-
)
250-
251-
assert "192" in str(excinfo.value)
238+
if client.get_user().org_role().name != "Admin":
239+
# Attempt to create another API key using the limited permissions client
240+
# This should fail due to insufficient permissions
241+
with pytest.raises(LabelboxError) as excinfo:
242+
client.create_api_key(
243+
name=f"Test Key {uuid.uuid4()}",
244+
user=user_email,
245+
role="Admin",
246+
validity=5,
247+
time_unit=TimeUnit.MINUTE,
248+
)
249+
250+
assert "192" in str(excinfo.value)

requirements-dev.lock

-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
# features: []
77
# all-features: true
88
# with-sources: false
9-
# generate-hashes: false
10-
# universal: false
119

1210
-e file:libs/labelbox
1311
-e file:libs/lbox-clients
@@ -125,7 +123,6 @@ matplotlib-inline==0.1.7
125123
mistune==3.0.2
126124
# via nbconvert
127125
mypy==1.10.1
128-
# via labelbox
129126
mypy-extensions==1.0.0
130127
# via black
131128
# via mypy

requirements.lock

-9
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
# features: []
77
# all-features: true
88
# with-sources: false
9-
# generate-hashes: false
10-
# universal: false
119

1210
-e file:libs/labelbox
1311
-e file:libs/lbox-clients
@@ -52,10 +50,6 @@ jinja2==3.1.4
5250
# via sphinx
5351
markupsafe==2.1.5
5452
# via jinja2
55-
mypy==1.10.1
56-
# via labelbox
57-
mypy-extensions==1.0.0
58-
# via mypy
5953
numpy==2.0.2
6054
# via labelbox
6155
# via opencv-python-headless
@@ -123,15 +117,12 @@ sphinxcontrib-serializinghtml==1.1.5
123117
# via sphinx
124118
strenum==0.4.15
125119
# via labelbox
126-
tomli==2.2.1
127-
# via mypy
128120
tqdm==4.66.4
129121
# via labelbox
130122
typeguard==4.3.0
131123
# via labelbox
132124
typing-extensions==4.12.2
133125
# via labelbox
134-
# via mypy
135126
# via pydantic
136127
# via pydantic-core
137128
# via typeguard

0 commit comments

Comments
 (0)