-
Notifications
You must be signed in to change notification settings - Fork 37
Description
According to the target-version documentation, ruff reads the target Python version from project.requires-python in pyproject.toml:
If you're already using a
pyproject.tomlfile, we recommendproject.requires-pythoninstead, as it's based on Python packaging standards, and will be respected by other tools. For example, Ruff treats the following as identical totarget-version = "py38":[project] requires-python = ">=3.8"
Since this skeleton defines requires-python in setup.cfg, not in pyproject.toml, it is not picked up. Therefore, we must redefine the minimal Python version as target-version in ruff.toml. This brings the question, are you planning on moving from setup.cfg to pyproject.toml? Alternatively, would it be possible to move the requires-python from setup.cfg to pyproject.toml?
Additionally, ruff does not read project.requires-python from pyproject.toml if a ruff.toml file exists. It is unclear at this point whether this is a bug or a feature:
astral-sh/ruff#10299