Skip to content

Commit d2490e2

Browse files
authored
Prepare release 26.5.0 (#5131)
Signed-off-by: cobalt <[email protected]>
1 parent 2b13ea7 commit d2490e2

9 files changed

Lines changed: 27 additions & 55 deletions

File tree

‎CHANGES.md‎

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,58 @@
11
# Change Log
22

3-
## Unreleased
4-
5-
<!-- PR authors:
6-
Please include the PR number in the changelog entry, not the issue number -->
3+
## Version 26.5.0
74

85
### Highlights
96

10-
<!-- Include any especially major or disruptive changes here -->
7+
- Add support for unpacking in comprehensions (PEP 798) and for lazy imports (PEP 810),
8+
both new syntactic features in Python 3.15 (#5048)
9+
- Python 3.15 is now supported. Compiled wheels are not yet provided for Python 3.15, so
10+
performance may be slower than on existing Python versions. Wheels will be provided
11+
once Python 3.15 is later in its release cycle. (#5127)
1112

1213
### Stable style
1314

14-
<!-- Changes that affect Black's stable style -->
15-
16-
- Preserve multiline compound statement headers when `# fmt: skip` is placed on the
17-
colon line (#5117)
1815
- Fix `# fmt: skip` being ignored in nested `if` expressions with parenthesized `in`
1916
clauses (#4903)
17+
- Add syntactic support for Python 3.15 (#5048)
2018
- Fix crash when an f-string follows a `# fmt: off` comment inside brackets (#5097)
21-
- Add support for unpacking in comprehensions (PEP 798) and for lazy imports (PEP 810),
22-
both new syntactic features in Python 3.15 (#5048)
19+
- Preserve multiline compound statement headers when `# fmt: skip` is placed on the
20+
colon line (#5117)
2321

2422
### Preview style
2523

26-
<!-- Changes that affect Black's preview style -->
27-
28-
- Prevent string merger from creating unsplittable long lines when a pragma comment
29-
(e.g. `# type: ignore`) follows the closing bracket (#5096)
3024
- Improve heuristics around whether blank lines should appear before, within and after
3125
groups of same-name decorated functions (such as `@overload` groups) in `.pyi` stub
3226
files (#5021)
3327
- Fix blank lines being removed between a function and a decorated class in `.pyi` stub
3428
files (#5092)
35-
36-
### Configuration
37-
38-
<!-- Changes to how Black can be configured -->
29+
- Prevent string merger from creating unsplittable long lines when a pragma comment
30+
(e.g. `# type: ignore`) follows the closing bracket (#5096)
3931

4032
### Packaging
4133

42-
<!-- Changes to how Black is packaged, such as dependency requirements -->
43-
44-
- Python 3.15 is now supported. Compiled wheels are not yet provided for Python 3.15, so
45-
performance may be slower than on existing Python versions. Wheels will be provided
46-
once Python 3.15 is later in its release cycle. (#5127)
47-
48-
### Parser
49-
50-
<!-- Changes to the parser or to version autodetection -->
51-
52-
### Performance
53-
54-
<!-- Changes that improve Black's performance. -->
34+
- Run CI on 3.15 (#5127)
5535

5636
### Output
5737

5838
- Improve parse error readability by showing multi-line output with an error pointer.
5939
(#5068)
60-
6140
- Add `SourceASTParseError` to distinguish source parse failures from internal safety
6241
errors, improving error reporting when Black's lenient parser accepts input that
6342
`ast.parse()` rejects (#5080)
6443

6544
### _Blackd_
6645

67-
<!-- Changes to blackd -->
68-
6946
- Return HTTP 400 (Bad Request) for source parse failures instead of HTTP 500, keeping
7047
HTTP 500 only for genuine internal safety errors (#5080)
7148

7249
### Integrations
7350

74-
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
75-
7651
- Added documentation for doctest formatting tools and updated the integrations index to
7752
match (#4916)
7853

7954
### Documentation
8055

81-
<!-- Major changes to documentation and policies. Small docs changes
82-
don't need a changelog entry. -->
83-
8456
- Use "Version X.Y.Z" headings in changelog for stable permalink anchors on ReadTheDocs
8557
(#5063)
8658
- Note in the editor integrations that the SublimeText `sublack` plugin is archived and

‎docs/contributing/release_process.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ To cut a release:
4242
1. Determine the release's version number
4343
- **_Black_ follows the [CalVer] versioning standard using the `YY.M.N` format**
4444
- So unless there already has been a release during this month, `N` should be `0`
45-
- Example: the first release in January, 2022 → `22.1.0`
45+
- Example: the first release in January, 2026 → `26.1.0`
4646
- `release.py` will calculate this and log it to stdout for your copy-paste pleasure
4747
1. Double-check that no changelog entries since the last release were put in the wrong
4848
section (e.g., run `git diff origin/stable CHANGES.md`)

‎docs/guides/using_black_with_jupyter_notebooks.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Simply replace the `black` hook with `black-jupyter`.
111111
```yaml
112112
repos:
113113
- repo: https://github.com/psf/black-pre-commit-mirror
114-
rev: 26.3.1
114+
rev: 26.5.0
115115
hooks:
116116
- id: black-jupyter
117117
language_version: python3.11

‎docs/integrations/editors.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,11 @@ version scheme used by Black):
259259
Plug 'psf/black', { 'tag': '*.*.*' }
260260
```
261261

262-
and the following demonstrates pinning to a specific year's stable style (2022 in this
262+
and the following demonstrates pinning to a specific year's stable style (2026 in this
263263
case):
264264

265265
```vim
266-
Plug 'psf/black', { 'tag': '22.*.*' }
266+
Plug 'psf/black', { 'tag': '26.*.*' }
267267
```
268268

269269
##### Vundle

‎docs/integrations/github_actions.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ If you want to match versions covered by Black's
5050
with:
5151
options: "--check --verbose"
5252
src: "./src"
53-
version: "~= 22.0"
53+
version: "~= 26.0"
5454
```
5555

5656
To read the version from the `pyproject.toml` file instead, set `use_pyproject` to

‎docs/integrations/source_version_control.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Use [pre-commit](https://pre-commit.com/). Once you
88
repos:
99
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
1010
- repo: https://github.com/psf/black-pre-commit-mirror
11-
rev: 26.3.1
11+
rev: 26.5.0
1212
hooks:
1313
- id: black
1414
# It is recommended to specify the latest version of Python
@@ -34,7 +34,7 @@ include Jupyter Notebooks. To use this hook, simply replace the hook's `id: blac
3434
```yaml
3535
repos:
3636
- repo: https://github.com/psf/black-pre-commit-mirror
37-
rev: 26.3.1
37+
rev: 26.5.0
3838
hooks:
3939
- id: black-jupyter
4040
language_version: python3.11
@@ -64,7 +64,7 @@ Configure exclusions directly in `.pre-commit-config.yaml`:
6464
```yaml
6565
repos:
6666
- repo: https://github.com/psf/black-pre-commit-mirror
67-
rev: 26.3.1
67+
rev: 26.5.0
6868
hooks:
6969
- id: black
7070
exclude: ^migrations/|^generated/

‎docs/the_black_code_style/index.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ _Black_:
2929
- If code has been formatted with _Black_, it will remain unchanged when formatted with
3030
the same options using any other release in the same calendar year.
3131

32-
This means projects can safely use `black ~= 22.0` without worrying about formatting
33-
changes disrupting their project in 2022. We may still fix bugs where _Black_ crashes
32+
This means projects can safely use `black ~= 26.0` without worrying about formatting
33+
changes disrupting their project in 2026. We may still fix bugs where _Black_ crashes
3434
on some code, and make other improvements that do not affect formatting.
3535

3636
In rare cases, we may make changes affecting code that has not been previously

‎docs/usage_and_configuration/the_basics.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ configuration file for consistent results across environments.
280280

281281
```console
282282
$ black --version
283-
black, 26.3.1 (compiled: yes)
284-
$ black --required-version 26.3.1 -c "format = 'this'"
283+
black, 26.5.0 (compiled: yes)
284+
$ black --required-version 26.5.0 -c "format = 'this'"
285285
format = "this"
286286
$ black --required-version 31.5b2 -c "still = 'beta?!'"
287287
Oh no! 💥 💔 💥 The required version does not match the running version!
@@ -388,7 +388,7 @@ You can check the version of _Black_ you have installed using the `--version` fl
388388

389389
```console
390390
$ black --version
391-
black, 26.3.1
391+
black, 26.5.0
392392
```
393393

394394
#### `--config`

‎scripts/release.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ def cleanup_changes_template_for_release(self) -> None:
152152
)
153153

154154
# Remove all comments
155-
changes_string = re.sub(r"(?m)^<!--(?>(?:.|\n)*?-->)\n\n", "", changes_string)
155+
changes_string = re.sub(r"(?m)^<!--(?>(?:.|\n)*?-->)\n+", "", changes_string)
156156

157157
# Remove empty subheadings
158-
changes_string = re.sub(r"(?m)^###.+\n\n(?=#)", "", changes_string)
158+
changes_string = re.sub(r"(?m)^###.+\n+(?=#)", "", changes_string)
159159

160160
with self.changes_path.open("w", encoding="utf-8") as cfp:
161161
cfp.write(changes_string)

0 commit comments

Comments
 (0)