Skip to content

Commit

Permalink
Always test bcrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
Unrud committed Jul 3, 2022
1 parent 156ce91 commit 5aa2f59
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
10 changes: 0 additions & 10 deletions radicale/tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ def _test_htpasswd(self, htpasswd_encryption: str, htpasswd_content: str,
"""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:
Expand Down
4 changes: 1 addition & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ addopts = --typeguard-packages=radicale
[tox:tox]

[testenv]
extras =
bcrypt
test
extras = test
deps =
flake8
isort
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@
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",
Expand All @@ -69,8 +70,7 @@
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=[
Expand Down

0 comments on commit 5aa2f59

Please sign in to comment.