[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: py.test is not in debian anymore

Hi Tiziano,

On Mon, Apr 02, 2012 at 03:39:31PM +0200, Tiziano Zito wrote:
> here a couple of short comments:
> - why do you build for all python versions and then only install 
>   for the default versions?  
> - in override_dh_auto_test, it would probably be better not to
>   introduce your own ENABLE_TESTS flag. you should rely on the
>   DEB_BUILD_OPTIONS variable. something like this should do:
>   ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))

Well, actually it was to disable the tests by default for the first
upload, since py.test isn't in the archive. Nonetheless, it is a good
idea to add support for DEB_BUILD_OPTIONS, I suppose I can just comment
out the whole section as well.

> - why did you choose to rename the py.test script for python3 to
>   py3.test? I think the upstream convention of having
>   py.test-2.6, py.test-2.7, py.test-3.2, etc., seems
>   more sensible and also consistent with other packages (see for 
>   example ipython: ipython2.6 ipython2.7 ...)
>   at the end one could have a py.test link to point to the 
>   py.test-2.x where x is the default (probably 7 for wheezy), and
>   same thing for the python3 version, where py.test-3 may point to 
>   py.test-3.2 on wheezy.

I began to do so in my first attempts, but I didn't want the package to
depend on non-default Python versions, which it would have if I provided
every script because of the strict shebangs. Incidentally, the build for
all version comes from this attempt, I've forgotten to clean it up. In
any case, it doesn't cost much to build for every available version and
prevents any syntax error.

For the py3.test, I cannot remember why I used that name. The reason must
not have been a good one if I've forgotten it, though ;-). py.test-3 is
fine as well.

IMHO there is three alternatives:
  * Provide the scripts for all Python versions available, py.test[-3]
    pointing to the default Python version. It would mean that the
    package would depend on python-all and python3-all because of the
    shebang. I strongly dislike this one.
  * Only provide the default Python version scripts. This is what I do
    now. If the users want to use different Python versions, they can
    always use "python$VERSION -m pytest" (since 2.0).
  * Do it the ipython way: use the python scripts for py.test and
    py.test-3, and use a shell script that detects the Python version to
    use based on the script name, and fails graciously if it isn't

I hadn't thought about the third alternative until you mentioned
ipython, but it seems a rather good approach. I'll take a shot at it



Attachment: signature.asc
Description: Digital signature

Reply to: