refactor: Start logging warnings instead of info messages about depre… · mkdocstrings/python@7606f33

File tree

44 files changed

lines changed

  • src/mkdocstrings_handlers/python

44 files changed

lines changed

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"

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 %}

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 %}

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 %}

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 %}

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 %}

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 %}

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 %}

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 %}

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 %}