This is an automated email from the ASF dual-hosted git repository.
ronny pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/main by this push:
new 48cc05864 dev: Update Black to 26.3.1 (#5971)
48cc05864 is described below
commit 48cc058643682a019325237b676ea6a490d41975
Author: Ronny Berndt <[email protected]>
AuthorDate: Fri Apr 17 16:26:49 2026 +0200
dev: Update Black to 26.3.1 (#5971)
Update Python Black to 26.3.1 to support new Pythons.
---
Makefile | 2 +-
Makefile.win | 2 +-
build-aux/show-test-results.py | 1 -
dev/format_check.py | 1 -
dev/pbkdf2.py | 57 +++++++++++++++++++++---------------------
dev/run | 14 +++++------
src/docs/ext/linter.py | 9 ++-----
src/mango/test/user_docs.py | 1 -
8 files changed, 39 insertions(+), 48 deletions(-)
diff --git a/Makefile b/Makefile
index 15c843554..291c5e569 100644
--- a/Makefile
+++ b/Makefile
@@ -200,7 +200,7 @@ erlfmt-format:
.venv/bin/black:
@python3 -m venv .venv
- @.venv/bin/pip3 install black==23.3.0 || touch .venv/bin/black
+ @.venv/bin/pip3 install black==26.3.1 || touch .venv/bin/black
# target: python-black - Check Python code formatting (requires Python >= 3.6)
python-black: .venv/bin/black
diff --git a/Makefile.win b/Makefile.win
index e05f9b3cb..4f4856f1b 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -189,7 +189,7 @@ erlfmt-format:
.venv/bin/black:
@$(PYTHON) -m venv .venv
- @.venv\Scripts\pip3.exe install black==23.3.0 || copy /b
.venv\Scripts\black.exe +,,
+ @.venv\Scripts\pip3.exe install black==26.3.1
# target: python-black - Check Python code formatting (requires Python >= 3.6)
python-black: .venv/bin/black
diff --git a/build-aux/show-test-results.py b/build-aux/show-test-results.py
index ca28a3ee8..9ca7f11cd 100755
--- a/build-aux/show-test-results.py
+++ b/build-aux/show-test-results.py
@@ -7,7 +7,6 @@ import os
import re
import xml.dom.minidom as md
-
TEST_COLLECTIONS = {
"EUnit": "src/**/.eunit/*.xml",
"EXUnit": "_build/integration/lib/couchdbtest/*.xml",
diff --git a/dev/format_check.py b/dev/format_check.py
index cbb0126d9..1c90e8246 100644
--- a/dev/format_check.py
+++ b/dev/format_check.py
@@ -23,7 +23,6 @@ import sys
from format_lib import get_source_paths, get_erlang_version
-
if __name__ == "__main__":
if get_erlang_version() < 21:
print("Erlang version is < 21. Skipping format check")
diff --git a/dev/pbkdf2.py b/dev/pbkdf2.py
index 4416f8632..d7b7ef9d8 100644
--- a/dev/pbkdf2.py
+++ b/dev/pbkdf2.py
@@ -1,45 +1,46 @@
# -*- coding: utf-8 -*-
"""
- pbkdf2
- ~~~~~~
+pbkdf2
+~~~~~~
- This module implements pbkdf2 for Python. It also has some basic
- tests that ensure that it works. The implementation is straightforward
- and uses stdlib only stuff and can be easily be copy/pasted into
- your favourite application.
+This module implements pbkdf2 for Python. It also has some basic
+tests that ensure that it works. The implementation is straightforward
+and uses stdlib only stuff and can be easily be copy/pasted into
+your favourite application.
- Use this as replacement for bcrypt that does not need a c implementation
- of a modified blowfish crypto algo.
+Use this as replacement for bcrypt that does not need a c implementation
+of a modified blowfish crypto algo.
- Example usage:
+Example usage:
- >>> pbkdf2_hex('what i want to hash', 'the random salt')
- 'fa7cc8a2b0a932f8e6ea42f9787e9d36e592e0c222ada6a9'
+>>> pbkdf2_hex('what i want to hash', 'the random salt')
+'fa7cc8a2b0a932f8e6ea42f9787e9d36e592e0c222ada6a9'
- How to use this:
+How to use this:
- 1. Use a constant time string compare function to compare the stored hash
- with the one you're generating::
+1. Use a constant time string compare function to compare the stored hash
+ with the one you're generating::
- def safe_str_cmp(a, b):
- if len(a) != len(b):
- return False
- rv = 0
- for x, y in izip(a, b):
- rv |= ord(x) ^ ord(y)
- return rv == 0
+ def safe_str_cmp(a, b):
+ if len(a) != len(b):
+ return False
+ rv = 0
+ for x, y in izip(a, b):
+ rv |= ord(x) ^ ord(y)
+ return rv == 0
- 2. Use `os.urandom` to generate a proper salt of at least 8 byte.
- Use a unique salt per hashed password.
+2. Use `os.urandom` to generate a proper salt of at least 8 byte.
+ Use a unique salt per hashed password.
- 3. Store ``algorithm$salt:costfactor$hash`` in the database so that
- you can upgrade later easily to a different algorithm if you need
- one. For instance ``PBKDF2-256$thesalt:10000$deadbeef...``.
+3. Store ``algorithm$salt:costfactor$hash`` in the database so that
+ you can upgrade later easily to a different algorithm if you need
+ one. For instance ``PBKDF2-256$thesalt:10000$deadbeef...``.
- :copyright: (c) Copyright 2011 by Armin Ronacher.
- :license: BSD, see LICENSE for more details.
+:copyright: (c) Copyright 2011 by Armin Ronacher.
+:license: BSD, see LICENSE for more details.
"""
+
from binascii import hexlify
import hmac
import hashlib
diff --git a/dev/run b/dev/run
index 3686e580a..3b13bb628 100755
--- a/dev/run
+++ b/dev/run
@@ -657,8 +657,7 @@ def generate_default_clouseau_config(path, config_file,
body):
def generate_default_logback_properties(path):
print("(generate default logback.xml)")
with open(path, "w") as handle:
- handle.write(
- """<configuration>
+ handle.write("""<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{ISO8601} %c [%p] %m%n</pattern>
@@ -669,8 +668,7 @@ def generate_default_logback_properties(path):
<appender-ref ref="STDOUT"/>
</root>
</configuration>
-"""
- )
+""")
@log("Start Clouseau node clouseau{idx}")
@@ -1209,7 +1207,7 @@ def enable_cluster(node_count, port, user, pswd):
"node_count": node_count,
}
)
- (status, response) = try_request(
+ status, response = try_request(
"127.0.0.1",
port,
"POST",
@@ -1236,7 +1234,7 @@ def add_node(lead_port, node_name, node_port, user, pswd):
"password": pswd,
}
)
- (status, response) = try_request(
+ status, response = try_request(
"127.0.0.1",
lead_port,
"POST",
@@ -1249,7 +1247,7 @@ def add_node(lead_port, node_name, node_port, user, pswd):
def set_cookie(port, user, pswd):
- (status, response) = try_request(
+ status, response = try_request(
"127.0.0.1",
port,
"POST",
@@ -1262,7 +1260,7 @@ def set_cookie(port, user, pswd):
def finish_cluster(port, user, pswd):
- (status, response) = try_request(
+ status, response = try_request(
"127.0.0.1",
port,
"POST",
diff --git a/src/docs/ext/linter.py b/src/docs/ext/linter.py
index 4b171a421..0c1eb92c2 100644
--- a/src/docs/ext/linter.py
+++ b/src/docs/ext/linter.py
@@ -17,7 +17,6 @@
import os
import re
-
RULES = []
HAS_ERRORS = False
IGNORE_ERROR = False
@@ -116,8 +115,7 @@ def silent_scream(file):
@register_rule
def license_adviser(file):
"""Each source file must include ASF license header."""
- header = iter(
- """
+ header = iter("""
.. Licensed under the Apache License, Version 2.0 (the "License"); you may not
.. use this file except in compliance with the License. You may obtain a copy
of
.. the License at
@@ -130,10 +128,7 @@ def license_adviser(file):
.. License for the specific language governing permissions and limitations
under
.. the License.
-""".lstrip().splitlines(
- False
- )
- )
+""".lstrip().splitlines(False))
error = None
for n, hline in enumerate(header):
fline = yield error
diff --git a/src/mango/test/user_docs.py b/src/mango/test/user_docs.py
index b2a19eea7..9f6187e41 100644
--- a/src/mango/test/user_docs.py
+++ b/src/mango/test/user_docs.py
@@ -49,7 +49,6 @@ With this pattern:
]
"""
-
import copy