-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCHANGES.txt
52 lines (32 loc) · 3.57 KB
/
CHANGES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM v5 TO v6
Multiconf version 6 is a major rewrite in order to simplify the code and introduce new features.
A configuration is now generated by applying the 'mc_config' decorator to a method defining the configuration much like in earlier versions.
The configuration is always loaded for all envs and then afterwards instantiated for a single env. It is now possible to access attribute values
for different envs using item.getattr(name, env), whereas item.name gives the attribute value for the instantiated env like in earlier versions.
Decorators no longer support a string with comma separated identifiers, use *args instead, e.g.: @required('a, b') -> @required('a', 'b')
More methods and properties now have the 'mc_' prefix
The 'build' callback has been renamed to 'mc_build'
The 'validate' method has been renamed to 'mc_validate'
A new 'mc_post_validate' method which is called after the configuration has been loaded for all envs has been added.
It is not possible to modify the configuration in mc_post_validate.
RepeatableItems will no longer calculate an automatic id if mc_key is specified as None
Overriding the setattr or mc_select_envs methods no longer requires mc_caller_file_name and mc_caller_line_num, instead 'mc_error_info_up_level'
must be passed, use the 'mc_error_info_up_level' value of 'setattr/mc_select_envs' + 1
The 'override' method has been replaced by an 'mc_force' parameter on the 'setattr' method
The '!' postfix for 'setattr' to overwrite a @property method has been replaced with an 'mc_overwrite_property' parameter
The '?' postfix for 'setattr' to set unknown attributes (attributes not defined in __init__) has been replaced with an 'mc_set_unknown' parameter
Json filter and fallback can only be specifed on the 'mc_config' decorator and the same filter/fallback will be applied on all objects
None is not a special value any more! !!! In earlier versions of multiconf None would be overriden with non-None values in mc_init. This is no longer the case. Use MC_REQUIRED to assign default values which MUST be overridden.
The argument name for 'find_attribute...' was changed from 'attribute_name' to 'name' as the method finds not only attributes, but also child items.
The semantics of mc_build (previously build) has changed. Attributes set on the builder will no longer be set on the items created in mc_build. The rationale being that this was surprising, and actually unnecessary, especially with the 'strict' model of only setting attributes already defined in __init__. Simply ensure that all attributes are set inside the mc_build method.
Multiconf will now validate (i.e. tchack that the do not raise en exception) @property methods for all envs by default. This is much faster than calling 'json'. This can be disabled so that you need not do this on every config load.
FROM v6 to v7
The mc_config decorator now wraps the config method which is decorated, so you must call that instead of EnvFactory.config() to get the instantiated configuration.
This fixes an issue with not allowing multiple configuration using the same EnvFactory.
FROM v7 to v8
The mc_config decorator now wraps the config method which is decorated in an object, so you must call the new object.load(...) method to instantiate the configuration. You then call the object to get the env specific instantiation. This provides more flexibility in providing arguments to load(...) without having to wrap the entire configuration in an extra function level.
FROM v8 to V9
Dropped support for Python versions older then 3.6.1
Taking advantage of Python 3 features
Some optimization
Removed mc5_migration option