Skip to content

RF002: You have both Ruff's target-version and project.requires-python. You only need the later. #407

Description

@DimitriPapadopoulos

No, the lat(t)er is (currently) not (always) enough!

If the repo contains a ruff.toml or .ruff.toml file, ruff will not read pyproject.toml. So even though requires-python may be set in pyproject.toml, you still need to set target-version in ruff.toml or .ruff.toml.

Perhaps that's a ruff bug, but it's still under discussion in an open issue: astral-sh/ruff#10299

I noticed this in sphinx-doc/sphinx#12250

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions