forked from pool/python-black
Compare commits
17 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| b686383587 | |||
| b2ae651af2 | |||
| 947481aa62 | |||
| f6cd2027bf | |||
| f4d89a7c92 | |||
| fd3f5314f8 | |||
| 0a29e7c4f2 | |||
| 00b5fcb8c1 | |||
| 67f07faedc | |||
| 12dbb9a243 | |||
| 4de8aee8eb | |||
| 2538c47b8f | |||
| 26ca7ee935 | |||
| cf2dc2d33c | |||
| 93edfe795b | |||
| b86d1b2a52 | |||
| 8494645af4 |
BIN
black-25.1.0.tar.gz
LFS
BIN
black-25.1.0.tar.gz
LFS
Binary file not shown.
3
black-25.11.0.tar.gz
Normal file
3
black-25.11.0.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:9a323ac32f5dc75ce7470501b887250be5005a01602e931a15e45593f70f6e08
|
||||||
|
size 655669
|
||||||
112
click-820.patch
112
click-820.patch
@@ -1,112 +0,0 @@
|
|||||||
From df50f6c30c696d4f9121e6cd8e885a05dce39360 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Mark=C3=A9ta=20Cal=C3=A1bkov=C3=A1?=
|
|
||||||
<meggy.calabkova@gmail.com>
|
|
||||||
Date: Fri, 7 Feb 2025 17:05:43 +0100
|
|
||||||
Subject: [PATCH 1/4] mix_stderr parameter was removed from click 8.2.0
|
|
||||||
|
|
||||||
---
|
|
||||||
tests/test_black.py | 28 +++++++++++++++++-----------
|
|
||||||
1 file changed, 17 insertions(+), 11 deletions(-)
|
|
||||||
|
|
||||||
Index: black-25.1.0/tests/test_black.py
|
|
||||||
===================================================================
|
|
||||||
--- black-25.1.0.orig/tests/test_black.py 2020-02-02 01:00:00.000000000 +0100
|
|
||||||
+++ black-25.1.0/tests/test_black.py 2025-06-18 22:23:10.051582946 +0200
|
|
||||||
@@ -14,6 +14,7 @@
|
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
|
||||||
from contextlib import contextmanager, redirect_stderr
|
|
||||||
from dataclasses import fields, replace
|
|
||||||
+from importlib.metadata import version as imp_version
|
|
||||||
from io import BytesIO
|
|
||||||
from pathlib import Path, WindowsPath
|
|
||||||
from platform import system
|
|
||||||
@@ -25,6 +26,7 @@
|
|
||||||
import pytest
|
|
||||||
from click import unstyle
|
|
||||||
from click.testing import CliRunner
|
|
||||||
+from packaging.version import Version
|
|
||||||
from pathspec import PathSpec
|
|
||||||
|
|
||||||
import black
|
|
||||||
@@ -114,7 +116,10 @@
|
|
||||||
"""Make sure STDOUT and STDERR are kept separate when testing Black via its CLI."""
|
|
||||||
|
|
||||||
def __init__(self) -> None:
|
|
||||||
- super().__init__(mix_stderr=False)
|
|
||||||
+ if Version(imp_version("click")) >= Version("8.2.0"):
|
|
||||||
+ super().__init__()
|
|
||||||
+ else:
|
|
||||||
+ super().__init__(mix_stderr=False)
|
|
||||||
|
|
||||||
|
|
||||||
def invokeBlack(
|
|
||||||
@@ -187,10 +192,10 @@
|
|
||||||
input=BytesIO(source.encode("utf-8")),
|
|
||||||
)
|
|
||||||
self.assertEqual(result.exit_code, 0)
|
|
||||||
- self.assertFormatEqual(expected, result.output)
|
|
||||||
- if source != result.output:
|
|
||||||
- black.assert_equivalent(source, result.output)
|
|
||||||
- black.assert_stable(source, result.output, DEFAULT_MODE)
|
|
||||||
+ self.assertFormatEqual(expected, result.stdout)
|
|
||||||
+ if source != result.stdout:
|
|
||||||
+ black.assert_equivalent(source, result.stdout)
|
|
||||||
+ black.assert_stable(source, result.stdout, DEFAULT_MODE)
|
|
||||||
|
|
||||||
def test_piping_diff(self) -> None:
|
|
||||||
diff_header = re.compile(
|
|
||||||
@@ -210,7 +215,7 @@
|
|
||||||
black.main, args, input=BytesIO(source.encode("utf-8"))
|
|
||||||
)
|
|
||||||
self.assertEqual(result.exit_code, 0)
|
|
||||||
- actual = diff_header.sub(DETERMINISTIC_HEADER, result.output)
|
|
||||||
+ actual = diff_header.sub(DETERMINISTIC_HEADER, result.stdout)
|
|
||||||
actual = actual.rstrip() + "\n" # the diff output has a trailing space
|
|
||||||
self.assertEqual(expected, actual)
|
|
||||||
|
|
||||||
@@ -295,7 +300,7 @@
|
|
||||||
self.assertEqual(result.exit_code, 0)
|
|
||||||
finally:
|
|
||||||
os.unlink(tmp_file)
|
|
||||||
- actual = result.output
|
|
||||||
+ actual = result.stdout
|
|
||||||
actual = diff_header.sub(DETERMINISTIC_HEADER, actual)
|
|
||||||
if expected != actual:
|
|
||||||
dump = black.dump_to_file(actual)
|
|
||||||
@@ -404,7 +409,7 @@
|
|
||||||
self.assertEqual(result.exit_code, 0)
|
|
||||||
finally:
|
|
||||||
os.unlink(tmp_file)
|
|
||||||
- actual = result.output
|
|
||||||
+ actual = result.stdout
|
|
||||||
actual = diff_header.sub(DETERMINISTIC_HEADER, actual)
|
|
||||||
actual = actual.rstrip() + "\n" # the diff output has a trailing space
|
|
||||||
if expected != actual:
|
|
||||||
@@ -1826,7 +1831,7 @@
|
|
||||||
self.assertEqual(result.exit_code, 0)
|
|
||||||
finally:
|
|
||||||
os.unlink(tmp_file)
|
|
||||||
- actual = result.output
|
|
||||||
+ actual = result.stdout
|
|
||||||
actual = diff_header.sub(DETERMINISTIC_HEADER, actual)
|
|
||||||
self.assertEqual(actual, expected)
|
|
||||||
|
|
||||||
@@ -1836,7 +1841,7 @@
|
|
||||||
) -> None:
|
|
||||||
"""Helper method to test the value and exit code of a click Result."""
|
|
||||||
assert (
|
|
||||||
- result.output == expected_value
|
|
||||||
+ result.stdout == expected_value
|
|
||||||
), "The output did not match the expected value."
|
|
||||||
assert result.exit_code == expected_exit_code, "The exit code is incorrect."
|
|
||||||
|
|
||||||
@@ -1913,7 +1918,8 @@
|
|
||||||
args = ["--safe", "--code", code]
|
|
||||||
result = CliRunner().invoke(black.main, args)
|
|
||||||
|
|
||||||
- self.compare_results(result, error_msg, 123)
|
|
||||||
+ assert error_msg == result.output
|
|
||||||
+ assert result.exit_code == 123
|
|
||||||
|
|
||||||
def test_code_option_fast(self) -> None:
|
|
||||||
"""Test that the code option ignores errors when the sanity checks fail."""
|
|
||||||
@@ -1,3 +1,58 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Nov 20 21:35:02 UTC 2025 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- update to 25.11.0:
|
||||||
|
* Enable base 3.14 support
|
||||||
|
* Add support for the new Python 3.14 t-string syntax
|
||||||
|
introduced by PEP 750
|
||||||
|
* 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
|
||||||
|
* Add `no_cache` option to control caching behavior.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 22 07:34:17 UTC 2025 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- update to 25.9.0:
|
||||||
|
* Remove support for pre-python 3.7 `await/async` as soft
|
||||||
|
keywords/variable names
|
||||||
|
* Fix crash while formatting a long `del` statement containing
|
||||||
|
tuples
|
||||||
|
* Fix crash while formatting expressions using the walrus
|
||||||
|
operator in complex `with` statements
|
||||||
|
* Handle `# fmt: skip` followed by a comment at the end of file
|
||||||
|
* Fix crash when a tuple appears in the `as` clause of a `with`
|
||||||
|
statement
|
||||||
|
* Fix crash when tuple is used as a context manager inside a
|
||||||
|
`with` statement
|
||||||
|
* Fix crash when formatting a `\` followed by a `
|
||||||
|
` followed
|
||||||
|
by a comment
|
||||||
|
* Fix crash on a `\r
|
||||||
|
* Fix crash on `await ...` (where `...` is a literal
|
||||||
|
`Ellipsis`)
|
||||||
|
* Fix crash on parenthesized expression inside a type parameter
|
||||||
|
bound
|
||||||
|
* Fix crash when using line ranges excluding indented single
|
||||||
|
line decorated items
|
||||||
|
* (#4670)
|
||||||
|
* Fix a bug where one-liner functions/conditionals marked with
|
||||||
|
`# fmt: skip` would still be formatted
|
||||||
|
* Improve `multiline_string_handling` with ternaries and
|
||||||
|
dictionaries
|
||||||
|
* Fix a bug where `string_processing` would not split f-strings
|
||||||
|
directly after expressions
|
||||||
|
* Wrap the `in` clause of comprehensions across lines if
|
||||||
|
necessary
|
||||||
|
* Remove parentheses around multiple exception types in
|
||||||
|
`except` and `except*` without `as`.
|
||||||
|
* Rewrite tokenizer to improve performance and compliance
|
||||||
|
* Fix bug where certain unusual expressions (e.g., lambdas)
|
||||||
|
were not accepted in type parameter bounds and defaults.
|
||||||
|
* Avoid using an extra process when running with only one
|
||||||
|
worker
|
||||||
|
- drop update-PEP-701.patch, click-820.patch: upstream
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jun 18 20:26:19 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
Wed Jun 18 20:26:19 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-black
|
# spec file for package python-black
|
||||||
#
|
#
|
||||||
# Copyright (c) 2025 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC and contributors
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -24,17 +24,12 @@
|
|||||||
|
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-black
|
Name: python-black
|
||||||
Version: 25.1.0
|
Version: 25.11.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: A code formatter written in, and written for Python
|
Summary: A code formatter written in, and written for Python
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/psf/black
|
URL: https://github.com/psf/black
|
||||||
Source: https://files.pythonhosted.org/packages/source/b/black/black-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/b/black/black-%{version}.tar.gz
|
||||||
# PATCH-FIX-UPSTREAM click-820.patch gh#psf/black#4577, gh#psf/black#4591, gh#psf/black#4666
|
|
||||||
Patch0: click-820.patch
|
|
||||||
# PATCH-FIX-UPSTREAM update-PEP-701.patch gh#psf/black#4698 mcepl@suse.com
|
|
||||||
# Fix f-string format spec test failure
|
|
||||||
Patch1: update-PEP-701.patch
|
|
||||||
BuildRequires: %{python_module aiohttp >= 3.3.2}
|
BuildRequires: %{python_module aiohttp >= 3.3.2}
|
||||||
BuildRequires: %{python_module base >= 3.8}
|
BuildRequires: %{python_module base >= 3.8}
|
||||||
BuildRequires: %{python_module click >= 8.0.0}
|
BuildRequires: %{python_module click >= 8.0.0}
|
||||||
@@ -47,6 +42,7 @@ BuildRequires: %{python_module pathspec >= 0.9.0}
|
|||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module platformdirs >= 2}
|
BuildRequires: %{python_module platformdirs >= 2}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
|
BuildRequires: %{python_module pytokens >= 0.1.10}
|
||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
@@ -56,6 +52,7 @@ Requires: python-mypy_extensions >= 0.4.3
|
|||||||
Requires: python-packaging
|
Requires: python-packaging
|
||||||
Requires: python-pathspec >= 0.9.0
|
Requires: python-pathspec >= 0.9.0
|
||||||
Requires: python-platformdirs >= 2
|
Requires: python-platformdirs >= 2
|
||||||
|
Requires: python-pytokens >= 0.1.10
|
||||||
|
|
||||||
%if %{with libalternatives}
|
%if %{with libalternatives}
|
||||||
BuildRequires: alts
|
BuildRequires: alts
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
From ea716905a9d784734aa3f561a01f3447aaecd2ea Mon Sep 17 00:00:00 2001
|
|
||||||
From: GiGaGon <107241144+MeGaGiGaGon@users.noreply.github.com>
|
|
||||||
Date: Wed, 11 Jun 2025 10:50:20 -0700
|
|
||||||
Subject: [PATCH] Update pep_701.py
|
|
||||||
|
|
||||||
---
|
|
||||||
tests/data/cases/pep_701.py | 8 ++++----
|
|
||||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
Index: black-25.1.0/tests/data/cases/pep_701.py
|
|
||||||
===================================================================
|
|
||||||
--- black-25.1.0.orig/tests/data/cases/pep_701.py 2020-02-02 01:00:00.000000000 +0100
|
|
||||||
+++ black-25.1.0/tests/data/cases/pep_701.py 2025-06-18 22:23:12.605019361 +0200
|
|
||||||
@@ -74,9 +74,9 @@
|
|
||||||
x = f"a{2+2:=^{foo(x+y**2):something else}one more}b"
|
|
||||||
f'{(abc:=10)}'
|
|
||||||
|
|
||||||
-f"This is a really long string, but just make sure that you reflow fstrings {
|
|
||||||
+f"""This is a really long string, but just make sure that you reflow fstrings {
|
|
||||||
2+2:d
|
|
||||||
-}"
|
|
||||||
+}"""
|
|
||||||
f"This is a really long string, but just make sure that you reflow fstrings correctly {2+2:d}"
|
|
||||||
|
|
||||||
f"{2+2=}"
|
|
||||||
@@ -213,9 +213,9 @@
|
|
||||||
x = f"a{2+2:=^{foo(x+y**2):something else}one more}b"
|
|
||||||
f"{(abc:=10)}"
|
|
||||||
|
|
||||||
-f"This is a really long string, but just make sure that you reflow fstrings {
|
|
||||||
+f"""This is a really long string, but just make sure that you reflow fstrings {
|
|
||||||
2+2:d
|
|
||||||
-}"
|
|
||||||
+}"""
|
|
||||||
f"This is a really long string, but just make sure that you reflow fstrings correctly {2+2:d}"
|
|
||||||
|
|
||||||
f"{2+2=}"
|
|
||||||
Reference in New Issue
Block a user