Conversation
|
We must be careful with |
|
I know. Was waiting for Travis to tell me what needs work. We should rip this bandaid off 👍 |
|
I like this new feature but it have also break some stuff on hass.io :) |
|
I did a first pass looking for all the Next up I'm going to modify voluptuous locally to validate default while constructing schemas, load every file and find final defaults that are wrong. |
|
To patch voluptuous, add this to the end of the if not isinstance(schema, dict):
return
for key, value in schema.items():
if not hasattr(key, 'default'):
continue
if key.default is UNDEFINED:
continue
default = key.default
if callable(default):
default = default()
try:
Schema(value)(default)
except Exception as err:
print(f'{default} did not match {value}: {err}')Then change |
|
Making tons of progress. Just the tests left. Found a voluptuous 0.11 incompatible schema in one of our dependencies using voluptuous: emlove/aioautomatic#4 |
|
Done 🎉 |
pvizeli
left a comment
There was a problem hiding this comment.
Amazing. Make the code a lot better and fix really strange stuff :( they going out of scope by reviews
Bump voluptuous to 0.11.1
Note for breaking change
Custom components only: voluptuous now requires default values for config keys to be valid values.
[0.11.0]
Changes:
Default values MUST now pass validation just as any regular value. This is a backward incompatible change if a schema uses default values that don't pass validation against the specified schema.
Modify
__lt__in Marker class to allow comparison with non Marker objects, such as str and int.New:
Markerinstances.Schema.infermethod for basic schema inference.SomeOfvalidator.Fixes:
Treat Python 2 old-style classes like types when validating.
IsDir(),IsFile()andPathExists()consistent between different Python versions.Coercevalidator to catchdecimal.InvalidOperation.Schema([])usage consistent withSchema({}).Schema.__eq__deterministic.Maybe(s)withAny(None, s)to allow it to be compiled.