bpo-19610: setup() now raises TypeError for invalid types#4519
Conversation
The Distribution class now explicitly raises an exception when 'classifiers', 'keywords' and 'platforms' fields are not specified as a list.
|
LGTM code + docs. Is there a test that qualifiers cannot be a string? Might be a good way to make sure this isn't accidentally added, contradicting the docs. |
|
Quoting @cryvate:
Do you mean is there a test for fields other than keywords, platforms and classifiers? Lines 602 to 608 in b98f171 |
|
I meant there could be a test that this 'string to list' conversion does
*not* happen for classifiers (I.e. the current behaviour).
|
|
There is no "string to list" test but "tuple to list" test for classifiers: test_classifier_invalid_type I think that covers the following branch: if not isinstance(value, list):
...And since the implicit "string to list" conversation only happens for 'keywords' and 'platforms' fields, I think we're good to go. Please feel free to send another PR or an example if I misunderstand your comment, thanks! |
The Distribution class now explicitly raises an
exception when 'classifiers', 'keywords' and
'platforms' fields are not specified as a list.
https://bugs.python.org/issue19610