This adds support for a new (optional) AppConf.Meta attribute named "required." The attribute is a list of (unprefixed) settings that must be defined. Not defining any of the settings will result in an ImproperlyConfigured exception being raised.
Add Meta attr for specifying required settings
Tests for required settings
Documentation for AppConf.Meta.required
Can you add a .. versionadded:: 0.6 directive to the block?
.. versionadded:: 0.6
Actually, now that I think about it, what would you think about a different API:
from appconf import AppConf, required
SOMETHING_AWESOME = required('truly-epic')
OTHER_THING = required(['foo', 'bar'])
A_INTERESTING_FLAG = required(True)
What required would basically do is to mark the default value with a boolean and that check could be done during initialization.
Honestly, I'm not a fan; mainly because I can't think of a use case where you'd want to require a value and give it a default (since a default value means the user doesn't have to set one).
Good point, forget what I said, we'll do this like you proposed. Do you think it would be sensible to also allow the arguments passed to the required option to be lower cased (to be consistent with the configure_* methods)?
Add versionadded directive
Yeah, that makes sense to me. I don't think we need to change anything though since prefixed_name is already doing the job by uppering the setting name.
This pull request fails (merged f0534ae into bf14a76).
Fix PEP8 E128 errors
Anything holding this up that I could take care of?