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

Re: Current state of packaging Python software for Debian

Le 15/06/2011 10:18, Zygmunt Krynicki a écrit :
> W dniu 15.06.2011 03:28, Ben Finney pisze:
>>>> If we are talking from a perspective of upstream developers that
>>>> also maintain their packages then I would *love* to see setup.py
>>>> sdist-test and would use it each day.
>>> ;-)
>> How would a putative ‘sdist_test’ differ from ‘test’? Why is this an
>> argument for a new command, and not an argument to improve what is done
>> by ‘test’ anyway?
> Pure test runs the test on the check-out of the code and is usually 
> invoked by the upstream developer. It can (and often does) run on a 
> superset of files that are distributed with sdist).
> In contrast, the theoretical sdist_test would first create a release 
> tarball with sdist, unpack it to some temporary directory and run 
> `setup.py test` there.

I’m sympathetic to the idea (one nit: it would be a new option to the
test command, not a new command).  It can be done today by manually
unpacking sdist, going to that dir and running test, but wrapping that
in a packaging/distutils2 command would not harm.

> Such a command would be useful for checking that project manifest file 
> contains everything desired to make the program run correctly (I often 
> miss something and only realise it's missing when I start packaging).

This has bitten so many people that I’m definitely +1 on doing something
here.  We already have a check command to perform some checks on the
contents of setup.cfg (or setup.py in distutils 2.7 and 3.x); I’d bet a
standard way to verify the sdist between build and upload would become a
favorite command very fast.

On the other hand, we cannot and should not try do too much in a
packaging command; people want to check unpacking, run the test suite,
check installation, and possibly other things which IMO fall under the
scope of tools like tox.  But trying to import all modules, checking the
list of files and running tests are definitely things that we can
discuss for the stdlib.

On a related note, a virtualenv-style isolation feature is planned for
Python 3.3.  With the building blocks provided in the packaging module
and that feature, it should be easy to make a tox-like tool to perform
checks on sdists.


Reply to: