From 5aa2f59b382522802e63bfc58b11b02e7f418a07 Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 3 Jul 2022 12:56:24 +0200 Subject: [PATCH] Always test bcrypt --- radicale/tests/test_auth.py | 10 ---------- setup.cfg | 4 +--- setup.py | 6 +++--- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/radicale/tests/test_auth.py b/radicale/tests/test_auth.py index 516a6f8..f33780b 100644 --- a/radicale/tests/test_auth.py +++ b/radicale/tests/test_auth.py @@ -44,16 +44,6 @@ class TestBaseAuthRequests(BaseTest): """Test htpasswd authentication with user "tmp" and password "bepo" for ``test_matrix`` "ascii" or user "😀" and password "🔑" for ``test_matrix`` "unicode".""" - if htpasswd_encryption == "bcrypt": - try: - from passlib.exc import MissingBackendError - from passlib.hash import bcrypt - except ImportError: - pytest.skip("passlib[bcrypt] is not installed") - try: - bcrypt.hash("test-bcrypt-backend") - except MissingBackendError: - pytest.skip("bcrypt backend for passlib is not installed") htpasswd_file_path = os.path.join(self.colpath, ".htpasswd") encoding: str = self.configuration.get("encoding", "stock") with open(htpasswd_file_path, "w", encoding=encoding) as f: diff --git a/setup.cfg b/setup.cfg index 756aefd..8f9822c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,9 +7,7 @@ addopts = --typeguard-packages=radicale [tox:tox] [testenv] -extras = - bcrypt - test +extras = test deps = flake8 isort diff --git a/setup.py b/setup.py index e64cdc1..d266441 100644 --- a/setup.py +++ b/setup.py @@ -49,8 +49,9 @@ WEB_FILES = ["web/internal_data/css/icon.png", install_requires = ["defusedxml", "passlib", "vobject>=0.9.6", "python-dateutil>=2.7.3", "setuptools; python_version<'3.9'"] +bcrypt_requires = ["passlib[bcrypt]", "bcrypt"] # typeguard requires pytest<7 -tests_require = ["pytest<7", "typeguard", "waitress"] +test_requires = ["pytest<7", "typeguard", "waitress", *bcrypt_requires] setup( name="Radicale", @@ -69,8 +70,7 @@ setup( package_data={"radicale": [*WEB_FILES, "py.typed"]}, entry_points={"console_scripts": ["radicale = radicale.__main__:run"]}, install_requires=install_requires, - extras_require={"test": tests_require, - "bcrypt": ["passlib[bcrypt]", "bcrypt"]}, + extras_require={"test": test_requires, "bcrypt": bcrypt_requires}, keywords=["calendar", "addressbook", "CalDAV", "CardDAV"], python_requires=">=3.6.0", classifiers=[