Turn into validation schema with a singledispatch function. This is required for the upcoming module split.
Remove callable check from the base validate singledispatch function and register the abc.Callable type instead. Also fix type validation in the transform schema.
Turn module into package with multiple logical sub-modules:
- Define a public interface in the package's `__init__` module
- Split validation schemas, validators and validate logic
- schemas: classes which register attributes used by their
respective `validate` implementations
- validators: functions which can internally call `validate`
and which return something that can be validated
- validate: singledispatch functions which implement the validation
logic for schemas and various other types
- Rename validation schemas for better internal references
- Rename singledispatch methods
Other clean-up work:
- Update comments and fix grammar
- Add type annotations
- Use f-strings
- Use `str` instead of the `text` alias
- Simplify some code blocks
- Rearrange classes and functions
- Rephrase certain error messages
- Add a few more tests for better code coverage
- Implement `ValidationError` - Inherit from `ValueError` to preserve backwards compatiblity - Allow collecting multiple errors (AnySchema) - Keep an error stack of parent `ValidationError`s or other exceptions - Format error stack when converting error to string - Raise `ValidationError` instead of `ValueError` - Add error contexts where it makes sense - Add schema names to error instances - Add and update tests
- Change signature of `ValidationError` to be able to pass template strings and template variables which can get truncated individually. - Make error messages consistent by using string representations for template variables where it makes sense
Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 8, 2022Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 8, 2022Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 8, 2022Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 8, 2022Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 8, 2022Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 9, 2022Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 9, 2022Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 13, 2022Turn module into package with multiple logical sub-modules:
- Define a public interface in the package's `__init__` module
- Split validation schemas, validators and validate logic
- schemas: classes which register attributes used by their
respective `validate` implementations
- validators: functions which can internally call `validate`
and which return something that can be validated
- validate: singledispatch functions which implement the validation
logic for schemas and various other types
- Rename validation schemas for better internal references
- Rename singledispatch methods
Other clean-up work:
- Update comments and fix grammar
- Add type annotations
- Use f-strings
- Use `str` instead of the `text` alias
- Simplify some code blocks
- Rearrange classes and functions
- Rephrase certain error messages
- Add a few more tests for better code coverage
- Implement `ValidationError`
- Inherit from `ValueError` to preserve backwards compatiblity
- Allow collecting multiple errors (AnySchema)
- Keep an error stack of parent `ValidationError`s or other exceptions
- Format error stack when converting error to string
- Raise `ValidationError` instead of `ValueError`
- Add error contexts where it makes sense
- Add schema names to error instances
- Add and update tests
Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 13, 2022Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 13, 2022Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 13, 2022Turn module into package with multiple logical sub-modules:
- Define a public interface in the package's `__init__` module
- Split validation schemas, validators and validate logic
- schemas: classes which register attributes used by their
respective `validate` implementations
- validators: functions which can internally call `validate`
and which return something that can be validated
- validate: singledispatch functions which implement the validation
logic for schemas and various other types
- Rename validation schemas for better internal references
- Rename singledispatch methods
Other clean-up work:
- Update comments and fix grammar
- Add type annotations
- Use f-strings
- Use `str` instead of the `text` alias
- Simplify some code blocks
- Rearrange classes and functions
- Rephrase certain error messages
- Add a few more tests for better code coverage
- Implement `ValidationError`
- Inherit from `ValueError` to preserve backwards compatiblity
- Allow collecting multiple errors (AnySchema)
- Keep an error stack of parent `ValidationError`s or other exceptions
- Format error stack when converting error to string
- Raise `ValidationError` instead of `ValueError`
- Add error contexts where it makes sense
- Add schema names to error instances
- Add and update tests
Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 13, 2022Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 13, 2022Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 13, 2022Turn module into package with multiple logical sub-modules:
- Define a public interface in the package's `__init__` module
- Split validation schemas, validators and validate logic
- schemas: classes which register attributes used by their
respective `validate` implementations
- validators: functions which can internally call `validate`
and which return something that can be validated
- validate: singledispatch functions which implement the validation
logic for schemas and various other types
- Rename validation schemas for better internal references
- Rename singledispatch methods
Other clean-up work:
- Update comments and fix grammar
- Add type annotations
- Use f-strings
- Use `str` instead of the `text` alias
- Simplify some code blocks
- Rearrange classes and functions
- Rephrase certain error messages
- Add a few more tests for better code coverage
- Implement `ValidationError`
- Inherit from `ValueError` to preserve backwards compatiblity
- Allow collecting multiple errors (AnySchema)
- Keep an error stack of parent `ValidationError`s or other exceptions
- Format error stack when converting error to string
- Raise `ValidationError` instead of `ValueError`
- Add error contexts where it makes sense
- Add schema names to error instances
- Add and update tests
Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 13, 2022Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request
May 13, 2022