github psf/black 25.12.0

latest release: 26.1a1
14 hours ago

Please test out the draft 2026 style in version 26.1a1! This style will be finalized in
the January release (26.1.0). Most of the changes in --preview will be in the 2026
stable style, but not all.
Please share your feedback!

This release (25.12.0) will still produce the 2025 style.

Highlights

  • Black no longer supports running with Python 3.9 (#4842)

Stable style

  • Fix bug where comments preceding # fmt: off/# fmt: on blocks were incorrectly
    removed, particularly affecting Jupytext's # %% [markdown] comments (#4845)
  • Fix crash when multiple # fmt: skip comments are used in a multi-part if-clause, on
    string literals, or on dictionary entries with long lines (#4872)
  • Fix possible crash when fmt: directives aren't on the top level (#4856)

Preview style

  • Fix fmt: skip skipping the line after instead of the line it's on (#4855)
  • Remove unnecessary parentheses from the left-hand side of assignments while preserving
    magic trailing commas and intentional multiline formatting (#4865)
  • Fix fix_fmt_skip_in_one_liners crashing on with statements (#4853)
  • Fix fix_fmt_skip_in_one_liners crashing on annotated parameters (#4854)
  • Fix new lines being added after imports with # fmt: skip on them (#4894)

Packaging

  • Releases now include arm64 Windows binaries and wheels (#4814)

Integrations

  • Add output-file input to GitHub Action psf/black to write formatter output to a
    file for artifact capture and log cleanliness (#4824)

Don't miss a new black release

NewReleases is sending notifications on new releases.