[issue11219] Produce a warning when the license is specified in both the License and Classifier metadata fields

Éric Araujo report at bugs.python.org
Wed Feb 16 21:39:35 CET 2011


Éric Araujo <merwok at netwok.org> added the comment:

> That's almost what the PEP says, or at least what I understand of it.
I’ve probably misused “not quite”; I meant “not exactly”.  Allow me to try to translate the PEP text to pseudo-code:

> Platform (multiple use)
> A Platform specification describing an operating system supported by
> the distribution which is not listed in the "Operating System" Trove
> classifiers.

if 'platform' in meta:
    if 'Operating System' in meta['classifiers']:
        warnings.append('the "platform" keyword duplicates the "Platform" classifier')
    else:
        warnings.append('using a "platform" keyword instead of a classifier, please make sure there is no classifier for this platform')

> License (optional)
> Text indicating the license covering the distribution where the
> license is not a selection from the "License" Trove classifiers. See
> "Classifier" below. This field may also be used to specify a
> particular version of a licencse which is named via the Classifier
> field, or to indicate a variation or exception to such a license.

if 'license' in meta:
    if 'License' in meta['classifiers']:
        warnings.append('using a "license" keyword with a "License" classifier, please make sure the keyword does not duplicate the classifier but precises it')
    else:
        warnings.append('using a "license" keyword instead of a classifier, please make sure there is no classifier for this license')


My pseudo-code assumes that meta['classifiers'].__contains__ can get all matching classifiers (for example all classifiers of the 'Operating System' category), not just perform exact matching against a list of strings.  I’ve just sent a message to the fellowship ML to brainstorm about a better data structure to model and work with classifiers; if we reach agreement, I’ll open another bug about that and make this one depend on the other.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11219>
_______________________________________


More information about the Python-bugs-list mailing list