Skip to content

chore: bump minimum Python to 3.10#2260

Merged
Borda merged 63 commits into
developfrom
bump/py3.10
Jun 29, 2026
Merged

chore: bump minimum Python to 3.10#2260
Borda merged 63 commits into
developfrom
bump/py3.10

Conversation

@Borda

@Borda Borda commented May 20, 2026

Copy link
Copy Markdown
Member

This pull request updates the minimum supported Python version for the project from 3.9 to 3.10. The changes ensure consistency across documentation, configuration, and CI workflows, and remove references to Python 3.9 throughout the codebase.

Python version support updates:

  • Updated the minimum required Python version in pyproject.toml from 3.9 to 3.10, and removed Python 3.9 from the supported classifiers. [1] [2]
  • Changed the Python version matrix in the CI workflow (.github/workflows/ci-tests.yml) to start from 3.10 instead of 3.9.

Configuration and tooling updates:

  • Updated the Python version constraints for documentation dependencies to require Python >=3.10.
  • Set the target version for ruff (linter) to py310 instead of py39 in pyproject.toml.
  • Changed the python_version setting for mypy type checking from 3.9 to 3.10 in pyproject.toml.

  • Drop Python 3.9 from CI test matrix
  • requires-python = ">=3.10" in pyproject.toml
  • ruff target-version py39 → py310
  • mypy python_version 3.9 → 3.10
  • Remove Python 3.9 classifier

- Drop Python 3.9 from CI test matrix
- requires-python = ">=3.10" in pyproject.toml
- ruff target-version py39 → py310
- mypy python_version 3.9 → 3.10
- Remove Python 3.9 classifier

---
Co-authored-by: Claude Code <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 20, 2026 10:49
@Borda Borda requested a review from SkalskiP as a code owner May 20, 2026 10:49
Comment thread .github/workflows/ci-tests.yml
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
@Borda Borda added the enhancement New feature or request label May 20, 2026
@codecov

codecov Bot commented May 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.37859% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 83%. Comparing base (5a90113) to head (f1847c9).

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #2260   +/-   ##
=======================================
  Coverage       82%     83%           
=======================================
  Files           68      69    +1     
  Lines         9560    9610   +50     
=======================================
+ Hits          7881    7935   +54     
+ Misses        1679    1675    -4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request raises the project’s minimum supported Python version to 3.10 and aligns configuration/typing across the repo to use Python 3.10+ features and tooling settings.

Changes:

  • Bump requires-python to >=3.10 and update lint/type-checker target versions accordingly.
  • Drop Python 3.9 from CI and modernize type annotations (e.g., Optional[T]T | None, typing.Callablecollections.abc.Callable).
  • Update docs dependency markers to reflect the new minimum Python version.

Assessment (n/5):

  • Code quality: 4/5
  • Testing: 4/5
  • Docs: 3/5

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/metrics/conftest.py Updates type annotations to Python 3.10 union syntax.
src/supervision/dataset/formats/coco.py Replaces typing.Union with `
pyproject.toml Bumps minimum Python, updates classifiers and tool target versions (ruff/mypy), and adjusts docs dependency markers.
examples/heatmap_and_track/script.py Updates optional parameter typing to Python 3.10 union syntax.
examples/compact_mask/benchmark.py Switches Callable import to collections.abc for modern typing.
.github/workflows/ci-tests.yml Updates the CI Python matrix to reflect supported versions.

Borda and others added 11 commits May 20, 2026 12:53
Co-authored-by: Codex <codex@openai.com>
- Replace float arrays with explicit integer or float types, e.g., `dtype=int32` or `dtype=float32`.
- Improve type safety by adding explicit casting in key computations.
- Update Ruff ignore rules for additional per-file scenarios.
- Refactor imports for cleaner and more direct typing references.
- boxes.py: clip/pad/move/spread restore input-dtype-preserving behavior (was forcing float64/float32); revert doctests
- detection/core.py + key_points/core.py: restore __setitem__ runtime isinstance validation and list→ndarray coercion
- smoother.py: remove forced float32 on xyxy/confidence stacks; keep null-safety for confidence=None case; revert doctests
- metrics/detection.py: revert ConfusionMatrix matrix dtype int32→float64 default; revert doctests
- annotators/core.py: polygon cast int64→int32 (cv2 requires CV_32S); HeatMapAnnotator local mask float32→float64
- pyproject.toml: remove ANN (flake8-annotations) from lint.select and all ANN per-file-ignores — policy change unrelated to py3.10 compat

---
Co-authored-by: Claude Code <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 84 out of 85 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (2)

src/supervision/utils/conversion.py:71

  • Same as above: this wrapper should preserve the wrapped function’s metadata via @functools.wraps(image_processing_fun). Without it, the exported function’s docstring/signature become those of the wrapper, which can break documentation/introspection tooling.
    src/supervision/utils/conversion.py:105
  • This wrapper should preserve annotate_func metadata via @functools.wraps(annotate_func) for consistent introspection/docs. Currently the wrapper replaces the original function name/docstring/signature.

Comment thread src/supervision/utils/conversion.py Outdated
Comment thread src/supervision/draw/utils.py
Comment thread src/supervision/detection/tools/inference_slicer.py
Comment thread pyproject.toml
Copilot finished work on behalf of Borda May 20, 2026 17:00
Copilot finished work on behalf of Borda May 20, 2026 17:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 92 out of 93 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/supervision/detection/utils/internal.py:463

  • get_data_item() now declares it accepts list[bool] as an index, but the isinstance(index, list) branch treats the list elements as integer indices (value[i] for i in index). For boolean-mask lists this silently indexes with True/False (i.e., 1/0) rather than filtering, producing incorrect subsets (and potentially IndexError). Handle list[bool] explicitly (e.g., if index and isinstance(index[0], bool): ...) and keep the existing list[int] behavior separate; also consider the empty-list case.

Comment thread src/supervision/metrics/precision.py Outdated
pre-commit-ci Bot and others added 3 commits June 27, 2026 07:23
Simplify Python 3.10 typing imports and reuse detection data aliases where they reduce repeated annotations.

Co-authored-by: Codex <codex@openai.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 116 out of 116 changed files in this pull request and generated 2 comments.

Comment thread src/supervision/metrics/mean_average_precision.py Outdated
Comment thread docs/changelog.md Outdated
Borda and others added 6 commits June 29, 2026 10:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Tighten Detections array dtypes and widen helper signatures to match runtime contracts under stricter NumPy typing.

Update downstream metrics, exporters, slicer, conversion, and tracker typing so the mypy pre-commit hook passes.

Co-authored-by: Codex <codex@openai.com>
Make detection data and metadata type aliases private, and simplify Metric generics by removing the unused ParamSpec.

Drop unnecessary color normalizer overloads while preserving CompactMask overloads for distinct return types.

Co-authored-by: Codex <codex@openai.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 125 out of 125 changed files in this pull request and generated 2 comments.

Comment thread pyproject.toml
Comment thread src/supervision/utils/image.py
Borda and others added 2 commits June 29, 2026 14:20
Update current docs and generated help text from Python 3.9+ to Python 3.10+.

Remove py38 and py39 from tox envlist and include py314 to match supported classifiers.

Co-authored-by: Codex <codex@openai.com>
@Borda Borda merged commit 0a95bae into develop Jun 29, 2026
26 checks passed
@Borda Borda deleted the bump/py3.10 branch June 29, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants