This commit is contained in:
Hynek Schlawack 2025-07-08 07:57:18 +02:00
parent 71a5f0f84c
commit 47ef1e4bb7
No known key found for this signature in database
4 changed files with 23 additions and 16 deletions

View File

@ -26,7 +26,7 @@ You can find our backwards-compatibility policy [here](https://github.com/hynek/
### Removed ### Removed
- Python 3.7 is not supported anymore. - Python 3.7 and 3.8 are not supported anymore.
[#186](https://github.com/hynek/argon2-cffi/pull/186) [#186](https://github.com/hynek/argon2-cffi/pull/186)

View File

@ -14,7 +14,7 @@ name = "argon2-cffi"
description = "Argon2 for Python" description = "Argon2 for Python"
authors = [{ name = "Hynek Schlawack", email = "hs@ox.cx" }] authors = [{ name = "Hynek Schlawack", email = "hs@ox.cx" }]
dynamic = ["version", "readme"] dynamic = ["version", "readme"]
requires-python = ">=3.8" requires-python = ">=3.9"
license = "MIT" license = "MIT"
license-files = ["LICENSE"] license-files = ["LICENSE"]
keywords = ["password", "hash", "hashing", "security"] keywords = ["password", "hash", "hashing", "security"]
@ -23,7 +23,6 @@ classifiers = [
"Operating System :: MacOS :: MacOS X", "Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows", "Operating System :: Microsoft :: Windows",
"Operating System :: POSIX", "Operating System :: POSIX",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",

View File

@ -125,18 +125,20 @@ class TestHash:
""" """
Passing an argument of wrong type raises TypeError. Passing an argument of wrong type raises TypeError.
""" """
with pytest.deprecated_call( with (
match="argon2.hash_password is deprecated" pytest.deprecated_call(match="argon2.hash_password is deprecated"),
), pytest.raises(TypeError): pytest.raises(TypeError),
):
hash_password("oh no, unicode!") hash_password("oh no, unicode!")
def test_illegal_argon2_parameter(self): def test_illegal_argon2_parameter(self):
""" """
Raises HashingError if hashing fails. Raises HashingError if hashing fails.
""" """
with pytest.deprecated_call( with (
match="argon2.hash_password is deprecated" pytest.deprecated_call(match="argon2.hash_password is deprecated"),
), pytest.raises(HashingError): pytest.raises(HashingError),
):
hash_password(TEST_PASSWORD, memory_cost=1) hash_password(TEST_PASSWORD, memory_cost=1)
@given(st.binary(max_size=128)) @given(st.binary(max_size=128))
@ -174,16 +176,22 @@ class TestVerify:
""" """
Given a valid hash and password and wrong type, we fail. Given a valid hash and password and wrong type, we fail.
""" """
with pytest.deprecated_call( with (
match="argon2.verify_password is deprecated" pytest.deprecated_call(
), pytest.raises(VerificationError): match="argon2.verify_password is deprecated"
),
pytest.raises(VerificationError),
):
verify_password(TEST_HASH_I, TEST_PASSWORD, Type.D) verify_password(TEST_HASH_I, TEST_PASSWORD, Type.D)
def test_wrong_arg_type(self): def test_wrong_arg_type(self):
""" """
Passing an argument of wrong type raises TypeError. Passing an argument of wrong type raises TypeError.
""" """
with pytest.deprecated_call( with (
match="argon2.verify_password is deprecated" pytest.deprecated_call(
), pytest.raises(TypeError): match="argon2.verify_password is deprecated"
),
pytest.raises(TypeError),
):
verify_password(TEST_HASH_I, TEST_PASSWORD.decode("ascii")) verify_password(TEST_HASH_I, TEST_PASSWORD.decode("ascii"))

View File

@ -3,7 +3,7 @@ min_version = 4
env_list = env_list =
pre-commit, pre-commit,
mypy-pkg, mypy-pkg,
py3{8,9,10,11,12,13,14}-{tests,mypy} py3{9,10,11,12,13,14}-{tests,mypy}
py312-bindings-main, py312-bindings-main,
pypy3-tests, pypy3-tests,
system-argon2, system-argon2,