Skip to content

Commit 29a0535

Browse files
authored
chore(deps)!: bump supported python versions to 3.11 - 3.14 (#492)
* Bump python to 3.14 and ruff to latest * Temporarily silence new ruff rules * Update tests to support python>=3.11 * loosen openvino requirements
1 parent 4ef786b commit 29a0535

9 files changed

Lines changed: 572 additions & 1316 deletions

File tree

.github/workflows/pre_commit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ jobs:
4848
- "ubuntu-latest"
4949
- "windows-latest"
5050
python-version:
51-
- "3.10"
5251
- "3.11"
5352
- "3.12"
5453
- "3.13"
54+
- "3.14"
5555
runs-on: ${{ matrix.os }}
5656
steps:
5757
- *checkout
@@ -82,10 +82,10 @@ jobs:
8282
- "ubuntu-24.04"
8383
- "windows-2022"
8484
python-version:
85-
- "3.10"
8685
- "3.11"
8786
- "3.12"
8887
- "3.13"
88+
- "3.14"
8989
name: unit & functional tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
9090
runs-on: ${{ matrix.os }}
9191
steps:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
- id: detect-private-key
1515

1616
# Ruff version.
17-
- repo: https://github.com/charliermarsh/ruff-pre-commit
17+
- repo: https://github.com/astral-sh/ruff-pre-commit
1818
rev: "v0.6.2"
1919
hooks:
2020
# Run the linter.

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10
1+
3.14

pyproject.toml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build-backend = "hatchling.build"
1010
[project]
1111
name = "openvino_model_api"
1212
version = "0.4.0.0"
13-
requires-python = ">=3.10"
13+
requires-python = ">=3.11"
1414
authors = [
1515
{name = "Intel(R) Corporation"},
1616
]
@@ -20,11 +20,15 @@ maintainers = [
2020
description = "Model API: model wrappers and pipelines for inference with OpenVINO"
2121
readme = "README.md"
2222
classifiers = [
23-
"License :: OSI Approved :: Apache Software License",
24-
"Programming Language :: Python :: 3.10"
23+
"License :: OSI Approved :: Apache Software License",
24+
"Programming Language :: Python :: 3.11",
25+
"Programming Language :: Python :: 3.12",
26+
"Programming Language :: Python :: 3.13",
27+
"Programming Language :: Python :: 3.14",
2528
]
2629
dependencies = [
2730
"numpy>=1.16.6",
31+
"onnxruntime",
2832
"opencv-python-headless",
2933
"openvino>=2025.3",
3034
"pillow",
@@ -190,6 +194,9 @@ lint.ignore = [
190194
lint.fixable = ["ALL"]
191195
lint.unfixable = []
192196

197+
# Allow unused variables when underscore-prefixed.
198+
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
199+
193200
# Exclude a variety of commonly ignored directories.
194201
exclude = [
195202
".bzr",
@@ -217,11 +224,8 @@ exclude = [
217224
# Same as Black.
218225
line-length = 120
219226

220-
# Allow unused variables when underscore-prefixed.
221-
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
222-
223-
# Assume Python 3.10.
224-
target-version = "py310"
227+
# Assume Python 3.11.
228+
target-version = "py311"
225229

226230
# Allow imports relative to the "src" and "tests" directories.
227231
src = ["src", "tests"]

src/model_api/models/classification.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import copy
99
import json
10-
from itertools import starmap
1110
from pathlib import Path
1211
from typing import TYPE_CHECKING
1312

@@ -251,7 +250,7 @@ def get_multilabel_predictions(self, logits: np.ndarray) -> list[Label]:
251250
labels_list = self.params.labels
252251
labels = [labels_list[i] if labels_list else "" for i in indices]
253252

254-
return list(starmap(Label, zip(indices, labels, scores)))
253+
return list(map(Label, indices, labels, scores))
255254

256255
def get_multiclass_predictions(self, outputs: dict) -> list[Label]:
257256
axis = 1
@@ -265,7 +264,7 @@ def get_multiclass_predictions(self, outputs: dict) -> list[Label]:
265264
labels_list = self.params.labels
266265
labels = [labels_list[i] if labels_list else "" for i in indices]
267266

268-
return list(starmap(Label, zip(indices, labels, scores)))
267+
return list(map(Label, indices, labels, scores))
269268

270269

271270
def sigmoid_numpy(x: np.ndarray) -> np.ndarray:

src/model_api/models/yolo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,7 @@ def parameters(cls):
761761
{
762762
"agnostic_nms": BooleanValue(
763763
description=(
764-
"If True, the model is agnostic to the number of classes, "
765-
"and all classes are considered as one"
764+
"If True, the model is agnostic to the number of classes, and all classes are considered as one"
766765
),
767766
default_value=False,
768767
),

tests/accuracy/download_models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ async def stream_file(client, url, filename, semaphore):
3737

3838
async def download_single_image(client, url, filename):
3939
image = await client.get(url)
40-
with Path(filename).open("wb") as im:
41-
im.write(image.content)
40+
Path(filename).write_bytes(image.content)
4241

4342

4443
async def download_images(data_dir):

tools/model_converter/model_converter.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ def create_model(
189189
elif "state_dict" in checkpoint:
190190
# Cannot reconstruct architecture from state_dict alone
191191
error_msg = (
192-
"Checkpoint contains only state_dict. "
193-
"Please specify the model class instead of torch.nn.Module"
192+
"Checkpoint contains only state_dict. Please specify the model class instead of torch.nn.Module"
194193
)
195194
raise ValueError(error_msg)
196195
else:

0 commit comments

Comments
 (0)