diff --git a/README.md b/README.md index fb8170b626a..e36e0fd0fb1 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Try it out now using the [Black Playground](https://black.vercel.app). Watch the ### 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 can't wait for the latest _hotness_ and want to install from GitHub, use: diff --git a/autoload/black.vim b/autoload/black.vim index 051fea05c3b..1cae6adab49 100644 --- a/autoload/black.vim +++ b/autoload/black.vim @@ -76,7 +76,7 @@ def _initialize_black_env(upgrade=False): pyver = sys.version_info[:3] if pyver < (3, 8): - print("Sorry, Black requires Python 3.8+ to run.") + print("Sorry, Black requires Python 3.9+ to run.") return False from pathlib import Path diff --git a/docs/faq.md b/docs/faq.md index d19ff8e7ace..51db1c90390 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -84,16 +84,17 @@ See [Using _Black_ with other tools](labels/why-pycodestyle-warnings). ## Which Python versions does Black support? -Currently the runtime requires Python 3.8-3.11. Formatting is supported for files -containing syntax from Python 3.3 to 3.11. We promise to support at least all Python -versions that have not reached their end of life. This is the case for both running -_Black_ and formatting code. +_Black_ generally supports all Python versions supported by CPython (see +[the Python devguide](https://devguide.python.org/versions/) for current information). +We promise to support at least all Python versions that have not reached their end of +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 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. -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? diff --git a/docs/getting_started.md b/docs/getting_started.md index 8f08b6c3398..98cc15739c2 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -16,7 +16,7 @@ Also, you can try out _Black_ online for minimal fuss on the ## 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 use pipx, you can install Black with `pipx install black`. diff --git a/docs/integrations/editors.md b/docs/integrations/editors.md index 6ca1205d4c2..d2940f114ba 100644 --- a/docs/integrations/editors.md +++ b/docs/integrations/editors.md @@ -236,7 +236,7 @@ Configuration: #### 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 external command. diff --git a/docs/usage_and_configuration/the_basics.md b/docs/usage_and_configuration/the_basics.md index 5c324be1c3c..bae72b2c8ac 100644 --- a/docs/usage_and_configuration/the_basics.md +++ b/docs/usage_and_configuration/the_basics.md @@ -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` 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 -through 3.11, you should write: +You should include all versions that your code supports. If you support Python 3.11 +through 3.13, you should write: ```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: ```toml -target-version = ["py38", "py39", "py310", "py311"] +target-version = ["py311", "py312", "py313"] ``` By default, Black will infer target versions from the project metadata in diff --git a/plugin/black.vim b/plugin/black.vim index 543184e1cd4..84dfc256f8e 100644 --- a/plugin/black.vim +++ b/plugin/black.vim @@ -21,7 +21,7 @@ endif if v:version < 700 || !has('python3') 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 command! Black :call __BLACK_MISSING() command! BlackUpgrade :call __BLACK_MISSING() @@ -72,12 +72,11 @@ endif function BlackComplete(ArgLead, CmdLine, CursorPos) return [ -\ 'target_version=py27', -\ 'target_version=py36', -\ 'target_version=py37', -\ 'target_version=py38', \ 'target_version=py39', \ 'target_version=py310', +\ 'target_version=py311', +\ 'target_version=py312', +\ 'target_version=py313', \ ] endfunction diff --git a/tests/data/cases/context_managers_38.py b/tests/data/cases/context_managers_38.py index 54fb97c708b..f125cdffb8a 100644 --- a/tests/data/cases/context_managers_38.py +++ b/tests/data/cases/context_managers_38.py @@ -1,4 +1,3 @@ -# flags: --minimum-version=3.8 with \ make_context_manager1() as cm1, \ make_context_manager2() as cm2, \ diff --git a/tests/data/cases/context_managers_39.py b/tests/data/cases/context_managers_39.py index 60fd1a56409..c9fcf9c8ba2 100644 --- a/tests/data/cases/context_managers_39.py +++ b/tests/data/cases/context_managers_39.py @@ -1,4 +1,3 @@ -# flags: --minimum-version=3.9 with \ make_context_manager1() as cm1, \ make_context_manager2() as cm2, \ diff --git a/tests/data/cases/context_managers_autodetect_39.py b/tests/data/cases/context_managers_autodetect_39.py index 98e674b2f9d..0d28f993108 100644 --- a/tests/data/cases/context_managers_autodetect_39.py +++ b/tests/data/cases/context_managers_autodetect_39.py @@ -1,4 +1,3 @@ -# flags: --minimum-version=3.9 # This file uses parenthesized context managers introduced in Python 3.9. diff --git a/tests/data/cases/pep_570.py b/tests/data/cases/pep_570.py index 2641c2b970e..ca8f7ab1d95 100644 --- a/tests/data/cases/pep_570.py +++ b/tests/data/cases/pep_570.py @@ -1,4 +1,3 @@ -# flags: --minimum-version=3.8 def positional_only_arg(a, /): pass diff --git a/tests/data/cases/pep_572.py b/tests/data/cases/pep_572.py index 742b6d5b7e4..d41805f1cb1 100644 --- a/tests/data/cases/pep_572.py +++ b/tests/data/cases/pep_572.py @@ -1,4 +1,3 @@ -# flags: --minimum-version=3.8 (a := 1) (a := a) if (match := pattern.search(data)) is None: diff --git a/tests/data/cases/pep_572_py39.py b/tests/data/cases/pep_572_py39.py index d1614624d99..b8b081b8c45 100644 --- a/tests/data/cases/pep_572_py39.py +++ b/tests/data/cases/pep_572_py39.py @@ -1,4 +1,3 @@ -# flags: --minimum-version=3.9 # Unparenthesized walruses are now allowed in set literals & set comprehensions # since Python 3.9 {x := 1, 2, 3} diff --git a/tests/data/cases/pep_572_remove_parens.py b/tests/data/cases/pep_572_remove_parens.py index f0026ceb032..75113771ae0 100644 --- a/tests/data/cases/pep_572_remove_parens.py +++ b/tests/data/cases/pep_572_remove_parens.py @@ -1,4 +1,3 @@ -# flags: --minimum-version=3.8 if (foo := 0): pass diff --git a/tests/data/cases/python37.py b/tests/data/cases/python37.py index 3f61106c45d..f69f6b4e58c 100644 --- a/tests/data/cases/python37.py +++ b/tests/data/cases/python37.py @@ -1,6 +1,3 @@ -# flags: --minimum-version=3.7 - - def f(): return (i * 2 async for i in arange(42)) diff --git a/tests/data/cases/python38.py b/tests/data/cases/python38.py index 919ea6aeed4..715641b1871 100644 --- a/tests/data/cases/python38.py +++ b/tests/data/cases/python38.py @@ -1,6 +1,3 @@ -# flags: --minimum-version=3.8 - - def starred_return(): my_list = ["value2", "value3"] return "value1", *my_list diff --git a/tests/data/cases/python39.py b/tests/data/cases/python39.py index 85eddc38e00..719c2b55745 100644 --- a/tests/data/cases/python39.py +++ b/tests/data/cases/python39.py @@ -1,5 +1,3 @@ -# flags: --minimum-version=3.9 - @relaxed_decorator[0] def f(): ... diff --git a/tests/data/cases/remove_with_brackets.py b/tests/data/cases/remove_with_brackets.py index 3ee64902a30..ea58ab93a16 100644 --- a/tests/data/cases/remove_with_brackets.py +++ b/tests/data/cases/remove_with_brackets.py @@ -1,4 +1,3 @@ -# flags: --minimum-version=3.9 with (open("bla.txt")): pass diff --git a/tox.ini b/tox.ini index 7bc03d05e46..d64fe7f2210 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] 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] setenv =