Skip to content

Commit 7606f33

Browse files
committed
refactor: Start logging warnings instead of info messages about deprecated use of templates
1 parent 1468cac commit 7606f33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+88
-176
lines changed

src/mkdocstrings_handlers/python/_internal/rendering.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,8 @@ def do_get_template(env: Environment, obj: str | Object) -> str:
552552
our_template = Path(template.filename).is_relative_to(Path(__file__).parent.parent) # type: ignore[arg-type]
553553
if our_template:
554554
return f"{name}.html.jinja"
555-
# TODO: Switch to a warning log after some time.
556-
_logger.info(
557-
f"DeprecationWarning: Overriding '{name}.html' is deprecated, override '{name}.html.jinja' instead. "
558-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
555+
_logger.warning(
556+
f"DeprecationWarning: Overriding '{name}.html' is deprecated, override '{name}.html.jinja' instead. ",
559557
once=True,
560558
)
561559
return f"{name}.html"

src/mkdocstrings_handlers/python/templates/material/_base/attribute.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/attribute.html' is deprecated, extend '_base/attribute.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/attribute.html' is deprecated, extend '_base/attribute.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/children.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/children.html' is deprecated, extend '_base/children.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/children.html' is deprecated, extend '_base/children.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/class.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/class.html' is deprecated, extend '_base/class.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/class.html' is deprecated, extend '_base/class.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring.html' is deprecated, extend '_base/docstring.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring.html' is deprecated, extend '_base/docstring.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/admonition.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/admonition.html' is deprecated, extend '_base/docstring/admonition.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/admonition.html' is deprecated, extend '_base/docstring/admonition.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/attributes.html' is deprecated, extend '_base/docstring/attributes.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/attributes.html' is deprecated, extend '_base/docstring/attributes.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/classes.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/classes.html' is deprecated, extend '_base/docstring/classes.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/classes.html' is deprecated, extend '_base/docstring/classes.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/examples.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/examples.html' is deprecated, extend '_base/docstring/examples.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/examples.html' is deprecated, extend '_base/docstring/examples.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/functions.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/functions.html' is deprecated, extend '_base/docstring/functions.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/functions.html' is deprecated, extend '_base/docstring/functions.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/modules.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/modules.html' is deprecated, extend '_base/docstring/modules.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/modules.html' is deprecated, extend '_base/docstring/modules.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/other_parameters.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/other_parameters.html' is deprecated, extend '_base/docstring/other_parameters.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/other_parameters.html' is deprecated, extend '_base/docstring/other_parameters.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/parameters.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/parameters.html' is deprecated, extend '_base/docstring/parameters.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/parameters.html' is deprecated, extend '_base/docstring/parameters.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/raises.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/raises.html' is deprecated, extend '_base/docstring/raises.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/raises.html' is deprecated, extend '_base/docstring/raises.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/receives.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/receives.html' is deprecated, extend '_base/docstring/receives.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/receives.html' is deprecated, extend '_base/docstring/receives.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/returns.html' is deprecated, extend '_base/docstring/returns.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/returns.html' is deprecated, extend '_base/docstring/returns.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/warns.html' is deprecated, extend '_base/docstring/warns.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/warns.html' is deprecated, extend '_base/docstring/warns.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/docstring/yields.html' is deprecated, extend '_base/docstring/yields.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/yields.html' is deprecated, extend '_base/docstring/yields.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/expression.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/expression.html' is deprecated, extend '_base/expression.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/expression.html' is deprecated, extend '_base/expression.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/function.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/function.html' is deprecated, extend '_base/function.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/function.html' is deprecated, extend '_base/function.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/labels.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/labels.html' is deprecated, extend '_base/labels.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/labels.html' is deprecated, extend '_base/labels.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/language.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/language.html' is deprecated, extend '_base/language.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/language.html' is deprecated, extend '_base/language.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/languages/en.html' is deprecated, extend '_base/languages/en.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/languages/en.html' is deprecated, extend '_base/languages/en.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/languages/ja.html' is deprecated, extend '_base/languages/ja.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/languages/ja.html' is deprecated, extend '_base/languages/ja.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/languages/zh.html' is deprecated, extend '_base/languages/zh.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/languages/zh.html' is deprecated, extend '_base/languages/zh.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/module.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/module.html' is deprecated, extend '_base/module.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/module.html' is deprecated, extend '_base/module.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/signature.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/signature.html' is deprecated, extend '_base/signature.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/signature.html' is deprecated, extend '_base/signature.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/summary.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/summary.html' is deprecated, extend '_base/summary.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/summary.html' is deprecated, extend '_base/summary.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/summary/attributes.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/summary/attributes.html' is deprecated, extend '_base/summary/attributes.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/summary/attributes.html' is deprecated, extend '_base/summary/attributes.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/summary/classes.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
{% block logs scoped %}
55
{{ super() }}
6-
{# TODO: Switch to a warning after some time. #}
7-
{{ log.info(
8-
"DeprecationWarning: Extending '_base/summary/classes.html' is deprecated, extend '_base/summary/classes.html.jinja' instead. " ~
9-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/summary/classes.html' is deprecated, extend '_base/summary/classes.html.jinja' instead. ",
108
once=True,
119
) }}
1210
{% endblock logs %}

0 commit comments

Comments
 (0)