Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run tox in a project that has no setup.py?

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

My problem is that tox requires a setup.py, but I have none since my application is not a module and has its own installer. For now I don't want to go through the hassle of automating the install process as to work with setup.py, I just want to run my unittests without having to write a setup.py.

Is that possible? Or how can I write an "empty" setup.py that simply does nothing? Can you point me towards some documentation on the subject (the distutils documentation explains how to write a meaningful setup.py, not an empty one)?

like image 841
Kjir Avatar asked Sep 23 '13 14:09

Kjir


People also ask

Does tox need setup py?

tox directory after running the tox command. skipsdist which we need to set when we are not testing a Python package (e.g. for a service or simple set of scripts). Anytime tox doesn't find a setup.py file this flag will need to be set.

Does tox install Python?

¶ tox is a generic virtualenv management and test command line tool you can use for: checking that your package installs correctly with different Python versions and interpreters.


1 Answers

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

like image 94
Kjir Avatar answered Oct 05 '22 13:10

Kjir