Clean up Python 3.8 remnants (#4473)

This commit is contained in:
Jelle Zijlstra 2024-10-08 19:11:22 -07:00 committed by GitHub
parent 1b2427a2b7
commit 32ebb93003
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 19 additions and 35 deletions

View File

@ -38,7 +38,7 @@ Try it out now using the [Black Playground](https://black.vercel.app). Watch the
### Installation ### Installation
_Black_ can be installed by running `pip install black`. It requires Python 3.8+ to run. _Black_ can be installed by running `pip install black`. It requires Python 3.9+ to run.
If you want to format Jupyter Notebooks, install with `pip install "black[jupyter]"`. If you want to format Jupyter Notebooks, install with `pip install "black[jupyter]"`.
If you can't wait for the latest _hotness_ and want to install from GitHub, use: If you can't wait for the latest _hotness_ and want to install from GitHub, use:

View File

@ -76,7 +76,7 @@ def _initialize_black_env(upgrade=False):
pyver = sys.version_info[:3] pyver = sys.version_info[:3]
if pyver < (3, 8): if pyver < (3, 8):
print("Sorry, Black requires Python 3.8+ to run.") print("Sorry, Black requires Python 3.9+ to run.")
return False return False
from pathlib import Path from pathlib import Path

View File

@ -84,16 +84,17 @@ See [Using _Black_ with other tools](labels/why-pycodestyle-warnings).
## Which Python versions does Black support? ## Which Python versions does Black support?
Currently the runtime requires Python 3.8-3.11. Formatting is supported for files _Black_ generally supports all Python versions supported by CPython (see
containing syntax from Python 3.3 to 3.11. We promise to support at least all Python [the Python devguide](https://devguide.python.org/versions/) for current information).
versions that have not reached their end of life. This is the case for both running We promise to support at least all Python versions that have not reached their end of
_Black_ and formatting code. life. This is the case for both running _Black_ and formatting code.
Support for formatting Python 2 code was removed in version 22.0. While we've made no Support for formatting Python 2 code was removed in version 22.0. While we've made no
plans to stop supporting older Python 3 minor versions immediately, their support might plans to stop supporting older Python 3 minor versions immediately, their support might
also be removed some time in the future without a deprecation period. also be removed some time in the future without a deprecation period.
Runtime support for 3.7 was removed in version 23.7.0. Runtime support for 3.6 was removed in version 22.10.0, for 3.7 in version 23.7.0, and
for 3.8 in version 24.10.0.
## Why does my linter or typechecker complain after I format my code? ## Why does my linter or typechecker complain after I format my code?

View File

@ -16,7 +16,7 @@ Also, you can try out _Black_ online for minimal fuss on the
## Installation ## Installation
_Black_ can be installed by running `pip install black`. It requires Python 3.8+ to run. _Black_ can be installed by running `pip install black`. It requires Python 3.9+ to run.
If you want to format Jupyter Notebooks, install with `pip install "black[jupyter]"`. If you want to format Jupyter Notebooks, install with `pip install "black[jupyter]"`.
If you use pipx, you can install Black with `pipx install black`. If you use pipx, you can install Black with `pipx install black`.

View File

@ -236,7 +236,7 @@ Configuration:
#### Installation #### Installation
This plugin **requires Vim 7.0+ built with Python 3.8+ support**. It needs Python 3.8 to This plugin **requires Vim 7.0+ built with Python 3.9+ support**. It needs Python 3.9 to
be able to run _Black_ inside the Vim process which is much faster than calling an be able to run _Black_ inside the Vim process which is much faster than calling an
external command. external command.

View File

@ -70,17 +70,17 @@ See also [the style documentation](labels/line-length).
Python versions that should be supported by Black's output. You can run `black --help` Python versions that should be supported by Black's output. You can run `black --help`
and look for the `--target-version` option to see the full list of supported versions. and look for the `--target-version` option to see the full list of supported versions.
You should include all versions that your code supports. If you support Python 3.8 You should include all versions that your code supports. If you support Python 3.11
through 3.11, you should write: through 3.13, you should write:
```console ```console
$ black -t py38 -t py39 -t py310 -t py311 $ black -t py311 -t py312 -t py313
``` ```
In a [configuration file](#configuration-via-a-file), you can write: In a [configuration file](#configuration-via-a-file), you can write:
```toml ```toml
target-version = ["py38", "py39", "py310", "py311"] target-version = ["py311", "py312", "py313"]
``` ```
By default, Black will infer target versions from the project metadata in By default, Black will infer target versions from the project metadata in

View File

@ -21,7 +21,7 @@ endif
if v:version < 700 || !has('python3') if v:version < 700 || !has('python3')
func! __BLACK_MISSING() func! __BLACK_MISSING()
echo "The black.vim plugin requires vim7.0+ with Python 3.6 support." echo "The black.vim plugin requires vim7.0+ with Python 3.9 support."
endfunc endfunc
command! Black :call __BLACK_MISSING() command! Black :call __BLACK_MISSING()
command! BlackUpgrade :call __BLACK_MISSING() command! BlackUpgrade :call __BLACK_MISSING()
@ -72,12 +72,11 @@ endif
function BlackComplete(ArgLead, CmdLine, CursorPos) function BlackComplete(ArgLead, CmdLine, CursorPos)
return [ return [
\ 'target_version=py27',
\ 'target_version=py36',
\ 'target_version=py37',
\ 'target_version=py38',
\ 'target_version=py39', \ 'target_version=py39',
\ 'target_version=py310', \ 'target_version=py310',
\ 'target_version=py311',
\ 'target_version=py312',
\ 'target_version=py313',
\ ] \ ]
endfunction endfunction

View File

@ -1,4 +1,3 @@
# flags: --minimum-version=3.8
with \ with \
make_context_manager1() as cm1, \ make_context_manager1() as cm1, \
make_context_manager2() as cm2, \ make_context_manager2() as cm2, \

View File

@ -1,4 +1,3 @@
# flags: --minimum-version=3.9
with \ with \
make_context_manager1() as cm1, \ make_context_manager1() as cm1, \
make_context_manager2() as cm2, \ make_context_manager2() as cm2, \

View File

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

View File

@ -1,4 +1,3 @@
# flags: --minimum-version=3.8
def positional_only_arg(a, /): def positional_only_arg(a, /):
pass pass

View File

@ -1,4 +1,3 @@
# flags: --minimum-version=3.8
(a := 1) (a := 1)
(a := a) (a := a)
if (match := pattern.search(data)) is None: if (match := pattern.search(data)) is None:

View File

@ -1,4 +1,3 @@
# flags: --minimum-version=3.9
# Unparenthesized walruses are now allowed in set literals & set comprehensions # Unparenthesized walruses are now allowed in set literals & set comprehensions
# since Python 3.9 # since Python 3.9
{x := 1, 2, 3} {x := 1, 2, 3}

View File

@ -1,4 +1,3 @@
# flags: --minimum-version=3.8
if (foo := 0): if (foo := 0):
pass pass

View File

@ -1,6 +1,3 @@
# flags: --minimum-version=3.7
def f(): def f():
return (i * 2 async for i in arange(42)) return (i * 2 async for i in arange(42))

View File

@ -1,6 +1,3 @@
# flags: --minimum-version=3.8
def starred_return(): def starred_return():
my_list = ["value2", "value3"] my_list = ["value2", "value3"]
return "value1", *my_list return "value1", *my_list

View File

@ -1,5 +1,3 @@
# flags: --minimum-version=3.9
@relaxed_decorator[0] @relaxed_decorator[0]
def f(): def f():
... ...

View File

@ -1,4 +1,3 @@
# flags: --minimum-version=3.9
with (open("bla.txt")): with (open("bla.txt")):
pass pass

View File

@ -1,6 +1,6 @@
[tox] [tox]
isolated_build = true isolated_build = true
envlist = {,ci-}py{38,39,310,311,py3},fuzz,run_self,generate_schema envlist = {,ci-}py{39,310,311,312,313,py3},fuzz,run_self,generate_schema
[testenv] [testenv]
setenv = setenv =