[Distutils] test resources with setup tools

P.J. Eby pje at telecommunity.com
Mon Apr 26 19:54:45 CEST 2010

At 06:53 PM 4/26/2010 +0200, Manlio Perillo wrote:
>Hash: SHA1
>P.J. Eby ha scritto:
> > At 12:19 PM 4/23/2010 +0200, Manlio Perillo wrote:
> >> Hi.
> >>
> >> In a project test suite I need some external resources, that must be
> >> downloaded from internet.
> >>
> >> Is this directly supported by setuptools, or it is better if I write an
> >> additional script that does the job?
> >
> > If the resources can be accessed in the form of an .egg file (or
> > directory) added to sys.path, setuptools can handle it.
>The resources are archives that must be downloaded from internet,
>decompressed and processed.
>Right now I'm using a shell script that must be manually executed.
>The data is copied to a test/resources directory.
>The test directory contains the test suite and it is in the top level
>directory of the Python project. It is not installed on the system by
>the setup.py script.
>Test functions access the the data using __file__.
>I was just wondering if there is a better method.

If you put those resources as package data files or metadata files in 
another PyPI project, so that they can be installed in .egg form, 
then setuptools can do it for you, as I described above.

More information about the Distutils-SIG mailing list