fix(deps): update dependency black to v26#23
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
>=22.0β>=26.1.0Release Notes
psf/black (black)
v26.1.0Compare Source
Highlights
Introduces the 2026 stable style (#β4892), stabilizing the following changes:
always_one_newline_after_import: Always force one blank line after importstatements, except when the line after the import is a comment or an import statement
(#β4489)
fix_fmt_skip_in_one_liners: Fix# fmt: skipbehavior on one-liner declarations,such as
def foo(): return "mock" # fmt: skip, where previously the declaration wouldhave been incorrectly collapsed (#β4800)
fix_module_docstring_detection: Fix module docstrings being treated as normalstrings if preceded by comments (#β4764)
fix_type_expansion_split: Fix type expansions split in generic functions (#β4777)multiline_string_handling: Make expressions involving multiline strings more compact(#β1879)
normalize_cr_newlines: Add\rstyle newlines to the potential newlines tonormalize file newlines both from and to (#β4710)
remove_parens_around_except_types: Remove parentheses around multiple exceptiontypes in
exceptandexcept*withoutas(#β4720)remove_parens_from_assignment_lhs: Remove unnecessary parentheses from the left-handside of assignments while preserving magic trailing commas and intentional multiline
formatting (#β4865)
standardize_type_comments: Format type comments which have zero or more spacesbetween
#andtype:or betweentype:and value to# type: (value)(#β4645)The following change was not in any previous stable release:
_width_table.pyand added tests for the Khmer language (#β4253)This release alo bumps
pathspecto v1 and fixes inconsistencies with Git's.gitignorelogic (#β4958). Now, files will be ignored if a pattern matches them, evenif the parent directory is directly unignored. For example, Black would previously
format
exclude/not_this/foo.pywith this.gitignore:Now,
exclude/not_this/foo.pywill remain ignored. To ensureexclude/not_this/andall of it's children are included in formatting (and in Git), use this
.gitignore:This new behavior matches Git. The leading
*/are only necessary if you wish to ignorematching subdirectories (like the previous behavior did), and not just matching root
directories.
Output
Integrations
v25.12.0Compare Source
Highlights
Stable style
# fmt: off/# fmt: onblocks were incorrectlyremoved, particularly affecting Jupytext's
# %% [markdown]comments (#β4845)# fmt: skipcomments are used in a multi-part if-clause, onstring literals, or on dictionary entries with long lines (#β4872)
fmt:directives aren't on the top level (#β4856)Preview style
fmt: skipskipping the line after instead of the line it's on (#β4855)magic trailing commas and intentional multiline formatting (#β4865)
fix_fmt_skip_in_one_linerscrashing onwithstatements (#β4853)fix_fmt_skip_in_one_linerscrashing on annotated parameters (#β4854)# fmt: skipon them (#β4894)Packaging
Integrations
output-fileinput to GitHub Actionpsf/blackto write formatter output to afile for artifact capture and log cleanliness (#β4824)
v25.11.0Compare Source
Highlights
Stable style
# fmt: offand# fmt: onwere reformatted (#β4811)being normalized (#β4811)
Preview style
multiline_string_handlingfrom--unstableto--preview(#β4760)comments (#β4764)
# type: <value>(#β4645)fix_fmt_skip_in_one_linerspreview feature to respect# fmt: skipfor compoundstatements with semicolon-separated bodies (#β4800)
Configuration
no_cacheoption to control caching behavior. (#β4803)Packaging
Output
(#β4610)
Blackd
requests to blackd (#β4774)
Integrations
psf/blackto support therequired-versionmajor-version-only"stability" format when using pyproject.toml (#β4770)
v25.9.0Compare Source
Highlights
await/asyncas soft keywords/variable names(#β4676)
Stable style
delstatement containing tuples (#β4628)withstatements (#β4630)
# fmt: skipfollowed by a comment at the end of file (#β4635)asclause of awithstatement (#β4634)withstatement (#β4646)\followed by a\rfollowed by a comment (#β4663)\\r\n(#β4673)await ...(where...is a literalEllipsis) (#β4676)(#β4670)
Preview style
# fmt: skipwould stillbe formatted (#β4552)
multiline_string_handlingwith ternaries and dictionaries (#β4657)string_processingwould not split f-strings directly afterexpressions (#β4680)
inclause of comprehensions across lines if necessary (#β4699)exceptandexcept*withoutas. (#β4720)\rstyle newlines to the potential newlines to normalize file newlines both fromand to (#β4710)
Parser
parameter bounds and defaults. (#β4602)
Performance
Integrations
psf/blackto read Black version from an additional section inpyproject.toml:
[project.dependency-groups](#β4606)Documentation
v25.1.0Compare Source
Highlights
This release introduces the new 2025 stable style (#β4558), stabilizing the following
changes:
# fmt: skipcomments is no longer normalized (#β4146)(#β4154)
*and more complex type variable tuple (#β4440)The following changes were not in any previous release:
over multiple lines first instead of type parameter definitions (#β4553)
Stable style
empty lines (#β4484)
withstatements containing tuple generators/unpacking(#β4538)
Preview style
(#β4498)
string_processingandwrap_long_dict_values_in_parensfrom removingparentheses around long dictionary values (#β4377)
wrap_long_dict_values_in_parensfrom the unstable to preview style (#β4561)Packaging
License-Expressionmetadata field, seePEP 639. (#β4479)
Performance
is_fstring_startfunction in Black's tokenizer (#β4541)Integrations
--stdin-filenameset to a force excluded path, stdin won't beformatted. (#β4539)
v24.10.0Compare Source
Highlights
mypyc-compiled wheels. (#β4436) (#β4449)
safety issue in Python 3.12.5 that can cause Black's AST safety checks to fail. Please
use Python 3.12.6 or Python 3.12.4 instead. (#β4447)
Stable style
X | Ystyle unions.(#β4453)
%%magic (#β4462)Preview style
def fn(*args: *tuple[*Ts, T]) -> None: pass) (#β4440)Caching
--unstable(#β4466)Packaging
blackdnow requires a newer version of aiohttp. (#β4451)Output
v24.8.0Compare Source
Stable style
# fmt: offis used before a closing parenthesis or bracket. (#β4363)Packaging
linked. This improves the PyPI listing for Black. (#β4345)
Parser
multiline string (#β4339)
(#β4401)
\{inside f-strings very well (#β4422)(#β4423)
Performance
.gitignore(#β4415)Blackd
v24.4.2Compare Source
This is a bugfix release to fix two regressions in the new f-string parser introduced in
24.4.1.
Parser
Performance
v24.4.1Compare Source
Highlights
Stable style
Parser
by PEP 696 (#β4327)
Integrations
git archiveis skipped (#β4313)v24.4.0Compare Source
Stable style
Preview style
ifguards incaseblocks are now wrapped in parentheses when the line is too long.(#β4269)
Integrations
use_pyprojectto the GitHub Actionpsf/black. This will read theBlack version from
pyproject.toml. (#β4294)v24.3.0Compare Source
Highlights
This release is a milestone: it fixes Black's first CVE security vulnerability. If you
run Black on untrusted input, or if you habitually put thousands of leading tab
characters in your docstrings, you are strongly encouraged to upgrade immediately to fix
CVE-2024-21503.
This release also fixes a bug in Black's AST safety check that allowed Black to make
incorrect changes to certain f-strings that are valid in Python 3.12 and higher.
Stable style
of Black would incorrectly format the contents of certain unusual f-strings containing
nested strings with the same quote type. Now, Black will crash on such strings until
support for the new f-string syntax is implemented. (#β4270)
(#β4273)
Performance
characters. This fixes
CVE-2024-21503.
(#β4278)
Documentation
--checkis used with--quiet(#β4236)v24.2.0Compare Source
Stable style
(#β4218)
Preview style
hug_parens_with_braces_and_square_bracketsfeature to the unstable styledue to an outstanding crash and proposed formatting tweaks (#β4198)
expression (#β4154)
(#β4185)
casestatementifguards (#β4214).Configuration
pyproject.tomlthat is missing atool.blacksection whendiscovering project root and configuration. Since Black continues to use version
control as an indicator of project root, this is expected to primarily change behavior
for users in a monorepo setup (desirably). If you wish to preserve previous behavior,
simply add an empty
[tool.black]to the previously discoveredpyproject.toml(#β4204)
Output
SyntaxWarnings orDeprecationWarnings produced by theastmodule when performing equivalence checks (#β4189)
Integrations
v24.1.1Compare Source
Bugfix release to fix a bug that made Black unusable on certain file systems with strict
limits on path length.
Preview style
Configuration
do not support long paths (#β4176)
v24.1.0Compare Source
Highlights
This release introduces the new 2024 stable style (#β4106), stabilizing the following
changes:
if-elseexpressions (#β2278)...are formatted morecompactly (#β3796)
(#β3368)
withstatement(#β3489)
entry (#β3393)
--skip-magic-trailing-commaor-C, trailing commas are stripped fromsubscript expressions with more than 1 element (#β3209)
# fmt: skipwith other comments (#β3959)There are already a few improvements in the
--previewstyle, which are slated for the2025 stable style. Try them out and
share your feedback. In the past, the preview
style has included some features that we were not able to stabilize. This year, we're
adding a separate
--unstablestyle for features with known problems. Now, the--previewstyle only includes features that we actually expect to make it into nextyear's stable style.
Stable style
Several bug fixes were made in features that are moved to the stable style in this
release:
unlike other binary operators (#β4109)
blocks, except immediately before a docstring (#β4130)
Preview style
--unstablestyle, covering preview features that have known problems that wouldblock them from going into the stable style. Also add the
--enable-unstable-featureflag; for example, use
--enable-unstable-feature hug_parens_with_braces_and_square_bracketsto apply thispreview feature throughout 2024, even if a later Black release downgrades the feature
to unstable (#β4096)
# fmt: skipcomments (#β4146)Configuration
pyproject.tomlcontains an invalid key (#β4165)--experimental-string-processingflag. This feature cancurrently be enabled with
--preview --enable-unstable-feature string_processing.(#β4096)
Integrations
(#β3940) for better compatibility with older versions of pre-commit (#β4137)
v23.12.1Compare Source
Packaging
dextra by default (#β4108)v23.12.0Compare Source
Highlights
It's almost 2024, which means it's time for a new edition of Black's stable style!
Together with this release, we'll put out an alpha release 24.1a1 showcasing the draft
2024 stable style, which we'll finalize in the January release. Please try it out and
share your feedback.
This release (23.12.0) will still produce the 2023 style. Most but not all of the
changes in
--previewmode will be in the 2024 stable style.Stable style
# fmt: offautomatically dedents when used with the--line-rangesoption, even when it is not within the specified line range. (#β4084)
Preview style
indented less (#β4012)
docstring (#β4060)
--line-length(#β4086)functions or class definitions (#β4066) (#β4103)
Configuration
--line-rangesnow skips Black's internal stability check in--safemode. Thisavoids a crash on rare inputs that have many unformatted same-content lines. (#β4034)
Packaging
Integrations
v23.11.0Compare Source
Highlights
--line-rangescommand-line option(#β4020)
Stable style
await (a ** b)(#β3994)fixes a crash (#β4019)
Preview style
less (#β3964)
indented less (#β3992)
now preserved (#β4005)
caseblocks were not split into multiple lines. Also enablegeneral trailing comma rules on
caseblocks (#β4024)class definition (#β4028)
Configuration
--include(#β3976)Performance
Integrations
formatter (#β3940)
v23.10.1Compare Source
Highlights
Preview style
Packaging
Integrations
summaryparameter. (#β3958)
Documentation
#β3968
v23.10.0Compare Source
Stable style
Preview style
multiple lines (#β3899)
Configuration
BLACK_CACHE_DIRis set (#β3937)Parser
typewere not accepted insidematchstatements(#β3950)
(#β3949)
Output
code (#β3933)
(#β3938)
Integrations
v23.9.1Compare Source
Due to various issues, the previous release (23.9.0) did not include compiled mypyc
wheels, which make Black significantly faster. These issues have now been fixed, and
this release should come with compiled wheels once again.
There will be no wheels for Python 3.12 due to a bug in mypyc. We will provide 3.12
wheels in a future release as soon as the mypyc bug is fixed.
Packaging
Performance
decreasing the size of the cache (#β3877)
v23.9.0Compare Source
Preview style
if sys.version_info > (3, x):) and a function definition on the same level (#β3862)Configuration
Performance
IPythonif notebook cells do not contain magics (#β3782)Blackd
blackdwith single character input (#β3558)Integrations
official pre-commit mirror. Swapping
https://github.com/psf/blacktohttps://github.com/psf/black-pre-commit-mirrorinyour
.pre-commit-config.yamlwill make Black about 2x faster (#β3828).black.envfolder specified byENV_PATHwill now be removed on the completionof the GitHub Action (#β3759)
v23.7.0Compare Source
Highlights
supported until further notice (#β3765)
Stable style
PEP 604 unions (#β3735)
under some circumstances (#β3745)
type: ignorewithin parentheses(#β3740)
(#β3773)
Preview style
parentheses (#β3640)
Configuration
--workersargument to Black can now be specified via theBLACK_NUM_WORKERSenvironment variable (#β3743)
.pytest_cache,.ruff_cacheand.vscodeare now excluded by default (#β3691)pyproject.tomlsettings when running--stdin-filenameand the
pyproject.tomlfound isn't in the current working directory (#β3719)excludeandextend-excludehave invalid data types inpyproject.toml, instead of silently doing the wrong thing (#β3764)Packaging
LANG=C(#β3768)Parser
Performance
IPythonin a case where we wouldn't need it (#β3748)Output
Blackd
blackdargument parser now shows the default values for options in their helptext (#β3712)
Integrations
PYTHONWARNDEFAULTENCODING = 1(#β3763)
Documentation
cite this software (#β3723)
the latest code base (#β3755)
Configuration
π Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.