chore: bump minimum Python to 3.10#2260
Conversation
- 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>
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Codecov Report❌ Patch coverage is 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:
|
There was a problem hiding this comment.
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-pythonto>=3.10and update lint/type-checker target versions accordingly. - Drop Python 3.9 from CI and modernize type annotations (e.g.,
Optional[T]→T | None,typing.Callable→collections.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. |
…nnotations compliance
Co-authored-by: Codex <codex@openai.com>
…into bump/py3.10
- 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>
There was a problem hiding this comment.
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.
Agent-Logs-Url: https://github.com/roboflow/supervision/sessions/1d14ff8a-1497-43a2-a1c9-0a79637c1924 Co-authored-by: Borda <6035284+Borda@users.noreply.github.com>
Agent-Logs-Url: https://github.com/roboflow/supervision/sessions/0e999045-cc3c-4b57-8369-3221cf3c9c52 Co-authored-by: Borda <6035284+Borda@users.noreply.github.com>
There was a problem hiding this comment.
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 acceptslist[bool]as an index, but theisinstance(index, list)branch treats the list elements as integer indices (value[i] for i in index). For boolean-mask lists this silently indexes withTrue/False(i.e., 1/0) rather than filtering, producing incorrect subsets (and potentially IndexError). Handlelist[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.
Simplify Python 3.10 typing imports and reuse detection data aliases where they reduce repeated annotations. Co-authored-by: Codex <codex@openai.com>
…into bump/py3.10
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>
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>
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:
pyproject.tomlfrom 3.9 to 3.10, and removed Python 3.9 from the supported classifiers. [1] [2].github/workflows/ci-tests.yml) to start from 3.10 instead of 3.9.Configuration and tooling updates:
ruff(linter) topy310instead ofpy39inpyproject.toml.python_versionsetting formypytype checking from 3.9 to 3.10 inpyproject.toml.