setuptools / dpkg-buildpackage:如果nosetests失败则拒绝构建

发布于 2024-07-30 08:43:18 字数 525 浏览 4 评论 0原文

我有一个非常简单的 python 包,我使用 setuptools、cdbs 和 pycentral 将其构建到 debian 包中:

setup.py:

from setuptools import setup
setup(name='PHPSerialize',
  version='1.0',
  py_modules=['PHPSerialize'],
  test_suite = 'nose.collector'
 )

debian/rules:

#!/usr/bin/make -f
DEB_PYTHON_SYSTEM = pycentral

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

现在,有没有一种简单的方法可以使 dpkg-buildpackage 执行单元测试并拒绝创建 . deb 如果测试套件失败?

I have a very simple python package that I build into debian packages using setuptools, cdbs and pycentral:

setup.py:

from setuptools import setup
setup(name='PHPSerialize',
  version='1.0',
  py_modules=['PHPSerialize'],
  test_suite = 'nose.collector'
 )

debian/rules:

#!/usr/bin/make -f
DEB_PYTHON_SYSTEM = pycentral

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

Now, is there an easy way to make dpkg-buildpackage execute the unit tests and refuse to create the .deb if the test suite fails?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陈甜 2024-08-06 08:43:19

尝试

build/yourpackage::
         nosetests

Try

build/yourpackage::
         nosetests
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文