π Summary
v8.3.221 focuses on a large Ruff-driven codebase refactor that modernizes typing, cleans imports/variables, and polishes formatting/logging with minimal behavioral change. It also tightens docs CI linting, fixes exception logging patterns, updates ExecuTorch docs links, and improves test isolation. β¨
π Key Changes
- Codebase-wide Ruff refactor (current PR) by @glenn-jocher:
- Modern type hints using PEP 604 unions (e.g.,
Path | None,dict | None). - Cleanup of unused variables, fewer
# noqa, standardized imports, safer disk-usage vars. - More Pythonic constructs (iterable unpacking,
next(...)for first matches, clearer f-string formatting with!s,!r). - Consistent rounding in image padding/letterbox flows:
int(round(...))βround(...). - Reordered
__all__exports and minor logging/output polish.
- Modern type hints using PEP 604 unions (e.g.,
- Docs and CI improvements:
- Stricter Ruff rules (Pyflakes F) enabled in docs workflow to catch undefined names and unused imports earlier. See the updated workflow in docs CI.
- Exception logging simplified from
str(e)tof"{e}"across code and docs for cleaner messages. - ExecuTorch docs link updated to the correct backend setup page. See the updated ExecuTorch docs.
- Testing reliability:
- Test suite now uses pytestβs built-in
tmp_pathfor better isolation and parallel test stability, replacing ad-hoc TMP dir usage.
- Test suite now uses pytestβs built-in
References:
- Current PR: ultralytics 8.3.221 Ruff RUF refactor
- Docs CI linting: Use --extend-select F in docs.yml
- Exception logging cleanup: Use f"{e}"
- ExecuTorch doc fix: Fix ExecuTorch docs URL
π― Purpose & Impact
- Developer experience π§βπ»
- Cleaner, more consistent codebase and type hints improve IDE assistance, readability, and maintenance.
- Stricter CI linting catches common issues earlier, leading to higher-quality contributions.
- User experience π
- No model or API changes; performance and results remain consistent for YOLO11 and other models.
- Slightly more consistent image padding behavior from rounding standardization in examples/utilities; impact should be negligible.
- Documentation & reliability ππ§
- Correct ExecuTorch links reduce setup confusion.
- Test isolation via
tmp_pathimproves CI stability and confidence in releases.
Upgrade note: No action required. If contributing, ensure your PRs pass the stricter Ruff checks and follow the updated exception/logging patterns. β
What's Changed
- Fix ExecuTorch docs URL by @lakshanthad in #22468
- Use
f"{e}"by @glenn-jocher in #22473 - Use
--extend-select Fin docs.yml by @glenn-jocher in #22474 - Replace TMP dir usage with builtin
tmp_pathfor improved test isolation by @Borda in #22456 ultralytics 8.3.221RuffRUFrefactor by @glenn-jocher in #22475
Full Changelog: v8.3.220...v8.3.221