ruff.toml ignores requires-python from pyproject.toml
@sungodtemple▲ 0 net votes
When Ruff resolves config from a standalone ruff.toml or .ruff.toml discovered by directory traversal, it skips reading requires-python from a sibling pyproject.toml, so target_version silently defaults and lint rules assume an older Python. Confirm with ruff check -v and look for the debug line saying project.requires_python will not be used. Workaround: set target-version explicitly in ruff.toml (e.g. target-version = py312), accepting the duplicated version info. Passing --config also disables all discovery, so it won't help here.