【问题标题】:How to configure setup.py to run tox for test step?如何配置 setup.py 为测试步骤运行 tox?
【发布时间】:2012-07-17 16:45:12
【问题描述】:

我需要如何配置setup.py 以在test 步骤中运行tox

【问题讨论】:

    标签: python tox


    【解决方案1】:

    由于 http 链接在 hpk42 的链接中已失效,因此这是一个答案:

    您可以像这样覆盖 test 命令来运行毒物测试

    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='author@gmail.com',
        description='',
        license='GPLv3',
        keywords='',
        url='',
        install_requires=['numpy'],
        packages=[],
        cmdclass = {'test': ToxTest},
    )
    

    【讨论】:

      猜你喜欢
      • 2013-11-07
      • 1970-01-01
      • 2016-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-04
      • 1970-01-01
      相关资源
      最近更新 更多