Skip to content

vNext: Pin Ruff to 0.17.0 and fix the import it flags - #550

Merged
RobHofmann merged 1 commit into
5.0-devfrom
fix/ruff-0.17
Oct 9, 2026
Merged

RobHofmann merged 1 commit into
5.0-devfrom
fix/ruff-0.17

Conversation

@RobHofmann

Copy link
Copy Markdown
Owner

Problem

Lint has failed on every push and PR to 5.0-dev since #547:

I001 [*] Import block is un-sorted or un-formatted
  --> custom_components/gree_custom/const.py:3:1

None of #547, #548 or #549 touched const.py.

Cause

lint.yml installed ruff>=0.16.3. Ruff 0.17.0 came out on 2026-10-09, so CI used 0.17.0 from that day on. The last green run (#546) used 0.16.10.

0.17 sorts an import with a trailing pragma comment differently. Ruff 0.16.10 and 0.17.0 want opposite forms of the same import, so no code passes both.

Change

  • const.py: apply the 0.17 fix (ruff check --fix).
  • lint.yml and requirements_dev.txt: pin Ruff to 0.17.0, so a new Ruff release cannot break CI again. A future bump goes in its own PR.
  • docs/development.md: explain the pin.

Testing

  • Ruff 0.17.0: ruff check . passes, ruff format --check . passes (72 files).
  • Ruff 0.16.10 on the same tree reports the opposite I001 finding, which shows why the pin is needed.
  • No behaviour change, so no harness or device test.

Notes

Contributors with an older local Ruff, or the VS Code Ruff extension with its bundled Ruff, see I001 the other way round. pip install -r requirements_dev.txt fixes that.

Lint installed ruff>=0.16.3, so CI picked up Ruff 0.17.0 the day it came
out. 0.17 sorts an import with a trailing pragma comment differently, and
const.py failed I001 on every push and PR since #547. None of #547, #548
or #549 touched const.py.

0.16.10 and 0.17.0 want opposite forms of that import, so no code passes
both. Pin Ruff to an exact version in lint.yml and requirements_dev.txt
so a new release cannot break CI again, and apply the 0.17 fix.
@RobHofmann
RobHofmann merged commit 56c90d2 into 5.0-dev Oct 9, 2026
4 checks passed
@RobHofmann
RobHofmann deleted the fix/ruff-0.17 branch October 9, 2026 21:48
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.

1 participant