[3.3 branch] address deprecation of werkzeug.urls.url_parse #1144
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.
This is a fix for #1142 for the 3.3-maintenance branch.
Issue(s) Resolved
Fixes #1142
Related Issues / Links
See #1143 for the corresponding PR for the master branch.
Description of Changes
Pin werkzeug<2.4
Our Publisher API currently involves passing a
werkzeug.urls.URL
instance as thetarget_url
argument toPublisher.publish
.As there are several Lektor plugins in the wild that implement their own custom publishers, and all of them currently expect that
target_url
will be awerkzeug.urls.URL
instance, totally eliminating our use of the deprecatedURL
class (without breaking existing plugins) is tricky. (See #1143 for a PR that does this in the master branch.)This PR takes the approach that we will keep the current Publisher API for Lektor 3.3.x. So here we pin
werkzeug<2.4
to ensure thatwerkzeug.urls.URL
remains available.Other bits
This PR does disuse the deprecated bits of
werkzeug.urls
in the cases where that is fairly straightforward.This PR also backports e2d0274 in order to allow the user to customize Python's warnings filter, should s/he so desire.