Skip to content

pre-commit black hook: use implicit defaults#12156

Merged
jacobtomlinson merged 1 commit intodask:mainfrom
DimitriPapadopoulos:black_requires-python
Nov 14, 2025
Merged

pre-commit black hook: use implicit defaults#12156
jacobtomlinson merged 1 commit intodask:mainfrom
DimitriPapadopoulos:black_requires-python

Conversation

@DimitriPapadopoulos
Copy link
Copy Markdown
Contributor

The black --target-version option does not seem useful nowadays, since black can infer the target version automatically:

By default, Black will infer target versions from the project metadata in pyproject.toml, specifically the [project.requires-python] field. If this does not yield conclusive results, Black will use per-file auto-detection.

The pre-commit language_version option currently specifies Python 3, which goes without saying nowadays:

        # It is recommended to specify the latest version of Python
        # supported by your project here, or alternatively use
        # pre-commit's default_language_version, see
        # https://pre-commit.com/#top_level-default_language_version

This is a follow-up to the decision taken in #12126 (review).

The `--target-version` option does not seem useful nowadays,
since black can infer the target version automatically:
	By default, Black will infer target versions from the
	project metadata in `pyproject.toml`, specifically the
	`[project.requires-python]` field. If this does not yield
	conclusive results, Black will use per-file auto-detection.

The `language_version` currently specifies Python 3, which goes
without saying nowadays:
	# It is recommended to specify the latest version of Python
        # supported by your project here, or alternatively use
        # pre-commit's default_language_version, see
        # https://pre-commit.com/#top_level-default_language_version
@jacobtomlinson jacobtomlinson merged commit faac7ea into dask:main Nov 14, 2025
22 checks passed
@DimitriPapadopoulos DimitriPapadopoulos deleted the black_requires-python branch November 14, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants