#=========================================================================== # Passlib configuration for TOX #=========================================================================== # #----------------------------------------------------------------------- # config options #----------------------------------------------------------------------- # # PASSLIB_TEST_MODE: # # The default test environment sets PASSLIB_TEST_MODE=full. # If you're wanting to quickly test various under various environments, # you may want to pick another value: # # "quick" # run the bare minimum tests to ensure functionality. # variable-cost hashes are tested at their lowest setting. # hash algorithms are only tested against the backend that will # be used on the current host. no fuzz testing is done. # # "default" # same as ``"quick"``, except: hash algorithms are tested # at default levels, and a brief round of fuzz testing is done # for each hash. # # "full" # extra regression and internal tests are enabled, hash algorithms are tested # against all available backends, unavailable ones are mocked where possible, # additional time is devoted to fuzz testing. # #----------------------------------------------------------------------- # external library integration tests #----------------------------------------------------------------------- # There are a bunch of optional libraries. For the most part, # the convention here is that the 'default' tests check with all the recommended # libraries installed; and then individual envs are added which run a restricted # set of the affected tests, exercising the alternate backends. #=========================================================================== #=========================================================================== # global config #=========================================================================== [tox] minversion=2.3 envlist = # default tests # TODO: would like to 'default-pyston' but doesnt quite work # TODO: also add default-jython27 # NOTE: removed 2.6 & 3.3 as of 2019-11, tox+pip no longer work for these versions. default-py{35,36,37,38,39,py3}, # pbkdf2 backend testing # NOTE: 'hashlib' takes priority under py34+ # 'from-bytes' used for py33 (since hashlib not present) # 'unpack' used for py2 ## pdbkf2-fastpbkdf2-py{2,3}, # tested by default config pbkdf2-hashlib-py{3,py3}, pbkdf2-frombytes-py{3,py3}, # bcrypt backend testing (bcrypt cffi tested by default test) ## bcrypthash-bcrypt-py{2,3,py,py3}, # tested by default config bcrypthash-{builtin,disabled}-py{3,py3} # scrypt backend testing (builtin backend tested by default test) # XXX: 'scrypt' not compatible w/ pypy, or would include this under default. # could still do that for all but pypy, and do special test for builtin. scrypthash-scrypt-py3, ## scrypthash-stdlib-py{3}, # will only work for py36+ && openssl 1.1+ ## scrypthash-builtin-py{2,3,py,py3}, # tested by default config # argon2 backend testing (argon2_cffi tested by default test) ## argon2hash-argon2cffi-py{2,3,py,py3} # tested by default config argon2hash-argon2pure-py{3,py3}, # django tests # NOTE: django distributes it'a tests as part of source, not the package, so for full # integration tests to run, caller must provide a copy of the latest django source, # and set the env var PASSLIB_TESTS_DJANGO_SOURCE_PATH to point to it. # django support roadmap -- https://www.djangoproject.com/download/ # django python versions -- https://docs.djangoproject.com/en/3.1/faq/install/#what-python-version-can-i-use-with-django django-dj{Latest,31,30,22,21,20,1x,18}-wdeps-py3, django-dj{Latest}-nodeps-py3, # other tests docs #=========================================================================== # common env configuration #=========================================================================== [testenv] basepython = py3: python3 py35: python3.5 py36: python3.6 py37: python3.7 py38: python3.8 py39: python3.9 pypy3: pypy3 passenv = PASSLIB_TEST_MODE PASSLIB_TESTS_DJANGO_SOURCE_PATH NOSE_REDNOSE NOSE_REDNOSE_COLOR setenv = # test mode setup PASSLIB_TEST_MODE = {env:PASSLIB_TEST_MODE:full} bcrypthash-builtin: PASSLIB_BUILTIN_BCRYPT = enabled bcrypthash-disabled: PASSLIB_TEST_MODE = quick # option that depends on rednose (see below) HIDE_SKIPS = --hide-skips # nose option fragments with_coverage: TEST_COVER_OPTS = --with-xunit --with-coverage --cover-xml --cover-package passlib TEST_OPTS = {env:HIDE_SKIPS:} --randomize {env:TEST_COVER_OPTS:} changedir = {envdir} commands = # default tests default: nosetests {posargs:{env:TEST_OPTS} passlib.tests} # crypto backend tests pbkdf2: nosetests {posargs:{env:TEST_OPTS} passlib.tests.test_crypto_digest passlib.tests.test_handlers_pbkdf2} # hash backend tests bcrypthash: nosetests {posargs:{env:TEST_OPTS} passlib.tests.test_handlers_bcrypt} scrypthash: nosetests {posargs:{env:TEST_OPTS} passlib.tests.test_crypto_scrypt passlib.tests.test_handlers_scrypt} argon2hash: nosetests {posargs:{env:TEST_OPTS} passlib.tests.test_handlers_argon2} # django tests django: nosetests {posargs:{env:TEST_OPTS} passlib.tests.test_ext_django passlib.tests.test_handlers_django} deps = # common nose rednose coverage randomize # totp helper tests # NOTE: cryptography requires python-dev, libffi-dev, libssl-dev # XXX: 2016-6-20: having issue w/ cryptography under pypy, disabling it for now default-!pypy{,3}: cryptography # pbkdf2 backend tests # NOTE: fastpbkdf2 requires python-dev, libffi-dev, libssl-dev default,pbkdf2-fastpbkdf2: fastpbkdf2 # pbkdf2-{hashlib,unpack,from_bytes} -- no deps # bcrypt backend tests # NOTE: bcrypt requires python-dev, libffi-dev # NOTE: bcryptor is py2 only, requires python-dev & Cython # NOTE: bcrypt10 env disabled, just used to check legacy issues ## bcrypthash-bcrypt10: bcrypt<1.1 default,bcrypthash-bcrypt: bcrypt # scrypt backend tests # XXX: would test 'scrypt' under default, but not compatible w/ pypy, # so using default test to check builtin backend; # could just omit it from pypy tests instead. scrypthash-scrypt: scrypt # scrypthash-builtin -- nodeps # argon2 backend tests # NOTE: argon2_cffi requires python-dev, libffi-dev default,argon2hash-argon2cffi: argon2_cffi argon2hash-argon2pure: argon2pure # django extension tests dj18: django<1.9 dj1x: django<2.0 dj20: django<2.1 dj21: django<2.2 dj22: django<3.0 dj30: django<3.1 dj31: django<3.2 djLatest: django django-wdeps: bcrypt # django-nodeps -- would like to use this as negative dependancy for 'bcrypt' instead # needed by django's internal tests # XXX: does django still need this as of py35? django: mock #=========================================================================== # build documentation #=========================================================================== [testenv:docs] basepython = python changedir = docs deps = sphinx commands = pip install -r requirements.txt sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html python -c 'print("HTML_DEST_DIR={envtmpdir}/html")' #=========================================================================== # eof #===========================================================================