Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/docs/sphinx-7.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra authored Jul 31, 2023
2 parents 2090091 + 8a16b25 commit 296b049
Show file tree
Hide file tree
Showing 54 changed files with 519 additions and 641 deletions.
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 packaging urllib3
python -m pip install 'click==8.1.3' 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 packaging urllib3
python -m pip install 'click==8.1.3' 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
2 changes: 1 addition & 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.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- uses: actions/checkout@v3

- name: Build wheels via cibuildwheel
uses: pypa/cibuildwheel@v2.13.1
uses: pypa/cibuildwheel@v2.14.1
env:
CIBW_ARCHS_MACOS: "${{ matrix.macos_arch }}"

Expand Down
6 changes: 4 additions & 2 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.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.7", "pypy-3.8"]
python-version: ["3.8", "3.9", "3.10", "3.11", "pypy-3.8"]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand All @@ -58,7 +58,9 @@ jobs:
- name: Upload coverage to Coveralls
# Upload coverage if we are on the main repository and
# we're running on Linux (this action only supports Linux)
if: github.repository == 'psf/black' && matrix.os == 'ubuntu-latest'
if:
github.repository == 'psf/black' && matrix.os == 'ubuntu-latest' &&
!startsWith(matrix.python-version, 'pypy')
uses: AndreMiras/coveralls-python-action@v20201129
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
17 changes: 8 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Note: don't use this config for your own repositories. Instead, see
# "Version control integration" in docs/integrations/source_version_control.md
exclude: ^(src/blib2to3/|profiling/|tests/data/)
exclude: ^(profiling/|tests/data/)
repos:
- repo: local
hooks:
Expand All @@ -12,7 +12,7 @@ repos:
additional_dependencies:
&version_check_dependencies [
commonmark==0.9.1,
pyyaml==5.4.1,
pyyaml==6.0.1,
beautifulsoup4==4.9.3,
]

Expand All @@ -29,38 +29,37 @@ repos:
- id: isort

- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-simplify
exclude: ^src/blib2to3/

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
rev: v1.4.1
hooks:
- id: mypy
exclude: ^docs/conf.py
additional_dependencies:
- types-dataclasses >= 0.1.3
- types-PyYAML
- tomli >= 0.2.6, < 2.0.0
- types-typed-ast >= 1.4.1
- click >= 8.1.0
- click >= 8.1.0, != 8.1.4, != 8.1.5
- packaging >= 22.0
- platformdirs >= 2.1.0
- pytest
- hypothesis

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v3.0.0
hooks:
- id: prettier
exclude: \.github/workflows/diff_shades\.yml

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Maintained with:
- [Richard Si](mailto:[email protected])
- [Felix Hildén](mailto:[email protected])
- [Batuhan Taskaya](mailto:[email protected])
- [Shantanu Jain](mailto:[email protected])

Multiple contributions by:

Expand Down
94 changes: 68 additions & 26 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,74 +10,116 @@

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

### Preview style

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

### Configuration

<!-- Changes to how Black can be configured -->

### Packaging

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

### Parser

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

### Performance

<!-- Changes that improve Black's performance. -->

- Avoid importing `IPython` if notebook cells do not contain magics (#3782)

### Output

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

### _Blackd_

<!-- Changes to blackd -->

### Integrations

<!-- For example, Docker, GitHub Actions, pre-commit, editors -->

### Documentation

<!-- Major changes to documentation and policies. Small docs changes
don't need a changelog entry. -->

## 23.7.0

### Highlights

- Runtime support for Python 3.7 has been removed. Formatting 3.7 code will still be
supported until further notice (#3765)

### Stable style

- Fix a bug where an illegal trailing comma was added to return type annotations using
PEP 604 unions (#3735)
- Fix a bug where multi-line open parenthesis magic comment like `type: ignore` were not
correctly parsed (#3740)
- Fix several bugs and crashes where comments in stub files were removed or mishandled
under some circumstances (#3745)
- Fix a crash with multi-line magic comments like `type: ignore` within parentheses
(#3740)
- Fix error in AST validation when _Black_ removes trailing whitespace in a type comment
(#3773)

### Preview style

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

- Implicitly concatenated strings used as function args are no longer wrapped inside
parentheses (#3640)
- Remove blank lines between a class definition and its docstring (#3692)

### Configuration

<!-- Changes to how Black can be configured -->

- The `--workers` argument to Black can now be specified via the `BLACK_NUM_WORKERS`
- The `--workers` argument to _Black_ can now be specified via the `BLACK_NUM_WORKERS`
environment variable (#3743)
- `.pytest_cache`, `.ruff_cache` and `.vscode` are now excluded by default (#3691)
- Fix black not honouring `pyproject.toml` settings when running `--stdin-filename` and
the `pyproject.toml` found isn't in the current working directory (#3719)
- Fix _Black_ not honouring `pyproject.toml` settings when running `--stdin-filename`
and the `pyproject.toml` found isn't in the current working directory (#3719)
- _Black_ will now error if `exclude` and `extend-exclude` have invalid data types in
`pyproject.toml`, instead of silently doing the wrong thing (#3764)

### Packaging

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

- Upgrade mypyc from 0.991 to 1.3 (#3697)
- Remove patching of Click that mitigated errors on Python 3.6 with `LANG=C` (#3768)

### Parser

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

- Add support for the new PEP 695 syntax in Python 3.12 (#3703)

### Performance

<!-- Changes that improve Black's performance. -->

- Speed up _Black_ significantly when the cache is full (#3751)
- Avoid importing `IPython` in a case where we wouldn't need it (#3748)

### Output

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

- Use aware UTC datetimes internally, avoids deprecation warning on Python 3.12 (#3728)
- Change verbose logging to exactly mirror _Black_'s logic for source discovery (#3749)

### _Blackd_

<!-- Changes to blackd -->

- The `blackd` argument parser now shows the default values for options in their help
text (#3712)

### Integrations

<!-- For example, Docker, GitHub Actions, pre-commit, editors -->

- Black is now tested with
[`PYTHONWARNDEFAULTENCODING = 1`](https://docs.python.org/3/library/io.html#io-encoding-warning)
(#3763)
- Update GitHub Action to display black output in the job summary (#3688)

### Documentation

<!-- Major changes to documentation and policies. Small docs changes
don't need a changelog entry. -->

- Updated the _classes_ and _exceptions_ documentation in Developer reference to match
the latest ccode base. (#3755)
- Add a CITATION.cff file to the root of the repository, containing metadata on how to
cite this software (#3723)
- Update the _classes_ and _exceptions_ documentation in Developer reference to match
the latest code base (#3755)

## 23.3.0

Expand Down
22 changes: 22 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cff-version: 1.2.0
title: "Black: The uncompromising Python code formatter"
message: >-
If you use this software, please cite it using the metadata from this file.
type: software
authors:
- family-names: Langa
given-names: Łukasz
- name: "contributors to Black"
repository-code: "https://github.com/psf/black"
url: "https://black.readthedocs.io/en/stable/"
abstract: >-
Black is the uncompromising Python code formatter. By using it, you agree to cede
control over minutiae of hand-formatting. In return, Black gives you speed,
determinism, and freedom from pycodestyle nagging about formatting. You will save time
and mental energy for more important matters.
Blackened code looks the same regardless of the project you're reading. Formatting
becomes transparent after a while and you can focus on the content instead.
Black makes code review faster by producing the smallest diffs possible.
license: MIT
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ SQLAlchemy, Poetry, PyPA applications (Warehouse, Bandersnatch, Pipenv, virtuale
pandas, Pillow, Twisted, LocalStack, every Datadog Agent Integration, Home Assistant,
Zulip, Kedro, OpenOA, FLORIS, ORBIT, WOMBAT, and many more.

The following organizations use _Black_: Facebook, Dropbox, KeepTruckin, Mozilla, Quora,
Duolingo, QuantumBlack, Tesla, Archer Aviation.
The following organizations use _Black_: Facebook, Dropbox, KeepTruckin, Lyft, Mozilla,
Quora, Duolingo, QuantumBlack, Tesla, Archer Aviation.

Are we missing anyone? Let us know.

Expand Down
2 changes: 0 additions & 2 deletions docs/contributing/reference/reference_functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ Utilities

.. autofunction:: black.linegen.normalize_invisible_parens

.. autofunction:: black.patch_click

.. autofunction:: black.nodes.preceding_leaf

.. autofunction:: black.re_compile_maybe_verbose
Expand Down
9 changes: 7 additions & 2 deletions docs/contributing/the_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ example:

```console
$ python3 -m venv .venv
$ source .venv/bin/activate
$ 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)$ pre-commit install
Expand All @@ -30,6 +32,9 @@ the root of the black repo:

# Optional Fuzz testing
(.venv)$ tox -e fuzz

# Format Black itself
(.venv)$ tox -e run_self
```

### News / Changelog Requirement
Expand Down Expand Up @@ -62,7 +67,7 @@ If you make changes to docs, you can test they still build locally too.

```console
(.venv)$ pip install -r docs/requirements.txt
(.venv)$ pip install [-e] .[d]
(.venv)$ pip install -e .[d]
(.venv)$ sphinx-build -a -b html -W docs/ docs/_build/
```

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Try it out now using the [Black Playground](https://black.vercel.app).
*Black* is [successfully used](https://github.com/psf/black#used-by) by
many projects, small and big. *Black* has a comprehensive test suite, with efficient
parallel tests, our own auto formatting and parallel Continuous Integration runner.
Now that we have become stable, you should not expect large formatting to changes in
Now that we have become stable, you should not expect large changes to formatting in
the future. Stylistic changes will mostly be responses to bug reports and support for new Python
syntax.
Expand Down
Loading

0 comments on commit 296b049

Please sign in to comment.