Skip to content

Commit 32e9218

Browse files
Merge branch 'main' into standardize-type-comments
2 parents aeca4e4 + 96ca1b6 commit 32e9218

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+685
-226
lines changed

.github/workflows/pypi_upload.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ jobs:
4747
include: ${{ steps.set-matrix.outputs.include }}
4848
steps:
4949
- uses: actions/checkout@v4
50+
# Keep cibuildwheel version in sync with below
5051
- name: Install cibuildwheel and pypyp
5152
run: |
52-
pipx install cibuildwheel==2.20.0
53+
pipx install cibuildwheel==2.21.2
5354
pipx install pypyp==1
5455
- name: generate matrix
5556
if: github.event_name != 'pull_request'
@@ -74,7 +75,7 @@ jobs:
7475
| pyp 'json.dumps({"only": x, "os": "ubuntu-latest"})'
7576
} | pyp 'json.dumps(list(map(json.loads, lines)))' > /tmp/matrix
7677
env:
77-
CIBW_BUILD: "cp39-* cp312-*"
78+
CIBW_BUILD: "cp39-* cp313-*"
7879
CIBW_ARCHS_LINUX: x86_64
7980
- id: set-matrix
8081
run: echo "include=$(cat /tmp/matrix)" | tee -a $GITHUB_OUTPUT
@@ -90,14 +91,15 @@ jobs:
9091

9192
steps:
9293
- uses: actions/checkout@v4
93-
- uses: pypa/[email protected]
94+
# Keep cibuildwheel version in sync with above
95+
- uses: pypa/[email protected]
9496
with:
9597
only: ${{ matrix.only }}
9698

9799
- name: Upload wheels as workflow artifacts
98-
uses: actions/upload-artifact@v3
100+
uses: actions/upload-artifact@v4
99101
with:
100-
name: ${{ matrix.name }}-mypyc-wheels
102+
name: ${{ matrix.only }}-mypyc-wheels
101103
path: ./wheelhouse/*.whl
102104

103105
- if: github.event_name == 'release'

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ repos:
3939
exclude: ^src/blib2to3/
4040

4141
- repo: https://github.com/pre-commit/mirrors-mypy
42-
rev: v1.11.2
42+
rev: v1.12.0
4343
hooks:
4444
- id: mypy
4545
exclude: ^(docs/conf.py|scripts/generate_schema.py)$

CHANGES.md

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,19 @@
66

77
<!-- Include any especially major or disruptive changes here -->
88

9-
- Black is now officially tested with Python 3.13. Note that Black does not yet provide
10-
mypyc-compiled wheels for Python 3.13, so performance may be slower than on other
11-
versions of Python. We will provide 3.13 mypyc-compiled wheels in a future release.
12-
(#4436)
13-
- Black will issue an error when used with Python 3.12.5, due to an upstream memory
14-
safety issue in Python 3.12.5 that can cause Black's AST safety checks to fail. Please
15-
use Python 3.12.6 or Python 3.12.4 instead. (#4447)
16-
- Black no longer supports running with Python 3.8 (#4452)
17-
189
### Stable style
1910

2011
<!-- Changes that affect Black's stable style -->
2112

22-
- Fix crashes involving comments in parenthesised return types or `X | Y` style unions.
23-
(#4453)
24-
- Fix skipping Jupyter cells with unknown `%%` magic (#4462)
13+
- Fix formatting cells in IPython notebooks with magic methods and starting or trailing
14+
empty lines (#4484)
2515

2616
### Preview style
2717

2818
<!-- Changes that affect Black's preview style -->
2919

30-
- Fix type annotation spacing between * and more complex type variable tuple (i.e. `def
31-
fn(*args: *tuple[*Ts, T]) -> None: pass`) (#4440)
3220
- Standardize type comments to always have one space (#4467)
33-
34-
### Caching
35-
36-
- Fix bug where the cache was shared between runs with and without `--unstable` (#4466)
21+
- Remove parentheses around sole list items (#4312)
3722

3823
### Configuration
3924

@@ -43,8 +28,8 @@
4328

4429
<!-- Changes to how Black is packaged, such as dependency requirements -->
4530

46-
- Upgrade version of mypyc used to 1.11.2 (#4450)
47-
- `blackd` now requires a newer version of aiohttp. (#4451)
31+
- Store license identifier inside the `License-Expression` metadata field, see
32+
[PEP 639](https://peps.python.org/pep-0639/). (#4479)
4833

4934
### Parser
5035

@@ -58,9 +43,6 @@
5843

5944
<!-- Changes to Black's terminal output and error messages -->
6045

61-
- Added Python target version information on parse error (#4378)
62-
- Add information about Black version to internal error messages (#4457)
63-
6446
### _Blackd_
6547

6648
<!-- Changes to blackd -->
@@ -74,6 +56,42 @@
7456
<!-- Major changes to documentation and policies. Small docs changes
7557
don't need a changelog entry. -->
7658

59+
## 24.10.0
60+
61+
### Highlights
62+
63+
- Black is now officially tested with Python 3.13 and provides Python 3.13
64+
mypyc-compiled wheels. (#4436) (#4449)
65+
- Black will issue an error when used with Python 3.12.5, due to an upstream memory
66+
safety issue in Python 3.12.5 that can cause Black's AST safety checks to fail. Please
67+
use Python 3.12.6 or Python 3.12.4 instead. (#4447)
68+
- Black no longer supports running with Python 3.8 (#4452)
69+
70+
### Stable style
71+
72+
- Fix crashes involving comments in parenthesised return types or `X | Y` style unions.
73+
(#4453)
74+
- Fix skipping Jupyter cells with unknown `%%` magic (#4462)
75+
76+
### Preview style
77+
78+
- Fix type annotation spacing between * and more complex type variable tuple (i.e. `def
79+
fn(*args: *tuple[*Ts, T]) -> None: pass`) (#4440)
80+
81+
### Caching
82+
83+
- Fix bug where the cache was shared between runs with and without `--unstable` (#4466)
84+
85+
### Packaging
86+
87+
- Upgrade version of mypyc used to 1.12 beta (#4450) (#4449)
88+
- `blackd` now requires a newer version of aiohttp. (#4451)
89+
90+
### Output
91+
92+
- Added Python target version information on parse error (#4378)
93+
- Add information about Black version to internal error messages (#4457)
94+
7795
## 24.8.0
7896

7997
### Stable style

CONTRIBUTING.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# Contributing to _Black_
22

3-
Welcome! Happy to see you willing to make the project better. Have you read the entire
4-
[user documentation](https://black.readthedocs.io/en/latest/) yet?
3+
Welcome future contributor! We're happy to see you willing to make the project better.
54

6-
Our [contributing documentation](https://black.readthedocs.org/en/latest/contributing/)
7-
contains details on all you need to know about contributing to _Black_, the basics to
8-
the internals of _Black_.
5+
If you aren't familiar with _Black_, or are looking for documentation on something
6+
specific, the [user documentation](https://black.readthedocs.io/en/latest/) is the best
7+
place to look.
98

10-
We look forward to your contributions!
9+
For getting started on contributing, please read the
10+
[contributing documentation](https://black.readthedocs.org/en/latest/contributing/) for
11+
all you need to know.
12+
13+
Thank you, and we look forward to your contributions!

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Try it out now using the [Black Playground](https://black.vercel.app). Watch the
3838

3939
### Installation
4040

41-
_Black_ can be installed by running `pip install black`. It requires Python 3.8+ to run.
41+
_Black_ can be installed by running `pip install black`. It requires Python 3.9+ to run.
4242
If you want to format Jupyter Notebooks, install with `pip install "black[jupyter]"`.
4343

4444
If you can't wait for the latest _hotness_ and want to install from GitHub, use:

autoload/black.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _initialize_black_env(upgrade=False):
7676

7777
pyver = sys.version_info[:3]
7878
if pyver < (3, 8):
79-
print("Sorry, Black requires Python 3.8+ to run.")
79+
print("Sorry, Black requires Python 3.9+ to run.")
8080
return False
8181

8282
from pathlib import Path

docs/contributing/the_basics.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ An overview on contributing to the _Black_ project.
77
Development on the latest version of Python is preferred. You can use any operating
88
system.
99

10-
Install development dependencies inside a virtual environment of your choice, for
10+
First clone the _Black_ repository:
11+
12+
```console
13+
$ git clone https://github.com/psf/black.git
14+
$ cd black
15+
```
16+
17+
Then install development dependencies inside a virtual environment of your choice, for
1118
example:
1219

1320
```console
@@ -48,13 +55,16 @@ Further examples of invoking the tests
4855
# Run tests on a specific python version
4956
(.venv)$ tox -e py39
5057

51-
# pass arguments to pytest
58+
# Run an individual test
59+
(.venv)$ pytest -k <test name>
60+
61+
# Pass arguments to pytest
5262
(.venv)$ tox -e py -- --no-cov
5363

54-
# print full tree diff, see documentation below
64+
# Print full tree diff, see documentation below
5565
(.venv)$ tox -e py -- --print-full-tree
5666

57-
# disable diff printing, see documentation below
67+
# Disable diff printing, see documentation below
5868
(.venv)$ tox -e py -- --print-tree-diff=False
5969
```
6070

@@ -99,42 +109,48 @@ default. To turn it off pass `--print-tree-diff=False`.
99109
`Black` has CI that will check for an entry corresponding to your PR in `CHANGES.md`. If
100110
you feel this PR does not require a changelog entry please state that in a comment and a
101111
maintainer can add a `skip news` label to make the CI pass. Otherwise, please ensure you
102-
have a line in the following format:
112+
have a line in the following format added below the appropriate header:
103113

104114
```md
105115
- `Black` is now more awesome (#X)
106116
```
107117

118+
<!---
119+
The Next PR Number link uses HTML because of a bug in MyST-Parser that double-escapes the ampersand, causing the query parameters to not be processed.
120+
MyST-Parser issue: https://github.com/executablebooks/MyST-Parser/issues/760
121+
MyST-Parser stalled fix PR: https://github.com/executablebooks/MyST-Parser/pull/929
122+
-->
123+
108124
Note that X should be your PR number, not issue number! To workout X, please use
109-
[Next PR Number](https://ichard26.github.io/next-pr-number/?owner=psf&name=black). This
110-
is not perfect but saves a lot of release overhead as now the releaser does not need to
111-
go back and workout what to add to the `CHANGES.md` for each release.
125+
<a href="https://ichard26.github.io/next-pr-number/?owner=psf&name=black">Next PR
126+
Number</a>. This is not perfect but saves a lot of release overhead as now the releaser
127+
does not need to go back and workout what to add to the `CHANGES.md` for each release.
112128

113129
### Style Changes
114130

115131
If a change would affect the advertised code style, please modify the documentation (The
116132
_Black_ code style) to reflect that change. Patches that fix unintended bugs in
117133
formatting don't need to be mentioned separately though. If the change is implemented
118134
with the `--preview` flag, please include the change in the future style document
119-
instead and write the changelog entry under a dedicated "Preview changes" heading.
135+
instead and write the changelog entry under the dedicated "Preview style" heading.
120136

121137
### Docs Testing
122138

123139
If you make changes to docs, you can test they still build locally too.
124140

125141
```console
126142
(.venv)$ pip install -r docs/requirements.txt
127-
(.venv)$ pip install -e .[d]
143+
(.venv)$ pip install -e ".[d]"
128144
(.venv)$ sphinx-build -a -b html -W docs/ docs/_build/
129145
```
130146

131147
## Hygiene
132148

133149
If you're fixing a bug, add a test. Run it first to confirm it fails, then fix the bug,
134-
run it again to confirm it's really fixed.
150+
and run the test again to confirm it's really fixed.
135151

136-
If adding a new feature, add a test. In fact, always add a test. But wait, before adding
137-
any large feature, first open an issue for us to discuss the idea first.
152+
If adding a new feature, add a test. In fact, always add a test. If adding a large
153+
feature, please first open an issue to discuss it beforehand.
138154

139155
## Finally
140156

docs/faq.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,17 @@ See [Using _Black_ with other tools](labels/why-pycodestyle-warnings).
8484

8585
## Which Python versions does Black support?
8686

87-
Currently the runtime requires Python 3.8-3.11. Formatting is supported for files
88-
containing syntax from Python 3.3 to 3.11. We promise to support at least all Python
89-
versions that have not reached their end of life. This is the case for both running
90-
_Black_ and formatting code.
87+
_Black_ generally supports all Python versions supported by CPython (see
88+
[the Python devguide](https://devguide.python.org/versions/) for current information).
89+
We promise to support at least all Python versions that have not reached their end of
90+
life. This is the case for both running _Black_ and formatting code.
9191

9292
Support for formatting Python 2 code was removed in version 22.0. While we've made no
9393
plans to stop supporting older Python 3 minor versions immediately, their support might
9494
also be removed some time in the future without a deprecation period.
9595

96-
Runtime support for 3.7 was removed in version 23.7.0.
96+
Runtime support for 3.6 was removed in version 22.10.0, for 3.7 in version 23.7.0, and
97+
for 3.8 in version 24.10.0.
9798

9899
## Why does my linter or typechecker complain after I format my code?
99100

docs/getting_started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Also, you can try out _Black_ online for minimal fuss on the
1616

1717
## Installation
1818

19-
_Black_ can be installed by running `pip install black`. It requires Python 3.8+ to run.
19+
_Black_ can be installed by running `pip install black`. It requires Python 3.9+ to run.
2020
If you want to format Jupyter Notebooks, install with `pip install "black[jupyter]"`.
2121

2222
If you use pipx, you can install Black with `pipx install black`.

docs/integrations/editors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ Configuration:
236236

237237
#### Installation
238238

239-
This plugin **requires Vim 7.0+ built with Python 3.8+ support**. It needs Python 3.8 to
239+
This plugin **requires Vim 7.0+ built with Python 3.9+ support**. It needs Python 3.9 to
240240
be able to run _Black_ inside the Vim process which is much faster than calling an
241241
external command.
242242

0 commit comments

Comments
 (0)