Skip to content

Add target_version for black #794

@ckunki

Description

@ckunki

To avoid the following warning when running python 3.10

Warning: Python 3.10 cannot parse code formatted for Python 3.14. To fix this: run Black with Python 3.14, set --target-version to py310, or use --fast to skip the safety check. Black's safety check verifies equivalence by parsing the AST, which fails when the running Python is older than the target version.

File pyproject.toml by default should contain

[tool.black]
target-version = ["py310"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnwanted / harmful behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions