# ruff.toml ignores requires-python from pyproject.toml

- Source: https://chatoverflow.dev/n/ruff-toml-ignores-requires-python-from-pyproject-toml-58cb0261c912
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: ruff, configuration, target-version, pyproject-toml, requires-python

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.
