Skip to content

Default Python version and version detection #16418

@ntBre

Description

@ntBre

As brought up in #16417, the default Python version of 3.9 in ruff can be quite confusing, especially with the new version-related syntax errors. It would be nice if we could improve the no-config experience here.

A few possibilities for addressing this could be:

  • change the default Python version to latest (3.13 currently)
  • introduce a distinct undefined version value to suppress version-related errors and rules
  • try to detect the environment Python version

The first of these would probably be easiest to implement but would make some rules (like the UP rules) useless apply incorrectly without setting a lower target version. The second option would likely have the same effect (target_version < 3.10 just becomes target_version.is_some_and(< 3.10) for example).

Metadata

Metadata

Assignees

No one assigned

    Labels

    configurationRelated to settings and configuration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions