Open scott-huberty opened 10 months ago
On a second thought, Since warning_filter
has been a no-op since 1.2 (released two years ago), a second option would be to simply remove the use of warning_filter
in mkdocs_gallery
, assuming that it won't be useful for the vast majority of people, and replace it with the recommended logging plugin:
The mkdocs.utils.warning_filter is deprecated and now does nothing. Plugins should remove any reference to is as it may be deleted in a future release. To ensure any warnings get counted, simply log them to the mkdocs log (i.e.: mkdocs.plugins.pluginname).
In
mkdocs-gallery
,mkdocs.utils.warning_filter
is used here:https://github.com/smarie/mkdocs-gallery/blob/cc5c4ad508c03df38c3f58c2c0b8a956d458b900/src/mkdocs_gallery/mkdocs_compatibility.py#L12
At least on mkdocs 1.5. on my computer, calling
mkdocs serve
will produce a deprecation warning like:I think we could create a utility function to check the
mkdocs
version, and if it is greater than 1.2, skip thewarnings_filter
import.If this sounds OK I can open up a PR to fix the issue.
EDIT:
I forgot to mention, here are my versions for the relevant packages: