Skip to content

Commit

Permalink
Merge branch 'main' into gh-3545
Browse files Browse the repository at this point in the history
  • Loading branch information
cobaltt7 authored Oct 6, 2024
2 parents 8c4519f + b7d0e72 commit 85175cd
Show file tree
Hide file tree
Showing 68 changed files with 947 additions and 614 deletions.
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
9 changes: 5 additions & 4 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 @@ -48,7 +49,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install cibuildwheel and pypyp
run: |
pipx install cibuildwheel==2.15.0
pipx install cibuildwheel==2.20.0
pipx install pypyp==1
- name: generate matrix
if: github.event_name != 'pull_request'
Expand All @@ -73,7 +74,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-* cp312-*"
CIBW_ARCHS_LINUX: x86_64
- id: set-matrix
run: echo "include=$(cat /tmp/matrix)" | tee -a $GITHUB_OUTPUT
Expand All @@ -89,7 +90,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v2.18.1
- uses: pypa/cibuildwheel@v2.20.0
with:
only: ${{ matrix.only }}

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@65c1672f0b8a201702d86c81b79187df74072505
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@65c1672f0b8a201702d86c81b79187df74072505
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
- id: isort

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -39,7 +39,7 @@ repos:
exclude: ^src/blib2to3/

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
rev: v1.11.2
hooks:
- id: mypy
exclude: ^(docs/conf.py|scripts/generate_schema.py)$
Expand Down Expand Up @@ -69,7 +69,7 @@ repos:
exclude: \.github/workflows/diff_shades\.yml

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand Down
63 changes: 54 additions & 9 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,35 @@

<!-- Include any especially major or disruptive changes here -->

- Black is now officially tested with Python 3.13. Note that Black does not yet provide
mypyc-compiled wheels for Python 3.13, so performance may be slower than on other
versions of Python. We will provide 3.13 mypyc-compiled wheels in a future release.
(#4436)
- 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

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

- Fix crash when `# fmt: off` is used before a closing parenthesis or bracket. (#4363)
- Fix crashes involving comments in parenthesised return types or `X | Y` style unions.
(#4453)
- Fix skipping Jupyter cells with unknown `%%` magic (#4462)

### Preview style

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

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

### Caching

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

### Configuration

<!-- Changes to how Black can be configured -->
Expand All @@ -26,18 +43,13 @@

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

- Packaging metadata updated: docs are explictly linked, the issue tracker is now also
linked. This improves the PyPI listing for Black. (#4345)
- Upgrade version of mypyc used to 1.11.2 (#4450)
- `blackd` now requires a newer version of aiohttp. (#4451)

### Parser

<!-- Changes to the parser or to version autodetection -->

- Fix regression where Black failed to parse a multiline f-string containing another
multiline string (#4339)

- Fix bug with Black incorrectly parsing empty lines with a backslash (#4343)

### Performance

<!-- Changes that improve Black's performance. -->
Expand All @@ -46,9 +58,12 @@

<!-- Changes to Black's terminal output and error messages -->

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

### _Blackd_

- Fix blackd (and all extras installs) for docker container (#4357)
<!-- Changes to blackd -->

### Integrations

Expand All @@ -59,6 +74,36 @@
<!-- Major changes to documentation and policies. Small docs changes
don't need a changelog entry. -->

## 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
Expand Down
9 changes: 4 additions & 5 deletions docs/contributing/release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ frequently than monthly nets rapidly diminishing returns.
**You must have `write` permissions for the _Black_ repository to cut a release.**

The 10,000 foot view of the release process is that you prepare a release PR and then
publish a [GitHub Release]. This triggers [release automation](#release-workflows) that
builds all release artifacts and publishes them to the various platforms we publish to.
publish a [GitHub Release]. This triggers [release automation](#release-workflows) that builds
all release artifacts and publishes them to the various platforms we publish to.

We now have a `scripts/release.py` script to help with cutting the release PRs.

Expand Down Expand Up @@ -96,9 +96,8 @@ In the end, use your best judgement and ask other maintainers for their thoughts

## Release workflows

All of _Black_'s release automation uses [GitHub Actions]. All workflows are therefore
configured using YAML files in the `.github/workflows` directory of the _Black_
repository.
All of _Black_'s release automation uses [GitHub Actions]. All workflows are therefore configured
using YAML files in the `.github/workflows` directory of the _Black_ repository.

They are triggered by the publication of a [GitHub Release].

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/the_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $ source .venv/bin/activate # activation for linux and mac
$ .venv\Scripts\activate # activation for windows

(.venv)$ pip install -r test_requirements.txt
(.venv)$ pip install -e .[d]
(.venv)$ pip install -e ".[d]"
(.venv)$ pre-commit install
```

Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/github_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: psf/black@stable
```
Expand Down
4 changes: 2 additions & 2 deletions docs/integrations/source_version_control.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Use [pre-commit](https://pre-commit.com/). Once you
repos:
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
Expand All @@ -35,7 +35,7 @@ include Jupyter Notebooks. To use this hook, simply replace the hook's `id: blac
repos:
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black-jupyter
# It is recommended to specify the latest version of Python
Expand Down
Loading

0 comments on commit 85175cd

Please sign in to comment.