Skip to content

Commit

Permalink
Merge branch 'main' into psfgh-4158
Browse files Browse the repository at this point in the history
  • Loading branch information
cobaltt7 authored Dec 8, 2024
2 parents a54503d + 0db1173 commit 96634f4
Show file tree
Hide file tree
Showing 116 changed files with 3,261 additions and 926 deletions.
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ current development version. To confirm this, you have three options:
1. Update Black's version if a newer release exists: `pip install -U black`
2. Use the online formatter at <https://black.vercel.app/?version=main>, which will use
the latest main branch.
the latest main branch. Note that the online formatter currently runs on
an older version of Python and may not support newer syntax, such as the
extended f-string syntax added in Python 3.12.
3. Or run _Black_ on your machine:
- create a new virtualenv (make sure it's the same Python version);
- clone this repository;
Expand Down
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ updates:
schedule:
interval: "weekly"
labels: ["skip news", "C: dependencies", "T: documentation"]
reviewers: ["ichard26"]
4 changes: 2 additions & 2 deletions .github/workflows/diff_shades.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Install diff-shades and support dependencies
run: |
python -m pip install 'click==8.1.3' packaging urllib3
python -m pip install 'click>=8.1.7' packaging urllib3
python -m pip install https://github.com/ichard26/diff-shades/archive/stable.zip
- name: Calculate run configuration & metadata
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Install diff-shades and support dependencies
run: |
python -m pip install https://github.com/ichard26/diff-shades/archive/stable.zip
python -m pip install 'click==8.1.3' packaging urllib3
python -m pip install 'click>=8.1.7' packaging urllib3
# After checking out old revisions, this might not exist so we'll use a copy.
cat scripts/diff_shades_gha_helper.py > helper.py
git config user.name "diff-shades-gha"
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ jobs:
- name: Set up latest Python
uses: actions/setup-python@v5
with:
python-version: "*"
python-version: "3.13"
allow-prereleases: true

- name: Install dependencies
run: |
python -m pip install uv
python -m uv pip install --system -e ".[d]"
python -m uv pip install --system -r "docs/requirements.txt"
python -m uv venv
python -m uv pip install -e ".[d]"
python -m uv pip install -r "docs/requirements.txt"
- name: Build documentation
run: sphinx-build -a -b html -W --keep-going docs/ docs/_build
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
latest_non_release)" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
Expand All @@ -47,7 +47,7 @@ jobs:
if:
${{ github.event_name == 'release' && github.event.action == 'published' &&
!github.event.release.prerelease }}
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
Expand All @@ -58,7 +58,7 @@ jobs:
if:
${{ github.event_name == 'release' && github.event.action == 'published' &&
github.event.release.prerelease }}
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12.4", "3.13"]

steps:
- uses: actions/checkout@v4
Expand All @@ -31,6 +31,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install dependencies
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
- name: Set up latest Python
uses: actions/setup-python@v5
with:
python-version: "*"
python-version: "3.13"
allow-prereleases: true

- name: Install dependencies
run: |
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
- name: Set up latest Python
uses: actions/setup-python@v5
with:
python-version: "*"
python-version: "3.13"
allow-prereleases: true

- name: Install latest pip, build, twine
run: |
Expand All @@ -46,9 +47,10 @@ jobs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v4
# Keep cibuildwheel version in sync with below
- name: Install cibuildwheel and pypyp
run: |
pipx install cibuildwheel==2.15.0
pipx install cibuildwheel==2.21.2
pipx install pypyp==1
- name: generate matrix
if: github.event_name != 'pull_request'
Expand All @@ -73,7 +75,7 @@ jobs:
| pyp 'json.dumps({"only": x, "os": "ubuntu-latest"})'
} | pyp 'json.dumps(list(map(json.loads, lines)))' > /tmp/matrix
env:
CIBW_BUILD: "cp38-* cp312-*"
CIBW_BUILD: "cp39-* cp313-*"
CIBW_ARCHS_LINUX: x86_64
- id: set-matrix
run: echo "include=$(cat /tmp/matrix)" | tee -a $GITHUB_OUTPUT
Expand All @@ -89,14 +91,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v2.17.0
# Keep cibuildwheel version in sync with above
- uses: pypa/cibuildwheel@v2.22.0
with:
only: ${{ matrix.only }}

- name: Upload wheels as workflow artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-mypyc-wheels
name: ${{ matrix.only }}-mypyc-wheels
path: ./wheelhouse/*.whl

- if: github.event_name == 'release'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.12"]
python-version: ["3.13"]
os: [macOS-latest, ubuntu-latest, windows-latest]

steps:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.9"]
python-version: ["3.9", "3.10", "3.11", "3.12.4", "3.13", "pypy-3.9"]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand All @@ -41,6 +41,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install tox
run: |
Expand All @@ -62,7 +63,7 @@ jobs:
if:
github.repository == 'psf/black' && matrix.os == 'ubuntu-latest' &&
!startsWith(matrix.python-version, 'pypy')
uses: AndreMiras/coveralls-python-action@8799c9f4443ac4201d2e2f2c725d577174683b99
uses: AndreMiras/coveralls-python-action@ac868b9540fad490f7ca82b8ca00480fd751ed19
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
Expand All @@ -77,7 +78,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Send finished signal to Coveralls
uses: AndreMiras/coveralls-python-action@8799c9f4443ac4201d2e2f2c725d577174683b99
uses: AndreMiras/coveralls-python-action@ac868b9540fad490f7ca82b8ca00480fd751ed19
with:
parallel-finished: true
debug: true
Expand All @@ -98,7 +99,7 @@ jobs:
- name: Set up latest Python
uses: actions/setup-python@v5
with:
python-version: "*"
python-version: "3.12.4"

- name: Install black with uvloop
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Set up latest Python
uses: actions/setup-python@v5
with:
python-version: "*"
python-version: "3.12.4"

- name: Install Black and PyInstaller
run: |
Expand Down
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ repos:
- id: isort

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-bugbear==24.2.6
- flake8-comprehensions
- flake8-simplify
exclude: ^src/blib2to3/

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.13.0
hooks:
- id: mypy
exclude: ^(docs/conf.py|scripts/generate_schema.py)$
Expand All @@ -66,10 +66,11 @@ repos:
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [css, javascript, html, json, yaml]
exclude: \.github/workflows/diff_shades\.yml

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand Down
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ Multiple contributions by:
- [Tony Narlock](mailto:tony@git-pull.com)
- [Tsuyoshi Hombashi](mailto:tsuyoshi.hombashi@gmail.com)
- [Tushar Chandra](mailto:tusharchandra2018@u.northwestern.edu)
- [Tushar Sadhwani](mailto:tushar.sadhwani000@gmail.com)
- [Tzu-ping Chung](mailto:uranusjr@gmail.com)
- [Utsav Shah](mailto:ukshah2@illinois.edu)
- utsav-dbx
Expand Down
109 changes: 109 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@

<!-- Changes that affect Black's stable style -->

- Fix formatting cells in IPython notebooks with magic methods and starting or trailing
empty lines (#4484)

### Preview style

<!-- Changes that affect Black's preview style -->

- Fix/remove string merging changing f-string quotes on f-strings with internal quotes
(#4498)
- Remove parentheses around sole list items (#4312)
- Collapse multiple empty lines after an import into one (#4489)

### Configuration

<!-- Changes to how Black can be configured -->
Expand All @@ -22,6 +30,9 @@

<!-- Changes to how Black is packaged, such as dependency requirements -->

- Store license identifier inside the `License-Expression` metadata field, see
[PEP 639](https://peps.python.org/pep-0639/). (#4479)

### Parser

<!-- Changes to the parser or to version autodetection -->
Expand All @@ -47,6 +58,104 @@
<!-- Major changes to documentation and policies. Small docs changes
don't need a changelog entry. -->

## 24.10.0

### Highlights

- Black is now officially tested with Python 3.13 and provides Python 3.13
mypyc-compiled wheels. (#4436) (#4449)
- Black will issue an error when used with Python 3.12.5, due to an upstream memory
safety issue in Python 3.12.5 that can cause Black's AST safety checks to fail. Please
use Python 3.12.6 or Python 3.12.4 instead. (#4447)
- Black no longer supports running with Python 3.8 (#4452)

### Stable style

- Fix crashes involving comments in parenthesised return types or `X | Y` style unions.
(#4453)
- Fix skipping Jupyter cells with unknown `%%` magic (#4462)

### Preview style

- Fix type annotation spacing between * and more complex type variable tuple (i.e. `def
fn(*args: *tuple[*Ts, T]) -> None: pass`) (#4440)

### Caching

- Fix bug where the cache was shared between runs with and without `--unstable` (#4466)

### Packaging

- Upgrade version of mypyc used to 1.12 beta (#4450) (#4449)
- `blackd` now requires a newer version of aiohttp. (#4451)

### Output

- Added Python target version information on parse error (#4378)
- Add information about Black version to internal error messages (#4457)

## 24.8.0

### Stable style

- Fix crash when `# fmt: off` is used before a closing parenthesis or bracket. (#4363)

### Packaging

- Packaging metadata updated: docs are explictly linked, the issue tracker is now also
linked. This improves the PyPI listing for Black. (#4345)

### Parser

- Fix regression where Black failed to parse a multiline f-string containing another
multiline string (#4339)
- Fix regression where Black failed to parse an escaped single quote inside an f-string
(#4401)
- Fix bug with Black incorrectly parsing empty lines with a backslash (#4343)
- Fix bugs with Black's tokenizer not handling `\{` inside f-strings very well (#4422)
- Fix incorrect line numbers in the tokenizer for certain tokens within f-strings
(#4423)

### Performance

- Improve performance when a large directory is listed in `.gitignore` (#4415)

### _Blackd_

- Fix blackd (and all extras installs) for docker container (#4357)

## 24.4.2

This is a bugfix release to fix two regressions in the new f-string parser introduced in
24.4.1.

### Parser

- Fix regression where certain complex f-strings failed to parse (#4332)

### Performance

- Fix bad performance on certain complex string literals (#4331)

## 24.4.1

### Highlights

- Add support for the new Python 3.12 f-string syntax introduced by PEP 701 (#3822)

### Stable style

- Fix crash involving indented dummy functions containing newlines (#4318)

### Parser

- Add support for type parameter defaults, a new syntactic feature added to Python 3.13
by PEP 696 (#4327)

### Integrations

- Github Action now works even when `git archive` is skipped (#4313)

## 24.4.0

### Stable style
Expand Down
Loading

0 comments on commit 96634f4

Please sign in to comment.