Skip to content

Update Python 3.10 support and type annotations - #224

Merged
klemen1999 merged 5 commits into
mainfrom
feat/py310-type-annotations
Jul 17, 2026
Merged

Update Python 3.10 support and type annotations#224
klemen1999 merged 5 commits into
mainfrom
feat/py310-type-annotations

Conversation

@rolandocortez

@rolandocortez rolandocortez commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Purpose

Align the declared Python support with the new Cyclopts dependency, which requires Python 3.10 or newer, and modernize the first-party type annotations accordingly.

Specification

  • Raise the minimum supported Python version from 3.8 to 3.10.
  • Update the Python classifier and Ruff target version to Python 3.10.
  • Replace legacy annotations such as Tuple, List, Dict, Optional, and Union with Python 3.10 syntax.
  • Keep submodules and vendored code unchanged.

Dependencies & Potential Impact

This PR is based on feat/cyclopts and depends on the Cyclopts migration PR.

Python 3.8 and 3.9 will no longer be declared as supported. This matches the minimum Python version required by Cyclopts.

Deployment Plan

No special deployment steps are required. This change will be included in the next package release after the Cyclopts migration is merged.

Testing & Validation

  • pre-commit run --all-files
  • 27 unit tests passed
  • First-party tracked Python files compiled successfully
  • tools --help
  • python -m pip check
  • git diff --check

AI Usage

Assisted-by: ChatGPT

Summary by CodeRabbit

  • Compatibility

    • Updated the supported Python version to 3.10 and newer.
  • Refactor

    • Modernized type annotations across command-line tools and model export workflows.
    • Improved consistency and readability of developer-facing type information without changing runtime behavior.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d212f997-9d4d-465d-9621-a01caf3ec534

📥 Commits

Reviewing files that changed from the base of the PR and between f122170 and 5f055e0.

📒 Files selected for processing (15)
  • pyproject.toml
  • tools/main.py
  • tools/modules/exporter.py
  • tools/utils/config.py
  • tools/utils/filesystem_utils.py
  • tools/utils/telemetry.py
  • tools/yolo/yolo26_exporter.py
  • tools/yolo/yolov10_exporter.py
  • tools/yolo/yolov5_exporter.py
  • tools/yolo/yolov6_exporter.py
  • tools/yolo/yolov8_exporter.py
  • tools/yolov6r1/yolov6_r1_exporter.py
  • tools/yolov6r3/gold_yolo_exporter.py
  • tools/yolov6r3/yolov6_r3_exporter.py
  • tools/yolov7/yolov7_exporter.py

📝 Walkthrough

Walkthrough

The project now requires Python 3.10, updates Ruff targeting, and replaces legacy typing collection and union annotations with built-in Python 3.10 syntax across CLI, utilities, base exporters, and YOLO exporters.

Changes

Python 3.10 typing modernization

Layer / File(s) Summary
Python 3.10 project baseline
pyproject.toml
Raises the supported Python version, updates the classifier, and targets Ruff at py310.
CLI and utility annotations
tools/main.py, tools/utils/*
Replaces Optional, Union, and List annotations with built-in generics and union syntax while preserving defaults and validation.
Base exporter contracts
tools/modules/exporter.py
Modernizes Exporter method signatures and local output-specification annotations.
YOLO exporter annotations
tools/yolo/*, tools/yolov6r1/*, tools/yolov6r3/*, tools/yolov7/*
Updates YOLO exporter annotations and removes obsolete typing imports without changing runtime logic.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • luxonis/tools#222: Modifies the same convert command parameter definitions in tools/main.py.
  • luxonis/tools#223: Refactors the same convert command options and overlapping signatures.

Suggested reviewers: klemen1999

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: raising Python 3.10 support and modernizing type annotations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/py310-type-annotations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rolandocortez
rolandocortez requested a review from klemen1999 July 14, 2026 13:13
Base automatically changed from feat/cyclopts to main July 14, 2026 14:11
@github-actions

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
32165 7076 22% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
tools/main.py 76% 🟢
tools/modules/exporter.py 80% 🟢
tools/utils/config.py 90% 🟢
tools/utils/filesystem_utils.py 49% 🟢
tools/utils/telemetry.py 80% 🟢
tools/yolo/yolo26_exporter.py 0% 🟢
tools/yolo/yolov10_exporter.py 84% 🟢
tools/yolo/yolov5_exporter.py 80% 🟢
tools/yolo/yolov6_exporter.py 87% 🟢
tools/yolo/yolov8_exporter.py 63% 🟢
tools/yolov6r1/yolov6_r1_exporter.py 86% 🟢
tools/yolov6r3/yolov6_r3_exporter.py 84% 🟢
tools/yolov7/yolov7_exporter.py 83% 🟢
TOTAL 72% 🟢

updated for commit: 5f055e0 by action🐍

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

Test Results

  6 files    6 suites   27m 27s ⏱️
 27 tests  27 ✅ 0 💤 0 ❌
162 runs  162 ✅ 0 💤 0 ❌

Results for commit 5f055e0.

♻️ This comment has been updated with latest results.

@klemen1999
klemen1999 merged commit 70b534a into main Jul 17, 2026
23 of 24 checks passed
@klemen1999
klemen1999 deleted the feat/py310-type-annotations branch July 17, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants