How do I run tox in a project that has no setup.py?
After digging inside the source code, I found a scarcely documented option in tox.ini that skips sdist:
[tox]skipsdist = BOOL # defaults to false
Setting this to True
I got what I wanted, saving me the effort of writing a meaningful setup.py
If you have an application (with a requirements.txt
), rather than a project that you are going to distribute (which would have a setup.py
instead), your tox.ini
should look something like this:
[tox]skipsdist = True[testenv]deps = -r{toxinidir}/requirements.txt
Found this answer originally from David Murphy's blog, but the page is no longer available, you can find an archived version here: https://web.archive.org/web/20150112223937/https://blog.schwuk.com/2014/03/19/using-tox-django-projects/
(Original link, now dead: http://blog.schwuk.com/2014/03/19/using-tox-django-projects/ )
This is my tox.ini
file content for Django project by multiple settings:
[tox]envlist = py36-{accounting,content,media}_settingsskipsdist = true[testenv]commands = python {toxinidir}/manage.py testdeps = -r{toxinidir}/requirements.txtsetenv = accounting_settings: DJANGO_SETTINGS_MODULE=my_project.settings.accounting contents_settings: DJANGO_SETTINGS_MODULE=my_project.settings.contents media_settings: DJANGO_SETTINGS_MODULE=my_project.settings.media