[Distutils] Draft PEP for JSON based metadata published

Daniel Holth dholth at gmail.com
Wed May 29 16:32:52 CEST 2013


On Wed, May 29, 2013 at 10:25 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Thu, May 30, 2013 at 12:14 AM, Daniel Holth <dholth at gmail.com> wrote:
>> Request the test extra to also install
>>
>> test_requires
>> test_may_require
>> "
>>
>> If test requirements are not actually extras then I would prefer
>> having no special-cased extra names at all, or a special extra-like
>> syntax used for pip-install'ing different categories of dependencies.
>
> No, I still like the idea of using the existing extras syntax to
> request their installation when you do want them, rather than needing
> a special mechanism in the command line tools.
>
> The declaration just got broken out to a separate field as otherwise
> it wasn't clear whether test dependencies should be listed in
> may_require, dev_requires or dev_may_require.

I just mean something like pip install package[:test:], using any
character that is not allowed in extra names to avoid a collision.

>> Is there a function to get the metadata keys from the category name?
>> It would be something like:
>>
>> f('test') -> 'test_requires', 'test_may_require'
>>
>> def f(category):
>>
>> if category == 'install': category = ''
>> conditional = [category, 'may_require']
>> unconditional = [category, '_requires']
>> return ('_'.join(unconditional).strip('_'), '_'.join(conditional).strip('_'))
>
> Possibly, but API details aren't a question for this PEP. If you look
> at the deployment scenarios in the PEP, that's not actually the way
> the mapping works anyway (development mode gets everything, not just
> the dev dependencies).

I think the naming of the two keys is slightly inelegant, with the
'may' in the middle and the requires / require, but there aren't any
short english words that would look good simply appended to the end
'test_requires', 'test_requires_conditional'.


More information about the Distutils-SIG mailing list