From 1b6b0bfcac37428f7f2eb6c97fd0a25628324db7 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 17 Nov 2023 15:57:00 +0000 Subject: [PATCH 1/2] Improve annotations for `black.concurrency.cancel` (#4047) --- src/black/concurrency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/black/concurrency.py b/src/black/concurrency.py index 55c96b66c86..ff0a8f5fd32 100644 --- a/src/black/concurrency.py +++ b/src/black/concurrency.py @@ -38,7 +38,7 @@ def maybe_install_uvloop() -> None: pass -def cancel(tasks: Iterable["asyncio.Task[Any]"]) -> None: +def cancel(tasks: Iterable["asyncio.Future[Any]"]) -> None: """asyncio signal handler that cancels all `tasks` and reports to stderr.""" err("Aborted!") for task in tasks: From 5773d5cd2b532da185808f974a5875ca09064e28 Mon Sep 17 00:00:00 2001 From: cobalt <61329810+RedGuy12@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:39:44 -0600 Subject: [PATCH 2/2] Document target version inference (#4048) --- docs/usage_and_configuration/the_basics.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/usage_and_configuration/the_basics.md b/docs/usage_and_configuration/the_basics.md index 6e7ee584cf9..546fdc474e8 100644 --- a/docs/usage_and_configuration/the_basics.md +++ b/docs/usage_and_configuration/the_basics.md @@ -67,6 +67,10 @@ In a [configuration file](#configuration-via-a-file), you can write: target-version = ["py38", "py39", "py310", "py311"] ``` +By default, Black will infer target versions from the project metadata in +`pyproject.toml`, specifically the `[project.requires-python]` field. If this does not +yield conclusive results, Black will use per-file auto-detection. + _Black_ uses this option to decide what grammar to use to parse your code. In addition, it may use it to decide what style to use. For example, support for a trailing comma after `*args` in a function call was added in Python 3.5, so _Black_ will add this comma