[tox]
envlist = py27

[testenv]
deps =	-r{toxinidir}/requirements.txt
     	-r{toxinidir}/test-requirements.txt
setenv = PYTHONPATH=calvin
passenv = CALVIN_TEST_IP CALVIN_TESTING_PROXY_STORAGE

[testenv:py27]
# Ignore errors to run all the commands, i.e. tests
ignore_errors=True
setenv = CALVIN_GLOBAL_DHT_NETWORK_FILTER = "{env:PWD:}{env:USER:}{env:USERNAME:}{env:CD:}{env:HOME:}{env:HOMEPATH:}{env:RANDOM:}{env:TERM_SESSION_ID:}"
commands = py.test -p no:twisted -v -m "essential or unittest" {posargs}
# Generate this list with git grep -l "pytest.inlineCallbacks" | tr '\n' ' '
	   py.test -v calvin/runtime/north/tests/test_calvin_network.py calvin/runtime/north/tests/test_resource_monitor.py calvin/runtime/north/tests/test_storage.py calvin/runtime/south/async/twistedimpl/tests/test_server_connection.py calvin/runtime/south/storage/twistedimpl/dht/tests/test_dht_server.py calvin/runtime/south/storage/twistedimpl/securedht/tests/test_dht_server_evil.py calvin/runtime/south/storage/twistedimpl/securedht/tests/test_dht_server_nice.py calvin/runtime/south/storage/twistedimpl/securedht/tests/test_dht_server_nice2.py calvin/runtime/south/storage/twistedimpl/securedht/tests/test_dht_server_nice3.py calvin/runtime/south/storage/twistedimpl/securedht/tests/test_dht_server_nice4.py calvin/runtime/south/storage/twistedimpl/securedht/tests/test_secdht_server.py calvin/tests/helpers_twisted.py calvin/tests/test_all_storage.py

[testenv:pypy]
setenv = CALVIN_GLOBAL_DHT_NETWORK_FILTER = "{env:PWD:}{env:USER:}{env:USERNAME:}{env:CD:}{env:HOME:}{env:HOMEPATH:}{env:RANDOM:}{env:TERM_SESSION_ID:}"
commands = py.test -v -m "essential or unittest" {posargs}

[testenv:py33]
setenv = CALVIN_GLOBAL_DHT_NETWORK_FILTER = "{env:PWD:}{env:USER:}{env:USERNAME:}{env:CD:}{env:HOME:}{env:HOMEPATH:}{env:RANDOM:}{env:TERM_SESSION_ID:}"
commands = py.test -v -m "essential or unittest" {posargs}

[testenv:py34]
setenv = CALVIN_GLOBAL_DHT_NETWORK_FILTER = "{env:PWD:}{env:USER:}{env:USERNAME:}{env:CD:}{env:HOME:}{env:HOMEPATH:}{env:RANDOM:}{env:TERM_SESSION_ID:}"
commands = py.test -v -m "essential or unittest" {posargs}

[testenv:pep8]
deps = flake8
commands = flake8 calvin
#--ignore=E501

[testenv:pylint-errors]
deps = pylint
commands = pylint -f colorized -E calvin

[testenv:pylint-warnings]
deps = pylint
commands = pylint -f colorized -d all -e W -r n calvin

[testenv:pylint-full]
deps = pylint
commands = pylint -f colorized --disable=all -e R,E,W calvin

[flake8]
ignore = E222
max-line-length = 120
exclude = .svn,CVS,.bzr,.hg,.git,__pycache,tests,calvin/csparser
max-complexity = 10
