On Sep 12, 2011, at 04:39 PM, Joey Hess wrote:

>Barry Warsaw wrote:
>> Right, setuptools/distutils supports it by default, though it requires a
>> `test_suite` parameter in setup().
>
>That's a long way from being supported by default. Could you get back to
>me when enough python module packages support it that if I turned it on
>in debhelper compat level 10 or something, it would not require a
>majority of python packages to add an override to disable it?

I think it would almost never require an override, if done somewhat like this:

- if there is a setup.cfg and it contains a [test] section, then use python
  setup.py test -vv
- if there's a setup.py containing a 'test_suite' key, use python setup.py
  test -vv
- otherwise, fall back to current default

I think this way almost everything that currently works should continue to
work.  The only thing that could break is if there's *also* a Makefile with a
check/test target that does something different than `setup.py test` (i.e. the
upstream package's test suite is inconsistent).  That seems like a bug in the
upstream that would need a Debian workaround anyway.

With the above, I think the overrides currently needed could be removed, but
they'd still continue to work.  E.g. from one of my packages:

-----snip snip-----
PYTHON2=$(shell pyversions -vr)

test-python%:
        python$* setup.py test -vv

override_dh_auto_test: $(PYTHON2:%=test-python%)
-----snip snip-----

I'd be happy to write a little helper script (probably in Python?) which could
make the checks I enumerate above.  You could then call that script and use
the return code to see if you should do `python setup.py test -vv` or fallback
to what it does now.

Attachment: signature.asc
Description: PGP signature

Reply via email to