[Zope-dev] setup.py "extra" dependencies

Zvezdan Petkovic zvezdan at zope.com
Thu Mar 5 18:25:47 EST 2009


On Mar 5, 2009, at 5:02 PM, Laurence Rowe wrote:
> Gary Poster wrote:
>> I disagree with the blanket statement.
>>
>> I do lean towards not having the extras for the test package only.
>> I'm fine with the policy "If you want zope.testing for your tests,
>> then keep it as a dependency for the package".
>>
>> But I like to have the option of extras for testing additional  
>> setups.
>>
>> zc.async uses extras so that the main tests show the functionality as
>> a Python library; another level adds more Zope dependencies, with
>> associated tests; and the last level adds the most.  I could have
>> divided these up into multiple teensy-weensy packages but I didn't
>> really want to.  It seemed like overkill.
>> ...
>>
> It seems there is a 'tests_require'
> """
> If your project's tests need one or more additional packages besides
> those needed to install it, you can use this option to specify them.  
> It should be a string or list of strings specifying what other
> distributions need to be present for the package's tests to run. When
> you run the test command, setuptools will attempt to obtain these  
> (even going so far as to download them using EasyInstall). Note that  
> these required projects will not be installed on the system where  
> the tests are run, but only downloaded to the project's setup  
> directory if they're not already installed locally.
> """

Thanks for trying to help, but "tests_require" will not help here.

When Gary wrote zc.async, he went to a great length to document it and  
make it useful for a wide variety of use cases.

http://packages.python.org/zc.async/1.5.0/

There are three different zc.async configurations.

1. minimal
2. more
3. everything

Each of the use cases above requires the packages for _both_ runtime  
and tests.  The only way to provide all three options to developers is  
using extras.

Which zc.async configuration you will actually use in your application  
depends on your needs and your application setup.  For example, if you  
list "zc.async [z3]" you'll get the option 3 above.  See the docs for  
zc.async for details, please.

	Zvezdan



More information about the Zope-Dev mailing list