Skip to content

Commit

Permalink
Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin committed Jun 8, 2021
1 parent e379d07 commit 4300cb3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/mkdocstrings/loggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from pathlib import Path
from typing import Any, Callable, Optional, Tuple

from jinja2 import contextfunction
try:
from jinja2 import pass_context
except ImportError:
from jinja2 import contextfunction as pass_context
from jinja2.runtime import Context
from mkdocs.utils import warning_filter

Expand Down Expand Up @@ -71,7 +74,7 @@ def get_template_logger_function(logger_func: Callable) -> Callable:
A function.
"""

@contextfunction
@pass_context
def wrapper(context: Context, msg: Optional[str] = None) -> str:
"""Log a message.
Expand Down
4 changes: 0 additions & 4 deletions src/mkdocstrings/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,10 @@ def on_serve(self, server, builder: Callable, **kwargs): # noqa: W0613 (unused
server: The `livereload` server instance.
builder: The function to build the site.
kwargs: Additional arguments passed by MkDocs.
Returns:
The server instance.
"""
for element in self.config["watch"]:
log.debug(f"Adding directory '{element}' to watcher")
server.watch(element, builder)
return server

def on_config(self, config: Config, **kwargs) -> Config: # noqa: W0613 (unused arguments)
"""Instantiate our Markdown extension.
Expand Down
1 change: 1 addition & 0 deletions tests/test_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def fixture_ext_markdown(request, tmp_path):

conf_dict = {
"site_name": "foo",
"site_url": "https://example.org/",
"site_dir": str(tmp_path),
"plugins": [{"mkdocstrings": {"default_handler": "python"}}],
**getattr(request, "param", {}),
Expand Down

0 comments on commit 4300cb3

Please sign in to comment.