diff --git a/.gitignore b/.gitignore index 2eea526a4..0e13a937d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,28 +1,29 @@ *.pyc *.sw? *~ \#* .\#* .coverage .eggs/ resources/test/ __pycache__ version.txt swh.web.egg-info docs/build/ docs/uri-scheme.md docs/dev-info.md *.sqlite3 .vscode/ .directory node_modules/ swh/web/static/*.* swh/web/static/js/ swh/web/static/css/ swh/web/static/fonts/ .cache-loader/ build/ dist/ .hypothesis .cache -.pytest_cache \ No newline at end of file +.pytest_cache +.tox/ diff --git a/MANIFEST.in b/MANIFEST.in index 30e7328d3..21963a510 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,10 +1,11 @@ include Makefile include pytest.ini include requirements.txt include requirements-swh.txt include requirements-test.txt +include tox.ini include version.txt recursive-include swh/web/static * recursive-include swh/web/templates * include swh/web/tests/browse/views/data/swh-logo.png include swh/web/tests/browse/views/data/iso-8859-1_encoded_content diff --git a/pytest.ini b/pytest.ini index c204cb150..e8cef8405 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,5 @@ [pytest] -norecursedirs = docs node_modules +norecursedirs = docs node_modules .tox DJANGO_SETTINGS_MODULE = swh.web.settings.tests + diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..d41c8a906 --- /dev/null +++ b/tox.ini @@ -0,0 +1,18 @@ +[tox] +envlist=flake8,py3 + +[testenv:py3] +deps = + .[testing] + pytest-cov + pytest-django +commands = + pytest --cov {envsitepackagesdir}/swh/web --cov-branch {posargs} {envsitepackagesdir}/swh/web + +[testenv:flake8] +skip_install = true +deps = + flake8 +commands = + {envpython} -m flake8 \ + --exclude=.tox,.git,__pycache__,.eggs,*.egg,node_modules