Path to this page:
./
textproc/py-black,
Uncompromising Python code formatter
Branch: CURRENT,
Version: 25.1.0,
Package name: py312-black-25.1.0,
Maintainer: rootBy using Black, 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.
Required to run:[
devel/py-click] [
devel/py-pathspec] [
www/py-aiohttp] [
lang/py-mypy_extensions] [
misc/py-platformdirs] [
lang/python310] [
textproc/py-tomli]
Required to build:[
devel/py-setuptools_scm] [
devel/py-hatchling] [
devel/py-hatch-vcs] [
devel/py-hatch-fancy-pypi-readme]
Master sites:
Filesize: 634.228 KB
Version history: (Expand)
- (2025-02-02) Updated to version: py312-black-25.1.0
- (2024-10-10) Updated to version: py312-black-24.10.0
- (2024-08-04) Updated to version: py311-black-24.8.0
- (2024-04-26) Updated to version: py311-black-24.4.2
- (2024-04-25) Updated to version: py311-black-24.4.1
- (2024-04-13) Updated to version: py311-black-24.4.0
CVS history: (Expand)
2025-02-02 10:38:45 by Adam Ciarcinski | Files touched by this commit (2) | ![Package updated](https://pkgsrc.se/images/update.gif) |
Log message:
py-black: updated to 25.1.0
25.1.0
Highlights
This release introduces the new 2025 stable style
the following changes:
- Normalize casing of Unicode escape characters in strings to lowercase
- Fix inconsistencies in whether certain strings are detected as docstrings
- Consistently add trailing commas to typed function parameters
- Remove redundant parentheses in if guards for case blocks
- Add parentheses to if clauses in case blocks when the line is too long
- Whitespace before `# fmt: skip` comments is no longer normalized
- Fix line length computation for certain expressions that involve the power operator
- Check if there is a newline before the terminating quotes of a docstring
- Fix type annotation spacing between `*` and more complex type variable tuple
The following changes were not in any previous release:
- Remove parentheses around sole list items
- Generic function definitions are now formatted more elegantly: parameters are
split over multiple lines first instead of type parameter definitions
Stable style
- Fix formatting cells in IPython notebooks with magic methods and starting or \
trailing
empty lines
- Fix crash when formatting `with` statements containing tuple generators/unpacking
Preview style
- Fix/remove string merging changing f-string quotes on f-strings with internal \
quotes
- Collapse multiple empty lines after an import into one
- Prevent `string_processing` and `wrap_long_dict_values_in_parens` from removing
parentheses around long dictionary values
- Move `wrap_long_dict_values_in_parens` from the unstable to preview style
Packaging
- Store license identifier inside the `License-Expression` metadata field, see
[PEP 639](https://peps.python.org/pep-0639/).
Performance
- Speed up the `is_fstring_start` function in Black's tokenizer
Integrations
- If using stdin with `--stdin-filename` set to a force excluded path, stdin won't be
formatted.
|
2024-10-10 11:54:23 by Adam Ciarcinski | Files touched by this commit (2) | ![Package updated](https://pkgsrc.se/images/update.gif) |
Log message:
py-black: updated to 24.10.0
24.10.0
Highlights
- Black is now officially tested with Python 3.13 and provides Python 3.13
mypyc-compiled wheels.
- 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.
- Black no longer supports running with Python 3.8
style
- Fix crashes involving comments in parenthesised return types or `X | Y` style \
unions.
- Fix skipping Jupyter cells with unknown `%%` magic
style
- Fix type annotation spacing between * and more complex type variable tuple \
(i.e. `def
fn(*args: *tuple[*Ts, T]) -> None: pass`)
Caching
- Fix bug where the cache was shared between runs with and without `--unstable`
Packaging
- Upgrade version of mypyc used to 1.12 beta
- `blackd` now requires a newer version of aiohttp.
Output
- Added Python target version information on parse error
- Add information about Black version to internal error messages
|
2024-08-04 09:12:14 by Adam Ciarcinski | Files touched by this commit (2) | ![Package updated](https://pkgsrc.se/images/update.gif) |
Log message:
py-black: updated to 24.8.0
24.8.0
Stable style
- Fix crash when `# fmt: off` is used before a closing parenthesis or bracket.
Packaging
- Packaging metadata updated: docs are explictly linked, the issue tracker is \
now also
linked. This improves the PyPI listing for Black.
Parser
- Fix regression where Black failed to parse a multiline f-string containing another
multiline string
- Fix regression where Black failed to parse an escaped single quote inside an \
f-string
- Fix bug with Black incorrectly parsing empty lines with a backslash
- Fix bugs with Black's tokenizer not handling `\{` inside f-strings very well
- Fix incorrect line numbers in the tokenizer for certain tokens within f-strings
Performance
- Improve performance when a large directory is listed in `.gitignore`
_Blackd_
- Fix blackd (and all extras installs) for docker container
|
2024-04-26 09:22:20 by Adam Ciarcinski | Files touched by this commit (2) | ![Package updated](https://pkgsrc.se/images/update.gif) |
Log message:
py-black: updated to 24.4.2
24.4.2
This is a bugfix release to fix two regressions in the new f-string parser \
introduced in
24.4.1.
|
2024-04-25 09:23:29 by Adam Ciarcinski | Files touched by this commit (2) | ![Package updated](https://pkgsrc.se/images/update.gif) |
Log message:
py-black: updated to 24.4.1
24.4.1
Highlights
- Add support for the new Python 3.12 f-string syntax introduced by PEP 701
Stable style
- Fix crash involving indented dummy functions containing newlines
Parser
- Add support for type parameter defaults, a new syntactic feature added to \
Python 3.13
by PEP 696
Integrations
- Github Action now works even when `git archive` is skipped
|
2024-04-13 07:14:49 by Adam Ciarcinski | Files touched by this commit (2) | ![Package updated](https://pkgsrc.se/images/update.gif) |
Log message:
py-black: updated to 24.4.0
24.4.0
Stable style
- Fix unwanted crashes caused by AST equivalency check
Preview style
- `if` guards in `case` blocks are now wrapped in parentheses when the line is \
too long.
- Stop moving multiline strings to a new line unless inside brackets
Integrations
- Add a new option `use_pyproject` to the GitHub Action `psf/black`. This will \
read the
Black version from `pyproject.toml`.
|
2024-03-16 18:46:08 by Adam Ciarcinski | Files touched by this commit (2) | ![Package updated](https://pkgsrc.se/images/update.gif) |
Log message:
py-black: updated to 24.3.0
24.3.0
Highlights
This release is a milestone: it fixes Black's first CVE security vulnerability. \
If you
run Black on untrusted input, or if you habitually put thousands of leading tab
characters in your docstrings, you are strongly encouraged to upgrade \
immediately to fix
[CVE-2024-21503](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-21503).
This release also fixes a bug in Black's AST safety check that allowed Black to make
incorrect changes to certain f-strings that are valid in Python 3.12 and higher.
Stable style
- Don't move comments along with delimiters, which could cause crashes
- Strengthen AST safety check to catch more unsafe changes to strings. Previous \
versions
of Black would incorrectly format the contents of certain unusual f-strings \
containing
nested strings with the same quote type. Now, Black will crash on such strings until
support for the new f-string syntax is implemented.
- Fix a bug where line-ranges exceeding the last code line would not work as expected
Performance
- Fix catastrophic performance on docstrings that contain large numbers of \
leading tab
characters. This fixes
[CVE-2024-21503](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-21503).
Documentation
- Note what happens when `--check` is used with `--quiet`
|
2024-02-13 06:06:49 by Adam Ciarcinski | Files touched by this commit (3) | ![Package updated](https://pkgsrc.se/images/update.gif) |
Log message:
py-black: updated to 24.2.0
24.2.0
Stable style
- Fixed a bug where comments where mistakenly removed along with redundant \
parentheses
Preview style
- Move the `hug_parens_with_braces_and_square_brackets` feature to the unstable style
due to an outstanding crash and proposed formatting tweaks
- Fixed a bug where base expressions caused inconsistent formatting of \*\* in tenary
expression
- Checking for newline before adding one on docstring that is almost at the line \
limit
- Remove redundant parentheses in `case` statement `if` guards
Configuration
- Fix issue where _Black_ would ignore input files in the presence of symlinks
- _Black_ now ignores `pyproject.toml` that is missing a `tool.black` section when
discovering project root and configuration. Since _Black_ continues to use version
control as an indicator of project root, this is expected to primarily change \
behavior
for users in a monorepo setup (desirably). If you wish to preserve previous \
behavior,
simply add an empty `[tool.black]` to the previously discovered `pyproject.toml`
Output
- Black will swallow any `SyntaxWarning`s or `DeprecationWarning`s produced by \
the `ast`
module when performing equivalence checks
Integrations
- Add a JSONSchema and provide a validate-pyproject entry-point
|