bastimeyer · GitHub

@bastimeyer

@bastimeyer

Turn into SchemaContainer subclasses
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.
Add missing tail attribute and clone child nodes
Inherit from the all-schema directly to avoid having an unnecessary
singledispatch type definition.
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
Completely rewrite tests using pytest, with full coverage

@bastimeyer

@back-to

@bastimeyer

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 8, 2022
Add missing tail attribute and clone child nodes

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 8, 2022
Turn into SchemaContainer subclasses

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 8, 2022
Turn into validation schema with a singledispatch function.
This is required for the upcoming module split.

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 8, 2022
Remove callable check from the base validate singledispatch function
and register the abc.Callable type instead.
Also fix type validation in the transform schema.

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 8, 2022
Inherit from the all-schema directly to avoid having an unnecessary
singledispatch type definition.

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 9, 2022
Remove callable check from the base validate singledispatch function
and register the abc.Callable type instead.
Also fix type validation in the transform schema.

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 9, 2022
Inherit from the all-schema directly to avoid having an unnecessary
singledispatch type definition.

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 13, 2022
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

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 13, 2022
- 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 13, 2022
Completely rewrite tests using pytest, with full coverage

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 13, 2022
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

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 13, 2022
- 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 13, 2022
Completely rewrite tests using pytest, with full coverage

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 13, 2022
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

Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request

May 13, 2022
- 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 13, 2022
Completely rewrite tests using pytest, with full coverage

Read the original on github.com ↗