How can I run tox in a project that does not have setup.py?

I would like to use tox to run my unittests in two virtualenvs, since my application must support 2 different versions of Python.

My problem is that tox requires setup.py , but I don't have a single one, since my application is not a module and has its own installer. At the moment, I do not want to discuss the problems of automating the installation process, because to work with setup.py I just want to run my unittests without having to write setup.py .

Is it possible? Or how can I write an “empty” setup.py that just does nothing? Can you point me to some documentation on this ( distutils documentation explains how to write meaningful setup.py , not empty)?

+48
python unit-testing distutils tox
Sep 23 '13 at 14:50
source share
2 answers

After digging inside the source code, I found that the option that skips sdist is almost not registered in tox.ini:

 [tox] skipsdist = BOOL # defaults to false 

By setting this to True , I got what I wanted, saving the effort to write a meaningful setup.py

+63
Sep 24 '13 at 15:04 on
source share

If you have an application (with requirements.txt ), and not a project that you intend to distribute ( setup.py would be instead), your tox.ini should look something like this:

 [tox] skipsdist = True [testenv] deps = -r{toxinidir}/requirements.txt 

Found this answer from David Murphy's blog: http://blog.schwuk.com/2014/03/19/using-tox-django-projects/

+29
Nov 14 '14 at 20:13
source share



All Articles