Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions .github/workflows/lib-lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,18 @@ jobs:
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
# TODO remove after switching to an official Datumaro release with pre-built wheels
- name: Installing Rust toolchain
uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921
with:
python-version: "3.13"
toolchain: stable

- name: Install uv
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
version: "0.9.7"
enable-cache: false
python-version: "3.10" # Use the lowest supported Python version for linting/type-checking

- name: Installing dependencies
working-directory: library
Expand Down Expand Up @@ -112,24 +114,26 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.13"]
python-version: ["3.10", "3.14"]
name: unit-tests-with-Python${{ matrix.python-version }}
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
# TODO remove after switching to an official Datumaro release with pre-built wheels
- name: Installing Rust toolchain
uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921
with:
python-version: "3.13"
toolchain: stable

- name: Install uv
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
version: "0.9.7"
enable-cache: false
python-version: ${{ matrix.python-version }}

- name: Installing dependencies
working-directory: library
Expand Down Expand Up @@ -158,7 +162,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.13"]
python-version: ["3.10", "3.14"]
include:
- task: "multi_class_cls"
- task: "multi_label_cls"
Expand All @@ -174,16 +178,18 @@ jobs:
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
# TODO remove after switching to an official Datumaro release with pre-built wheels
- name: Installing Rust toolchain
uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921
with:
python-version: ${{ matrix.python-version }}
toolchain: stable

- name: Install uv
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
version: "0.9.7"
enable-cache: false
python-version: ${{ matrix.python-version }}

- name: Installing dependencies
working-directory: library
Expand Down
12 changes: 8 additions & 4 deletions library/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"datumaro~=1.12.0",
"datumaro[experimental]",
"omegaconf==2.3.0",
"rich==14.0.0",
"jsonargparse==4.35.0",
"ftfy==6.3.1",
"regex==2024.11.6",
"regex==2025.11.3",
"importlib_resources==6.5.2",
"docstring_parser==0.16", # CLI help-formatter
"rich_argparse==1.7.0", # CLI help-formatter
Expand All @@ -42,13 +44,14 @@ dependencies = [
"torchmetrics==1.6.0",
"pytorchcv==0.0.67",
"timm==1.0.3",
"openvino==2025.3",
"openvino==2025.4",
"openvino-model-api==0.3.0.4",
"onnx==1.19.1",
"onnx==1.20.0",
"onnxconverter-common==1.16.0",
"onnxscript",
"nncf==2.18.0",
"numpy>=2.0",
"pyyaml==6.0.3",
"tensorboard==2.20.0",
"tensorboardx==2.6.4"
]
Expand Down Expand Up @@ -148,6 +151,7 @@ torchvision = [
{ index = "torch-xpu", extra = "xpu"},
{ index = "torch-cuda", extra = "cuda"},
]
datumaro = { git = "https://github.com/open-edge-platform/datumaro.git", branch = "develop" }

[[tool.uv.index]]
name = "torch-cpu"
Expand Down
4 changes: 2 additions & 2 deletions library/src/otx/cli/utils/jsonargparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import ast
import logging
from contextlib import contextmanager
from pathlib import Path
from typing import Any, Iterator, TypeVar, Union

import docstring_parser
Expand Down Expand Up @@ -116,6 +115,7 @@ def apply_config(self: ActionConfigFile, parser: ArgumentParser, cfg: Namespace,
from jsonargparse._link_arguments import skip_apply_links
from jsonargparse._loaders_dumpers import get_loader_exceptions, load_value
from jsonargparse._optionals import get_config_read_mode
from jsonargparse._util import Path

with _ActionSubCommands.not_single_subcommand(), previous_config_context(cfg), skip_apply_links():
kwargs = {"env": False, "defaults": False, "_skip_check": True, "_fail_no_subcommand": False}
Expand Down Expand Up @@ -297,7 +297,7 @@ def get_defaults_with_overrides(self: ArgumentParser, skip_check: bool = False)
from jsonargparse._namespace import recreate_branches
from jsonargparse._parameter_resolvers import UnknownDefault
from jsonargparse._typehints import ActionTypeHint
from jsonargparse._util import argument_error, change_to_path_dir
from jsonargparse._util import Path, argument_error, change_to_path_dir

cfg = Namespace()
for action in filter_default_actions(self._actions):
Expand Down
11 changes: 6 additions & 5 deletions library/tests/unit/cli/utils/test_jsonargparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

from copy import deepcopy
from unittest.mock import Mock
from unittest.mock import Mock, patch

import pytest
from jsonargparse import ArgumentParser, Namespace
Expand Down Expand Up @@ -91,7 +91,10 @@ def fxt_configs() -> Namespace:
)
def test_apply_config_with_reset(fxt_configs: Namespace, reset: str | list[str]) -> None:
cfg = deepcopy(fxt_configs)
with patch_update_configs():
with (
patch_update_configs(),
patch("jsonargparse.Path.__init__", return_value=None),
):
# test for reset
overrides = Namespace(
overrides=Namespace(
Expand All @@ -115,8 +118,6 @@ def test_apply_config_with_reset(fxt_configs: Namespace, reset: str | list[str])

apply_config(None, mock_parser, cfg, "dest", "value")

assert str(cfg.dest[0]) == "value"

# check values that should not to be changed
assert cfg.data.train_subset.batch_size == fxt_configs.data.train_subset.batch_size
assert cfg.data.train_subset.num_workers == fxt_configs.data.train_subset.num_workers
Expand Down Expand Up @@ -456,7 +457,7 @@ def test_get_configuration(tmp_path):
# Call the get_configuration function
config = get_configuration(config_file)
assert "config" in config
assert config["config"] == [config_file]
assert str(config["config"][0]) == str(config_file)
assert "engine" in config
assert "data" in config
assert config["data"]["task"] == "SEMANTIC_SEGMENTATION"
Expand Down
2 changes: 1 addition & 1 deletion library/tests/unit/tools/test_auto_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_load_default_config(self) -> None:
assert len(default_config) > 0
assert "config" in default_config
assert len(default_config["config"]) > 0
assert default_config["config"][0] == target_config
assert str(default_config["config"][0]) == str(target_config)

# OTX-Mobilenet-v2
# new_config
Expand Down
Loading
Loading