【问题标题】:Adding tests to sdist, but not installing向 sdist 添加测试,但不安装
【发布时间】:2010-08-21 03:01:38
【问题描述】:

我想将测试添加到我的setuptools 分发包中的sdist 包,但我不希望它们安装在bdist 中。我已经有了:

setup(
   ...
   packages = find_packages(exclude='tests'),
   test_suite = "tests",
   ...
)

但目前总是包含tests/*。我该如何改变呢?

【问题讨论】:

    标签: python packaging setuptools testing


    【解决方案1】:

    在 MANIFEST.in 中

    include tests/*
    

    【讨论】:

      【解决方案2】:

      在 setup.py 中:

      setup(
         ...
         packages = find_packages(exclude=['tests']),
         ...
      )
      

      注意[] 周围的'tests'

      在 MANIFEST.in 中:

      recursive-include tests *
      

      【讨论】:

        猜你喜欢
        • 2016-11-23
        • 1970-01-01
        • 1970-01-01
        • 2017-08-16
        • 1970-01-01
        • 2016-05-17
        • 1970-01-01
        • 1970-01-01
        • 2017-08-18
        相关资源
        最近更新 更多