plugin.api.validate: deprecate text alias#5090
Merged
gravyboat merged 1 commit intoJan 13, 2023
Merged
Conversation
- Deprecate text alias and raise StreamlinkDeprecationWarning on access - Add deprecation to docs - Replace validate.text with str in remaining plugins - Update test
jbleyel
added a commit
to oe-mirrors/streamlink-plugins
that referenced
this pull request
Jul 3, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The deprecation warning gets triggered when accessing
textvia the module's__getattr__()method. This is better than raising the warning when validating a specifc schema with a specific input.Importing
*from the validate module will also trigger the deprecation warning, but that's nothing that can be changed unlesstextgets removed from__all__, but that would be a breaking change from the previous implicit inclusion of all module namespace members. So if there are third-party plugins which import*and are not usingtext, then they will still trigger the warning. But since importing*is already considered bad practice, I don't care much about that.As you can see from the number of plugin changes, there are quite a few plugins which haven't been touched in a long time, and I suspect that some of them are also broken. Either way,
validate.texthad to be replaced withstr, even though I don't really like touching unmaintained plugin code with automated changes like this.