Path to this page: ./
devel/py-black,
Uncompromising Python code formatter
Branch: CURRENT,
Version: 26.3.1,
Package name: py313-black-26.3.1,
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: 650.542 KB
Version history: (Expand)
- (2026-03-12) Updated to version: py313-black-26.3.1
- (2026-03-09) Updated to version: py313-black-26.3.0
- (2026-01-26) Updated to version: py313-black-26.1.0
- (2025-12-08) Updated to version: py313-black-25.12.0
- (2025-11-14) Updated to version: py313-black-25.11.0
- (2025-10-09) Updated to version: py313-black-25.9.0
CVS history: (Expand)
2026-03-12 06:12:30 by Adam Ciarcinski | Files touched by this commit (2) |  |
Log message: py-black: updated to 26.3.1 26.3.1 Stable style - Prevent Jupyter notebook magic masking collisions from corrupting cells by using exact-length placeholders for short magics and aborting if a placeholder can \ no longer be unmasked safely Configuration - Always hash cache filename components derived from `--python-cell-magics` so custom magic names cannot affect cache paths _Blackd_ - Disable browser-originated requests by default, add configurable origin \ allowlisting and request body limits, and bound executor submissions to improve backpressure |
2026-03-09 13:48:24 by Adam Ciarcinski | Files touched by this commit (2) |  |
Log message: py-black: updated to 26.3.0 26.3.0 Stable style - Don't double-decode input, causing non-UTF-8 files to be corrupted - Fix crash on standalone comment in lambda default arguments - Preserve parentheses when `# type: ignore` comments would be merged with other comments on the same line, preventing AST equivalence failures Preview style - Fix bug where `if` guards in `case` blocks were incorrectly split when the \ pattern had a trailing comma - Fix `string_processing` crashing on unassigned long string literals with trailing commas (one-item tuples) - Simplify implementation of the power operator "hugging" logic Packaging - Fix shutdown errors in PyInstaller builds on macOS by disabling multiprocessing in frozen environments Performance - Introduce winloop for windows as an alternative to uvloop - Remove deprecated function `uvloop.install()` in favor of `uvloop.new_event_loop()` - Rename `maybe_install_uvloop` function to `maybe_use_uvloop` to simplify loop installation and creation of either a uvloop/winloop evenloop or default eventloop Output - Emit a clear warning when the target Python version is newer than the running \ Python version, since AST safety checks cannot parse newer syntax. Also replace the misleading "INTERNAL ERROR" message with an actionable error \ explaining the version mismatch _Blackd_ - Introduce winloop to be used when windows in use which enables blackd to run \ faster on windows when winloop is installed. Integrations - Remove unused gallery script - Harden parsing of `black` requirements in the GitHub Action when `use_pyproject` is enabled so that only version specifiers are accepted and direct references such as `black @ https://...` are rejected. Users should upgrade to the latest version \ of the action as soon as possible. This update is received automatically when using `psf/black@stable`, and is independent of the version of Black installed by the action. Documentation - Expand preview style documentation with detailed examples for \ `wrap_comprehension_in`, `simplify_power_operator_hugging`, and `wrap_long_dict_values_in_parens` features - Add detailed documentation for formatting Jupyter Notebooks |
2026-01-26 00:09:55 by Thomas Klausner | Files touched by this commit (2) |  |
Log message: py-black: update to 26.1.0. ## 26.1.0 ### Highlights Introduces the 2026 stable style (#4892), stabilizing the following changes: - `always_one_newline_after_import`: Always force one blank line after import statements, except when the line after the import is a comment or an import \ statement (#4489) - `fix_fmt_skip_in_one_liners`: Fix `# fmt: skip` behavior on one-liner declarations, such as `def foo(): return "mock" # fmt: skip`, where previously the \ declaration would have been incorrectly collapsed (#4800) - `fix_module_docstring_detection`: Fix module docstrings being treated as normal strings if preceded by comments (#4764) - `fix_type_expansion_split`: Fix type expansions split in generic functions (#4777) - `multiline_string_handling`: Make expressions involving multiline strings more \ compact (#1879) - `normalize_cr_newlines`: Add `\r` style newlines to the potential newlines to normalize file newlines both from and to (#4710) - `remove_parens_around_except_types`: Remove parentheses around multiple exception types in `except` and `except*` without `as` (#4720) - `remove_parens_from_assignment_lhs`: Remove unnecessary parentheses from the \ left-hand side of assignments while preserving magic trailing commas and intentional \ multiline formatting (#4865) - `standardize_type_comments`: Format type comments which have zero or more spaces between `#` and `type:` or between `type:` and value to `# type: (value)` (#4645) The following change was not in any previous stable release: - Regenerated the `_width_table.py` and added tests for the Khmer language (#4253) This release alo bumps `pathspec` to v1 and fixes inconsistencies with Git's `.gitignore` logic (#4958). Now, files will be ignored if a pattern matches \ them, even if the parent directory is directly unignored. For example, Black would previously format `exclude/not_this/foo.py` with this `.gitignore`: ``` exclude/ !exclude/not_this/ ``` Now, `exclude/not_this/foo.py` will remain ignored. To ensure `exclude/not_this/` and all of it's children are included in formatting (and in Git), use this `.gitignore`: ``` */exclude/* !*/exclude/not_this/ ``` This new behavior matches Git. The leading `*/` are only necessary if you wish \ to ignore matching subdirectories (like the previous behavior did), and not just matching root directories. ### Output - Explicitly shutdown the multiprocessing manager when run in diff mode too (#4952) ### Integrations - Upgraded PyPI upload workflow to use Trusted Publishing (#4611) |
2025-12-08 08:12:51 by Adam Ciarcinski | Files touched by this commit (2) |  |
Log message: py-black: updated to 25.12.0 25.12.0 Highlights - Black no longer supports running with Python 3.9 Stable style - Fix bug where comments preceding `# fmt: off`/`# fmt: on` blocks were incorrectly removed, particularly affecting Jupytext's `# %% [markdown]` comments - Fix crash when multiple `# fmt: skip` comments are used in a multi-part \ if-clause, on string literals, or on dictionary entries with long lines - Fix possible crash when `fmt: ` directives aren't on the top level Preview style - Fix `fmt: skip` skipping the line after instead of the line it's on - Remove unnecessary parentheses from the left-hand side of assignments while \ preserving magic trailing commas and intentional multiline formatting - Fix `fix_fmt_skip_in_one_liners` crashing on `with` statements - Fix `fix_fmt_skip_in_one_liners` crashing on annotated parameters - Fix new lines being added after imports with `# fmt: skip` on them Packaging - Releases now include arm64 Windows binaries and wheels Integrations - Add `output-file` input to GitHub Action `psf/black` to write formatter output to a file for artifact capture and log cleanliness |
2025-11-14 14:38:34 by Adam Ciarcinski | Files touched by this commit (3) |  |
Log message: py-black: updated to 25.11.0 25.11.0 Highlights - Enable base 3.14 support - Add support for the new Python 3.14 t-string syntax introduced by PEP 750 Stable style - Fix bug where comments between `# fmt: off` and `# fmt: on` were reformatted - Comments containing fmt directives now preserve their exact formatting instead of being normalized Preview style - Move `multiline_string_handling` from `--unstable` to `--preview` - Fix bug where module docstrings would be treated as normal strings if preceded by comments - Fix bug where python 3.12 generics syntax split line happens weirdly - Standardize type comments to form `# type: <value>` - Fix `fix_fmt_skip_in_one_liners` preview feature to respect `# fmt: skip` for \ compound statements with semicolon-separated bodies Configuration - Add `no_cache` option to control caching behavior. Packaging - Releases now include arm64 Linux binaries Output - Write unchanged content to stdout when excluding formatting from stdin using pipes _Blackd_ - Implemented BlackDClient. This simple python client allows to easily send \ formatting requests to blackd Integrations - Enable 3.14 base CI - Enhance GitHub Action `psf/black` to support the `required-version` \ major-version-only "stability" format when using pyproject.toml - Improve error message for vim plugin users. It now handles independently vim \ version - Vim: Warn on unsupported Vim and Python versions independently - Vim: Print the import paths when importing black fails - Vim: Fix handling of virtualenvs that have a different Python version |
| 2025-10-09 09:58:14 by Thomas Klausner | Files touched by this commit (442) |
Log message: *: remove reference to (removed) Python 3.9 |
2025-09-21 17:23:04 by Thomas Klausner | Files touched by this commit (3) |  |
Log message: py-black: update to 25.9.0. ## 25.9.0 ### Highlights - Remove support for pre-python 3.7 `await/async` as soft keywords/variable names (#4676) ### Stable style - Fix crash while formatting a long `del` statement containing tuples (#4628) - Fix crash while formatting expressions using the walrus operator in complex `with` statements (#4630) - Handle `# fmt: skip` followed by a comment at the end of file (#4635) - Fix crash when a tuple appears in the `as` clause of a `with` statement (#4634) - Fix crash when tuple is used as a context manager inside a `with` statement (#4646) - Fix crash when formatting a `\` followed by a `\r` followed by a comment (#4663) - Fix crash on a `\\r\n` (#4673) - Fix crash on `await ...` (where `...` is a literal `Ellipsis`) (#4676) - Fix crash on parenthesized expression inside a type parameter bound (#4684) - Fix crash when using line ranges excluding indented single line decorated items (#4670) ### Preview style - Fix a bug where one-liner functions/conditionals marked with `# fmt: skip` \ would still be formatted (#4552) - Improve `multiline_string_handling` with ternaries and dictionaries (#4657) - Fix a bug where `string_processing` would not split f-strings directly after expressions (#4680) - Wrap the `in` clause of comprehensions across lines if necessary (#4699) - Remove parentheses around multiple exception types in `except` and `except*` \ without `as`. (#4720) - Add `\r` style newlines to the potential newlines to normalize file newlines \ both from and to (#4710) ### Parser - Rewrite tokenizer to improve performance and compliance (#4536) - Fix bug where certain unusual expressions (e.g., lambdas) were not accepted in type parameter bounds and defaults. (#4602) ### Performance - Avoid using an extra process when running with only one worker (#4734) ### Integrations - Fix the version check in the vim file to reject Python 3.8 (#4567) - Enhance GitHub Action `psf/black` to read Black version from an additional \ section in pyproject.toml: `[project.dependency-groups]` (#4606) - Build gallery docker image with python3-slim and reduce image size (#4686) ### Documentation - Add FAQ entry for windows emoji not displaying (#4714) |
| 2025-07-05 13:44:20 by Thomas Klausner | Files touched by this commit (116) |
Log message: *: some more recursive Python restrictions on Python 3.11+ Reported in SmartOS bulk build |