Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/diff_shades.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- uses: actions/setup-python@v6
with:
python-version: "3.11"
python-version: "3.13"

- name: Install diff-shades and support dependencies
run: |
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:

- uses: actions/setup-python@v6
with:
python-version: "3.11"
python-version: "3.13"

- name: Install diff-shades
run: |
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:

- uses: actions/setup-python@v6
with:
python-version: "3.11"
python-version: "3.13"

- name: Install diff-shades
run: |
Expand Down Expand Up @@ -163,6 +163,7 @@ jobs:
compare:
name: compare / ${{ matrix.mode }}
needs: ["configure", "analysis-base", "analysis-target"]
if: !cancelled()
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -178,7 +179,7 @@ jobs:

- uses: actions/setup-python@v6
with:
python-version: "3.11"
python-version: "3.13"

- name: Install diff-shades and support dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/diff_shades_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "*"
python-version: "3.13"

- name: Install support dependencies
run: |
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Documentation

on: [push, pull_request]
on:
push:
paths: ["docs/**", "pyproject.toml", ".github/workflows/*"]

pull_request:
paths: ["docs/**", "pyproject.toml", ".github/workflows/*"]

permissions:
contents: read
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Fuzz

on: [push, pull_request]
on:
push:
paths-ignore:
- "docs/**"
- "*.md"

pull_request:
paths-ignore:
- "docs/**"
- "*.md"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.13"]
os: [macOS-latest, ubuntu-latest, windows-latest, windows-11-arm]
python-version: ["3.12", "3.13", "3.14"]
os: [macOS-latest, ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
- name: Set up latest Python
uses: actions/setup-python@v6
with:
python-version: "3.12.4"
python-version: "3.13"

- name: Install black with uvloop
run: |
Expand Down
4 changes: 2 additions & 2 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ also be removed some time in the future without a deprecation period.

`await`/`async` as soft keywords/indentifiers are no longer supported as of 25.9.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.
Runtime support for 3.6 was removed in version 22.10.0, for 3.7 in version 23.7.0, for
3.8 in version 24.10.0, and for 3.9 in version 25.12.0.

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

Expand Down
4 changes: 1 addition & 3 deletions gallery/gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ def download_and_extract(package: str, version: str | None, directory: Path) ->
return directory / result_dir


def get_package(
package: str, version: str | None, directory: Path
) -> Path | None:
def get_package(package: str, version: str | None, directory: Path) -> Path | None:
try:
return download_and_extract(package, version, directory)
except Exception:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ extend-exclude = '''
# The following are specific to Black, you probably don't want those.
tests/data/
| profiling/
| scripts/generate_schema.py # Uses match syntax
)
'''
# We use the unstable style for formatting Black itself. If you
Expand Down
12 changes: 1 addition & 11 deletions src/black/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
from collections.abc import (
Collection,
Generator,
Iterator,
MutableMapping,
Sequence,
)
from contextlib import contextmanager
from contextlib import nullcontext
from dataclasses import replace
from datetime import datetime, timezone
from enum import Enum
Expand Down Expand Up @@ -1640,15 +1639,6 @@ def assert_stable(
) from None


@contextmanager
def nullcontext() -> Iterator[None]:
"""Return an empty context manager.

To be used like `nullcontext` in Python 3.7.
"""
yield


def patched_main() -> None:
# PyInstaller patches multiprocessing to need freeze_support() even in non-Windows
# environments so just assume we always need to call it if frozen.
Expand Down
19 changes: 7 additions & 12 deletions tests/test_black.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,7 @@ def test_python37(self) -> None:
_, source, expected = read_data_from_file(source_path)
actual = fs(source)
self.assertFormatEqual(expected, actual)
major, minor = sys.version_info[:2]
if major > 3 or (major == 3 and minor >= 7):
black.assert_equivalent(source, actual)
black.assert_equivalent(source, actual)
black.assert_stable(source, actual, DEFAULT_MODE)
# ensure black can parse this when the target is 3.7
self.invokeBlack([str(source_path), "--target-version", "py37"])
Expand Down Expand Up @@ -1758,16 +1756,13 @@ def test_bpo_33660_workaround(self) -> None:
if system() == "Windows":
return

# https://bugs.python.org/issue33660
# Can be removed when we drop support for Python 3.8.5
root = Path("/")
with change_directory(root):
path = Path("workspace") / "project"
report = black.Report(verbose=True)
resolves_outside = black.resolves_outside_root_or_cannot_stat(
path, root, report
)
self.assertIs(resolves_outside, False)
path = Path("workspace") / "project"
report = black.Report(verbose=True)
resolves_outside = black.resolves_outside_root_or_cannot_stat(
path, root, report
)
self.assertIs(resolves_outside, False)

def test_normalize_path_ignore_windows_junctions_outside_of_root(self) -> None:
if system() != "Windows":
Expand Down