Skip to content

Commit bb080ae

Browse files
authored
Upgrade Geti Tune dependencies (#5026)
1 parent 5492f8e commit bb080ae

File tree

5 files changed

+580
-883
lines changed

5 files changed

+580
-883
lines changed

application/backend/app/repositories/base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from collections.abc import Sequence
55
from datetime import UTC, datetime
66
from sqlite3 import IntegrityError as SQLIntegrityError
7-
from typing import Generic, TypeVar
7+
from typing import Generic, TypeVar, cast
88

9-
from sqlalchemy import delete, exists, select
9+
from sqlalchemy import CursorResult, delete, exists, select
1010
from sqlalchemy.exc import IntegrityError
1111
from sqlalchemy.orm import Session
1212

@@ -61,8 +61,8 @@ def update(self, item: ModelType) -> ModelType:
6161

6262
def delete(self, obj_id: str) -> bool:
6363
stmt = delete(self.model).where(self.model.id == obj_id)
64-
result = self.db.execute(stmt)
65-
return result.rowcount > 0 # type: ignore[union-attr]
64+
result = cast(CursorResult, self.db.execute(stmt))
65+
return result.rowcount > 0
6666

6767
def save_batch(self, items: list[ModelType]) -> list[ModelType]:
6868
now = datetime.now(UTC)
@@ -87,8 +87,8 @@ def update_batch(self, updates: list[ModelType]) -> None:
8787

8888
def delete_batch(self, obj_ids: list[str]) -> int:
8989
stmt = delete(self.model).where(self.model.id.in_(obj_ids))
90-
result = self.db.execute(stmt)
91-
return result.rowcount # type: ignore[union-attr]
90+
result = cast(CursorResult, self.db.execute(stmt))
91+
return result.rowcount
9292

9393
@staticmethod
9494
def _handle_integrity_error(error: IntegrityError) -> None:

application/backend/app/repositories/dataset_item_repo.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Copyright (C) 2025 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
from datetime import UTC, datetime
4-
from typing import NamedTuple
4+
from typing import NamedTuple, cast
55

6-
from sqlalchemy import Select, delete, func, select, update
6+
from sqlalchemy import CursorResult, Select, delete, func, select, update
77
from sqlalchemy.dialects.sqlite import insert
88
from sqlalchemy.orm import Session
99

@@ -125,8 +125,8 @@ def delete(self, obj_id: str) -> bool:
125125
DatasetItemDB.project_id == self.project_id,
126126
DatasetItemDB.id == obj_id,
127127
)
128-
result = self.db.execute(stmt)
129-
return result.rowcount > 0 # type: ignore[union-attr]
128+
result = cast(CursorResult, self.db.execute(stmt))
129+
return result.rowcount > 0
130130

131131
def set_annotation_data(self, obj_id: str, annotation_data: list) -> UpdateDatasetItemAnnotation | None:
132132
stmt = (
@@ -161,8 +161,8 @@ def delete_annotation_data(self, obj_id: str) -> bool:
161161
updated_at=datetime.now(UTC),
162162
)
163163
)
164-
result = self.db.execute(stmt)
165-
return result.rowcount > 0 # type: ignore[union-attr]
164+
result = cast(CursorResult, self.db.execute(stmt))
165+
return result.rowcount > 0
166166

167167
def get_subset(self, obj_id: str) -> str | None:
168168
stmt = (
@@ -187,7 +187,7 @@ def set_subset(self, obj_ids: set[str], subset: str) -> int:
187187
updated_at=datetime.now(UTC),
188188
)
189189
)
190-
result = self.db.execute(stmt)
190+
result = cast(CursorResult, self.db.execute(stmt))
191191
return result.rowcount or 0
192192

193193
def set_labels(self, dataset_item_id: str, label_ids: set[str]) -> None:

application/backend/app/repositories/label_repo.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Copyright (C) 2025 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33
from collections.abc import Sequence
4+
from typing import cast
45

5-
from sqlalchemy import delete, select
6+
from sqlalchemy import CursorResult, delete, select
67
from sqlalchemy.orm import Session
78

89
from app.db.schema import LabelDB
@@ -29,5 +30,5 @@ def list_ids(self) -> Sequence[str]:
2930
def delete_batch(self, obj_ids: list[str]) -> int:
3031
"""Delete labels by IDs within the project."""
3132
stmt = delete(self.model).where((self.model.id.in_(obj_ids)) & (self.model.project_id == self.project_id))
32-
result = self.db.execute(stmt)
33-
return result.rowcount # type: ignore[union-attr]
33+
result = cast(CursorResult, self.db.execute(stmt))
34+
return result.rowcount

application/backend/pyproject.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ name = "geti-tune"
33
version = "0.1.0"
44
description = "Geti Tune"
55
readme = "readme.md"
6-
requires-python = ">=3.13"
6+
requires-python = ">=3.13,<3.14"
77

88
dependencies = [
9-
"fastapi[standard]~=0.115.12",
9+
"fastapi[standard]~=0.121.2",
1010
"hiyapyco==0.7.0",
1111
"openvino-model-api~=0.3.0.4",
12-
"pillow~=11.2",
12+
"pillow~=12.0",
1313
"python-multipart~=0.0.20",
14-
"uvicorn~=0.34.3",
15-
"psutil~=7.0.0",
16-
"pyyaml~=6.0.2",
17-
"openvino==2025.2.0",
14+
"uvicorn~=0.38.0",
15+
"psutil~=7.1.3",
16+
"pyyaml~=6.0.3",
17+
"openvino==2025.3.0",
1818
"watchdog==6.0.0",
19-
"sqlalchemy~=2.0.41",
20-
"alembic~=1.16.4",
21-
"aiofiles==24.1.0",
22-
"pydantic-settings~=2.10.1",
23-
"aiortc~=1.13.0",
19+
"sqlalchemy~=2.0.44",
20+
"alembic~=1.17.2",
21+
"aiofiles==25.1.0",
22+
"pydantic-settings~=2.12.0",
23+
"aiortc~=1.14.0",
2424
"datumaro[experimental] @ git+https://github.com/open-edge-platform/datumaro.git@develop",
25-
"scikit-learn~=1.7.0",
26-
"faster-coco-eval~=1.6.8",
25+
"scikit-learn~=1.7.2",
26+
"faster-coco-eval~=1.7.0",
2727
"scikit-multilearn~=0.2.0",
2828
"loguru~=0.7.3",
2929
"sse-starlette~=3.0.3",

0 commit comments

Comments
 (0)