Skip to content

Commit

Permalink
fix: pin werkzeug<2.4, ignore deprecation warnings
Browse files Browse the repository at this point in the history
Our Publisher API involves passing a `werkzeug.urls.URL` instance to
`Publisher.publish`.  As this is an API assumed by custom publishers
implemented by Lektor plugins out in the wild, we can not simply
change the API.

PR lektor#1143 — in the master branch — implements one approach to updating
the API in a backward-compatible manner, but it is rather involved.

For the sake of the 3.3.x branch, for now we pin werkzeug<2.4 and
leave the Publisher API as it is.
  • Loading branch information
dairiki committed May 4, 2023
1 parent b2dbaa7 commit 4c37f4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ install_requires =
requests
setuptools>=45.2
watchdog
Werkzeug<3
Werkzeug<2.4

[options.extras_require]
ipython =
Expand Down
3 changes: 3 additions & 0 deletions tests/test_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from lektor.publisher import RsyncPublisher


pytestmark = pytest.mark.filterwarnings(r"ignore:'werkzeug\.urls:DeprecationWarning")


def test_get_server(env):
server = env.load_config().get_server("production")
assert server.name == "Production"
Expand Down
1 change: 1 addition & 0 deletions tests/test_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def test_Command_triggers_no_warnings():
which("rsync") is None, reason="rsync is not available on this system"
)
@pytest.mark.parametrize("delete", ["yes", "no"])
@pytest.mark.filterwarnings(r"ignore:'werkzeug\.urls:DeprecationWarning")
def test_RsyncPublisher_integration(env, tmp_path, delete):
# Integration test of local rsync deployment
# Ensures that RsyncPublisher can successfully invoke rsync
Expand Down

0 comments on commit 4c37f4b

Please sign in to comment.