将测试添加到sdist,但不安装

时间:2010-08-21 03:01:38

标签: python packaging setuptools testing

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

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

但目前始终包括tests/*。我怎么能改变它?

2 个答案:

答案 0 :(得分:3)

在MANIFEST.in中

include tests/*

答案 1 :(得分:0)

在setup.py中:

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

请注意[]周围的'tests'

在MANIFEST.in:

recursive-include tests *