Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure setup.py to run tox for test step?

Tags:

python

tox

How do I need to configure setup.py to run tox for test step?

like image 902
sorin Avatar asked Jul 17 '12 16:07

sorin


Video Answer


1 Answers

As the http link is dead in hpk42's link here is an answer:

You can override the test command to run the tox tests instead like so

class ToxTest(TestCommand):
    user_options = []

    def initialize_options(self):
        TestCommand.initialize_options(self)

    def run_tests(self):
        import tox
        tox.cmdline()


setuptools.setup(
    name='package',
    version=0.1,
    author='Author',
    author_email='[email protected]',
    description='',
    license='GPLv3',
    keywords='',
    url='',
    install_requires=['numpy'],
    packages=[],
    cmdclass = {'test': ToxTest},
)
like image 137
Att Righ Avatar answered Oct 13 '22 19:10

Att Righ