Skip to content

[Infinite loop] I002 and UP035 #16802

@dscorbett

Description

@dscorbett

Summary

Ruff fails to converge when missing-required-import (I002) and deprecated-import (UP035) are selected and a deprecated import is required.

$ echo 1 | ruff --isolated check - --select I002,UP035 --config 'lint.isort.required-imports=["from collections import Sequence"]' --fix

error: Failed to converge after 100 iterations.

This indicates a bug in Ruff. If you could open an issue at:

    https://github.com/astral-sh/ruff/issues/new?title=%5BInfinite%20loop%5D

...quoting the contents of `-`, the rule codes I002, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!

from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
from collections.abc import Sequence
1
-:1:1: I002 Missing required import: `from collections import Sequence`
Found 101 errors (100 fixed, 1 remaining).
[*] 1 fixable with the `--fix` option.

Version

ruff 0.11.0 (2cd25ef 2025-03-14)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingisortRelated to import sorting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions