Bump reuse-tool pre-commit hook to v6.2.0#33
Merged
Conversation
The pinned v1.1.2 fails on current GitHub Actions Python runners because reuse-tool v1.x imports pkg_resources at startup, and Python >= 3.12 no longer bundles setuptools (which provides pkg_resources) by default. v6.2.0 has dropped that import. Verified locally under python:3.11-slim with pre-commit run --all-files: black, reuse lint, check yaml, fix end of files, trim trailing whitespace, and pylint (library code) all pass.
5 tasks
makermelissa
approved these changes
May 20, 2026
makermelissa
pushed a commit
that referenced
this pull request
May 20, 2026
Replaces the python/black and pycqa/pylint hooks with the unified astral-sh/ruff-pre-commit (ruff-format + ruff --fix), matching the convention used by adafruit/Adafruit_CircuitPython_Display_Text and the rest of the CircuitPython library ecosystem. Why --- - One tool instead of two -> faster CI, fewer pinned versions to drift. - Ruff tracks new Python stdlib changes promptly; we just hit pkg_resources being removed in 3.12+ which broke reuse-tool v1.1.2 (#33) and would similarly bite the pinned black 23.3.0 / pylint v2.17.4 if the runner ever moves past 3.11. Config ------ .pre-commit-config.yaml: - Drop python/black v23.3.0 - Drop pycqa/pylint v2.17.4 (library / example / test entries) - Add astral-sh/ruff-pre-commit v0.15.8 (ruff-format + ruff --fix) - Reorder so pre-commit-hooks runs first (matches Display_Text) ruff.toml: - Copied verbatim from Adafruit_CircuitPython_Display_Text/main (target-version py38, line-length 100, select I/PL/UP plus the per-rule extends) - Added PLR0904 / PLR0911 to the ignore list because the Shell class is a kitchen-sink utility with 65 public methods and multiple-return paths by design; refactoring that out is way out of scope for a CI-config migration. Code changes ------------ Five trivial cleanups ruff flagged (PLC1901, PLR6201, UP009, UP015, I001): - 'x != ""' -> 'x' for the four stream-empty checks in run_command and one in prompt() (read_stream returns '' for 'no data', so this is a no-op semantically). - 'in ["y", "n"]' -> 'in {"y", "n"}' in prompt() default normalization. - Removed the redundant '# -*- coding: utf-8 -*-' magic comment from docs/conf.py (Python 3 default). - Sorted imports in adafruit_shell.py and docs/conf.py. - Dropped the now-redundant 'r' mode in open(template, 'r'). Verified locally inside python:3.11-slim (matches the GitHub Actions runner Python) -- 'pre-commit run --all-files' passes: check yaml, fix end of files, trim trailing whitespace, ruff format, ruff (legacy alias), reuse lint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps the
fsfe/reuse-toolpre-commit hook from v1.1.2 → v6.2.0 to unblock CI.Why
reuse-toolv1.x importspkg_resourcesat startup, which lives insidesetuptools. Python ≥ 3.12 no longer bundlessetuptoolsby default, so on the current GitHub Actions Python runners the hook now crashes at import time with:PR #31 (merged 2025-11) was the last successful run; the runner environment has drifted since.
Why this specific version
v6.2.0 is what
adafruit/Adafruit_CircuitPython_Display_Textis currently using on itsmainbranch, so it matches a known-good Adafruit reference.Scope
Single-line change to
.pre-commit-config.yaml. Intentionally narrow — a follow-up to migrate the whole config toruff(replacingblack+pylint, matching the CircuitPython-library convention) is planned separately.Verification
Ran
pre-commit run --all-filesinsidepython:3.11-slim(the same Python the CI workflow uses):