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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 2 additions & 4 deletions
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

Lines changed: 2 additions & 4 deletions
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 %}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy