Skip to content

Commit

Permalink
Bump version for 24.1.0 release (#1297)
Browse files Browse the repository at this point in the history
* Bump version for 24.1.0 release

* ruff updates
  • Loading branch information
alex committed Mar 9, 2024
1 parent cea1f2e commit d9f2c46
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions src/OpenSSL/SSL.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions src/OpenSSL/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSSL/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"__version__",
]

__version__ = "24.0.0"
__version__ = "24.1.0"

__title__ = "pyOpenSSL"
__uri__ = "https://pyopenssl.org/"
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__}"
)


Expand Down
10 changes: 6 additions & 4 deletions tests/test_crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
10 changes: 6 additions & 4 deletions tests/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"

Expand Down

0 comments on commit d9f2c46

Please sign in to comment.