plugin.api.validate: deprecate text alias #5090
Merged
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
text
via 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 unlesstext
gets 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.text
had to be replaced withstr
, even though I don't really like touching unmaintained plugin code with automated changes like this.