Skip to content

Commit 32ebb93

Browse files
Clean up Python 3.8 remnants (psf#4473)
1 parent 1b2427a commit 32ebb93

19 files changed

+19
-35
lines changed

README.md

+1-1
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

+1-1
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/faq.md

+6-5
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

+1-1
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

+1-1
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

docs/usage_and_configuration/the_basics.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ See also [the style documentation](labels/line-length).
7070

7171
Python versions that should be supported by Black's output. You can run `black --help`
7272
and look for the `--target-version` option to see the full list of supported versions.
73-
You should include all versions that your code supports. If you support Python 3.8
74-
through 3.11, you should write:
73+
You should include all versions that your code supports. If you support Python 3.11
74+
through 3.13, you should write:
7575

7676
```console
77-
$ black -t py38 -t py39 -t py310 -t py311
77+
$ black -t py311 -t py312 -t py313
7878
```
7979

8080
In a [configuration file](#configuration-via-a-file), you can write:
8181

8282
```toml
83-
target-version = ["py38", "py39", "py310", "py311"]
83+
target-version = ["py311", "py312", "py313"]
8484
```
8585

8686
By default, Black will infer target versions from the project metadata in

plugin/black.vim

+4-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ endif
2121

2222
if v:version < 700 || !has('python3')
2323
func! __BLACK_MISSING()
24-
echo "The black.vim plugin requires vim7.0+ with Python 3.6 support."
24+
echo "The black.vim plugin requires vim7.0+ with Python 3.9 support."
2525
endfunc
2626
command! Black :call __BLACK_MISSING()
2727
command! BlackUpgrade :call __BLACK_MISSING()
@@ -72,12 +72,11 @@ endif
7272

7373
function BlackComplete(ArgLead, CmdLine, CursorPos)
7474
return [
75-
\ 'target_version=py27',
76-
\ 'target_version=py36',
77-
\ 'target_version=py37',
78-
\ 'target_version=py38',
7975
\ 'target_version=py39',
8076
\ 'target_version=py310',
77+
\ 'target_version=py311',
78+
\ 'target_version=py312',
79+
\ 'target_version=py313',
8180
\ ]
8281
endfunction
8382

tests/data/cases/context_managers_38.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# flags: --minimum-version=3.8
21
with \
32
make_context_manager1() as cm1, \
43
make_context_manager2() as cm2, \

tests/data/cases/context_managers_39.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# flags: --minimum-version=3.9
21
with \
32
make_context_manager1() as cm1, \
43
make_context_manager2() as cm2, \

tests/data/cases/context_managers_autodetect_39.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# flags: --minimum-version=3.9
21
# This file uses parenthesized context managers introduced in Python 3.9.
32

43

tests/data/cases/pep_570.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# flags: --minimum-version=3.8
21
def positional_only_arg(a, /):
32
pass
43

tests/data/cases/pep_572.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# flags: --minimum-version=3.8
21
(a := 1)
32
(a := a)
43
if (match := pattern.search(data)) is None:

tests/data/cases/pep_572_py39.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# flags: --minimum-version=3.9
21
# Unparenthesized walruses are now allowed in set literals & set comprehensions
32
# since Python 3.9
43
{x := 1, 2, 3}

tests/data/cases/pep_572_remove_parens.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# flags: --minimum-version=3.8
21
if (foo := 0):
32
pass
43

tests/data/cases/python37.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# flags: --minimum-version=3.7
2-
3-
41
def f():
52
return (i * 2 async for i in arange(42))
63

tests/data/cases/python38.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# flags: --minimum-version=3.8
2-
3-
41
def starred_return():
52
my_list = ["value2", "value3"]
63
return "value1", *my_list

tests/data/cases/python39.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# flags: --minimum-version=3.9
2-
31
@relaxed_decorator[0]
42
def f():
53
...

tests/data/cases/remove_with_brackets.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# flags: --minimum-version=3.9
21
with (open("bla.txt")):
32
pass
43

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
isolated_build = true
3-
envlist = {,ci-}py{38,39,310,311,py3},fuzz,run_self,generate_schema
3+
envlist = {,ci-}py{39,310,311,312,313,py3},fuzz,run_self,generate_schema
44

55
[testenv]
66
setenv =

0 commit comments

Comments
 (0)