From d9f2c46de70c1aee20a4309424d9f506b7aae68e Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 9 Mar 2024 18:14:15 -0500 Subject: [PATCH] Bump version for 24.1.0 release (#1297) * Bump version for 24.1.0 release * ruff updates --- CHANGELOG.rst | 2 +- pyproject.toml | 4 ++-- src/OpenSSL/SSL.py | 4 ++-- src/OpenSSL/crypto.py | 5 ++--- src/OpenSSL/version.py | 2 +- tests/conftest.py | 6 +++--- tests/test_crypto.py | 10 ++++++---- tests/test_ssl.py | 10 ++++++---- 8 files changed, 23 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7a7958b8a..45975d15a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,7 +4,7 @@ Changelog Versions are year-based with a strict backward-compatibility policy. The third digit is only for regressions. -24.1.0 (UNRELEASED) +24.1.0 (2024-03-09) ------------------- Backward-incompatible changes: diff --git a/pyproject.toml b/pyproject.toml index 293ac06cf..91fca19d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,8 +44,8 @@ addopts = "-r s --strict-markers" testpaths = ["tests"] [tool.ruff] -select = ['E', 'F', 'I', 'W', 'UP', 'RUF'] +lint.select = ['E', 'F', 'I', 'W', 'UP', 'RUF'] line-length = 79 -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["OpenSSL", "tests"] diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py index e5c82cb77..852d83d52 100644 --- a/src/OpenSSL/SSL.py +++ b/src/OpenSSL/SSL.py @@ -1379,8 +1379,8 @@ def set_client_ca_list(self, certificate_authorities): for ca_name in certificate_authorities: if not isinstance(ca_name, X509Name): raise TypeError( - "client CAs must be X509Name objects, not {} " - "objects".format(type(ca_name).__name__) + f"client CAs must be X509Name objects, not " + f"{type(ca_name).__name__} objects" ) copy = _lib.X509_NAME_dup(ca_name._name) _openssl_assert(copy != _ffi.NULL) diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py index 80a6c1958..d8d585213 100644 --- a/src/OpenSSL/crypto.py +++ b/src/OpenSSL/crypto.py @@ -620,9 +620,8 @@ def __setattr__(self, name: str, value: Any) -> None: # isinstance. if type(name) is not str: # noqa: E721 raise TypeError( - "attribute name must be string, not '{:.200}'".format( - type(value).__name__ - ) + f"attribute name must be string, not " + f"'{type(value).__name__:.200}'" ) nid = _lib.OBJ_txt2nid(_byte_string(name)) diff --git a/src/OpenSSL/version.py b/src/OpenSSL/version.py index b0bf19c24..0defc1a2e 100644 --- a/src/OpenSSL/version.py +++ b/src/OpenSSL/version.py @@ -17,7 +17,7 @@ "__version__", ] -__version__ = "24.0.0" +__version__ = "24.1.0" __title__ = "pyOpenSSL" __uri__ = "https://pyopenssl.org/" diff --git a/tests/conftest.py b/tests/conftest.py index 573b4b3d6..90bbd659a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -11,9 +11,9 @@ def pytest_report_header(config): import OpenSSL.SSL - return "OpenSSL: {openssl}\ncryptography: {cryptography}".format( - openssl=OpenSSL.SSL.SSLeay_version(OpenSSL.SSL.SSLEAY_VERSION), - cryptography=cryptography.__version__, + return ( + f"OpenSSL: {OpenSSL.SSL.SSLeay_version(OpenSSL.SSL.SSLEAY_VERSION)}\n" + f"cryptography: {cryptography.__version__}" ) diff --git a/tests/test_crypto.py b/tests/test_crypto.py index c0f809e53..058f8dd45 100644 --- a/tests/test_crypto.py +++ b/tests/test_crypto.py @@ -3791,15 +3791,17 @@ def test_sign_verify_with_text(self): with pytest.warns(DeprecationWarning) as w: warnings.simplefilter("always") sig = sign(priv_key, content, digest) - assert "{} for data is no longer accepted, use bytes".format( - WARNING_TYPE_EXPECTED + assert ( + f"{WARNING_TYPE_EXPECTED} for data is no longer accepted, " + f"use bytes" ) == str(w[-1].message) with pytest.warns(DeprecationWarning) as w: warnings.simplefilter("always") verify(cert, sig, content, digest) - assert "{} for data is no longer accepted, use bytes".format( - WARNING_TYPE_EXPECTED + assert ( + f"{WARNING_TYPE_EXPECTED} for data is no longer accepted, " + f"use bytes" ) == str(w[-1].message) def test_sign_verify_ecdsa(self): diff --git a/tests/test_ssl.py b/tests/test_ssl.py index 333ca26e9..3a0cddfbd 100644 --- a/tests/test_ssl.py +++ b/tests/test_ssl.py @@ -3122,8 +3122,9 @@ def test_text(self): server, client = loopback() with pytest.warns(DeprecationWarning) as w: count = server.send(b"xy".decode("ascii")) - assert "{} for buf is no longer accepted, use bytes".format( - WARNING_TYPE_EXPECTED + assert ( + f"{WARNING_TYPE_EXPECTED} for buf is no longer accepted, " + f"use bytes" ) == str(w[-1].message) assert count == 2 assert client.recv(2) == b"xy" @@ -3329,8 +3330,9 @@ def test_text(self): server, client = loopback() with pytest.warns(DeprecationWarning) as w: server.sendall(b"x".decode("ascii")) - assert "{} for buf is no longer accepted, use bytes".format( - WARNING_TYPE_EXPECTED + assert ( + f"{WARNING_TYPE_EXPECTED} for buf is no longer accepted, " + f"use bytes" ) == str(w[-1].message) assert client.recv(1) == b"x"