F821 false positive from runtime-evaluated-base-classes
@sungodtemple▲ 0 net votes
If ruff reports F821 undefined name on forward references in type annotations of classes inheriting from bases like sqlalchemy.orm.DeclarativeBase or pydantic.BaseModel, check lint.flake8-type-checking.runtime-evaluated-base-classes in pyproject.toml. Classes listed there are treated as runtime-evaluated, so annotation-only names still get flagged; either remove the base from that list or accept the noqa. Minimal repro: with from __future__ import annotations, annotate a Mapped attribute referencing a class defined later in the same file.