#=========================================================================== # 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 whre possible, # additional time is devoted to fuzz testing. # #----------------------------------------------------------------------- # vm test environments #----------------------------------------------------------------------- # The default testenv assumes py3, with specific configurations for py26/27. # # Tox is configured by default to run all the test environments, # with the exception of "jython27" and "gae25", which usually require special setup. # #----------------------------------------------------------------------- # external library integration tests #----------------------------------------------------------------------- # There are a few optional libraries, whose integration is tested separately. # Each has it's own section (below) which deals with it's particular requirements: # # * M2Crypto # * BCrypt Backends # * Django # # NOTE: The 'bcrypt' package is tested through the normal VM tests, # and requires libffi-dev (unless e.g. there's a wheel available for your platform). #=========================================================================== #=========================================================================== # global config #=========================================================================== [tox] minversion=1.8 envlist = py{26,27,32,33,34}, pypy,pypy3, m2crypto-py{2,3}, other-bcrypt-py{2,3},wo-bcrypt-py3, django{,14,145,15}-py2, django{,16,17,-wo-bcrypt}-py3, gae-py27 #=========================================================================== # stock CPython VMs # # NOTE: bcrypt requires libffi-dev # # NOTE: '_mindeps' section isn't used by tox -- it's a custom var with just # minimal dependancies required for testing (e.g. no bcrypt, m2crypto, etc), # used as shared config var by a bunch of other tests below. #=========================================================================== # default (python 3) configuration [testenv] setenv = PASSLIB_TEST_MODE = full changedir = {envdir} commands = nosetests {posargs:--randomize passlib.tests} _mindeps = nose coverage randomize unittest2py3k deps = {[testenv]_mindeps} bcrypt [testenv:py27] _mindeps = # NOTE: this is custom var with just minimal dependancies required for test # (e.g. no bcrypt, m2crypto, etc) nose coverage randomize unittest2 deps = {[testenv:py27]_mindeps} bcrypt [testenv:py26] deps = {[testenv:py27]deps} #=========================================================================== # M2Crypto accel testing # # Passlib uses M2Crypto to accelerate certain PBKDF2 calls, # Since those calls reasonably widespread, the M2Crypto test envs # run the full suite of passlib tests. # # NOTE: M2Crypto requires python-dev, swig, & libssl-dev #=========================================================================== # TODO: restrict these down to just the tests M2Crypto affects. [testenv:m2crypto-py2] basepython = python2 deps = {[testenv:py27]deps} M2Crypto [testenv:m2crypto-py3] basepython = python3 deps = {[testenv]deps} M2Crypto #=========================================================================== # bcrypt backend testing # # bcrypt -- https://pypi.python.org/pypi/bcrypt # py-bcrypt -- https://pypi.python.org/pypi/py-bcrypt/ # bcryptor - https://pypi.python.org/pypi/Bcryptor # # 'bcrypt' is the recommended bcrypt library for passlib, # and is tested under the various VM-specific test envs (py27, py31, etc) # the remainder are tested below. # # NOTE: bcrypt requires libffi-dev # NOTE: bcryptor requires python-dev & Cython # NOTE: bcryptor isn't py3 compatible, so only tested under py2 #=========================================================================== # note: used this just to check legacy issues, not generally needed. ;[testenv:bcrypt1.0-py2] ;basepython = python2 ;deps = ; {[testenv:py27]_mindeps} ; bcrypt<1.1 ;commands = ; nosetests {posargs:--randomize passlib.tests.test_handlers_bcrypt} [testenv:other-bcrypt-py2] basepython = python2 deps = {[testenv:py27]_mindeps} bcryptor py-bcrypt commands = nosetests {posargs:--randomize passlib.tests.test_handlers_bcrypt} [testenv:other-bcrypt-py3] basepython = python3 deps = {[testenv]_mindeps} py-bcrypt commands = nosetests {posargs:--randomize passlib.tests.test_handlers_bcrypt} #--------------------------------------------------------------------- # the "wo-bcrypt" environments makes sure code is ok w/o # any bcrypt library installed. # # NOTE: running *all* tests, not just bcrypt ones -- # had a few registry related tests fail when bcrypt is missing. #--------------------------------------------------------------------- [testenv:wo-bcrypt-py2] setenv = PASSLIB_TEST_MODE = quick basepython = python2 deps = {[testenv:py27]_mindeps} commands = nosetests {posargs:--randomize passlib.tests} [testenv:wo-bcrypt-py3] setenv = PASSLIB_TEST_MODE = quick basepython = python3 deps = {[testenv]_mindeps} commands = nosetests {posargs:--randomize passlib.tests} #=========================================================================== # Django integration testing # # currently supports Django 1.4 + # # there are tests for the major django versions at the time of release, # short the latest version, which is handled by the 'django' test. # # Django 1.4 / 1.5 are only tested under python 2. # Django 1.6 + are only tested under python 3, # with the exception of the latest version, which is tested under both. # # All django releases are testing with bcrypt installed, # there is special test which runs w/o bcrypt. # # NOTE: django doesn't seem to work well with py-bcrypt or bcryptor, # so those backends aren't tested. #=========================================================================== #--------------------------------------------------------------------- # legacy django versions that are py2 only #--------------------------------------------------------------------- [testenv:django14-py2] basepython = python2 deps = {[testenv:py27]deps} django<1.5 commands = nosetests {posargs:--randomize passlib.tests.test_ext_django passlib.tests.test_handlers_django} # NOTE: testing 1.4.5 specifically to detect regression of issue 52, since django < 1.4.6 # has some slight differences in the hasher classes & tests. [testenv:django145-py2] basepython = python2 deps = {[testenv:py27]deps} django==1.4.5 commands = nosetests {posargs:--randomize passlib.tests.test_ext_django passlib.tests.test_handlers_django} [testenv:django15-py2] basepython = python2 deps = # NOTE: would use py27 deps, but django 1.5 has issue with bcrypt 2.0 {[testenv:py27]_mindeps} py-bcrypt django<1.6 commands = nosetests {posargs:--randomize passlib.tests.test_ext_django passlib.tests.test_handlers_django} #--------------------------------------------------------------------- # legacy django verions that are py2/py3 #--------------------------------------------------------------------- [testenv:django16-py3] basepython = python3 deps = {[testenv]deps} django<1.7 commands = nosetests {posargs:--randomize passlib.tests.test_ext_django passlib.tests.test_handlers_django} [testenv:django17-py3] basepython = python3 deps = {[testenv]deps} django<1.8 commands = nosetests {posargs:--randomize passlib.tests.test_ext_django passlib.tests.test_handlers_django} #--------------------------------------------------------------------- # latest django version #--------------------------------------------------------------------- # NOTE: django >= 1.7 distributes tests as part of source, not the package, # so for full integration tests to run, have a copy of the latest django source, # and set the env var PASSLIB_TESTS_DJANGO_SOURCE_PATH to point to it. [testenv:django-py2] basepython = python2 deps = {[testenv:py27]deps} django passenv = PASSLIB_TESTS_DJANGO_SOURCE_PATH commands = nosetests {posargs:--randomize passlib.tests.test_ext_django passlib.tests.test_handlers_django} [testenv:django-py3] basepython = python3 deps = {[testenv]deps} django passenv = PASSLIB_TESTS_DJANGO_SOURCE_PATH commands = nosetests {posargs:--randomize passlib.tests.test_ext_django passlib.tests.test_handlers_django} #--------------------------------------------------------------------- # make sure we're ok w/ django but w/o bcrypt #--------------------------------------------------------------------- [testenv:django-wo-bcrypt-py3] basepython = python3 deps = {[testenv:wo-bcrypt-py3]deps} django commands = nosetests {posargs:--randomize passlib.tests.test_ext_django passlib.tests.test_handlers_django} #=========================================================================== # PyPy VM # NOTE: PyPy 2.4.0 targets Python 2.7 & Python 3.2 #=========================================================================== [testenv:pypy] basepython = pypy deps = {[testenv:py27]deps} [testenv:pypy3] basepython = pypy3 #=========================================================================== # Jython VM # # NOTE: not run by default #=========================================================================== [testenv:jython27] basepython = jython2.7 #=========================================================================== # Google App Engine integration # # NOTE: for this to work, the GAE SDK should be installed in # /usr/local/google_appengine, or set nosegae's --gae-lib-root # # NOTE: not run by default #=========================================================================== [testenv:gae-py27] basepython = python2.7 deps = nose nosegae unittest2 changedir = {envdir}/lib/python2.7/site-packages commands = # setup custom app.yaml so GAE can run python -m passlib.tests.tox_support setup_gae . python27 # run tests nosetests --with-gae {posargs:passlib/tests} #=========================================================================== # eof #===========================================================================