Skip to content

Commit 71ea2d8

Browse files
committed
refactor: Add user warning about mkdocstrings extra
1 parent cd7009c commit 71ea2d8

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/mkdocstrings/handlers/python/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""This module implements a handler for the Python language."""
22

33
import posixpath
4+
import warnings
45
from typing import Any, BinaryIO, Iterator, List, Optional, Tuple
56

67
from mkdocstrings.handlers.base import BaseHandler
@@ -9,6 +10,16 @@
910
from mkdocstrings.inventory import Inventory
1011
from mkdocstrings.loggers import get_logger
1112

13+
warnings.warn(
14+
"The 'python-legacy' extra of mkdocstrings will become mandatory in the next release. "
15+
"We have no way to detect if you already specify it, so if you do, please ignore "
16+
"this warning. You can globally disable it with the PYTHONWARNINGS environment variable: "
17+
"PYTHONWARNINGS=ignore::UserWarning:mkdocstrings.handlers.python",
18+
UserWarning,
19+
)
20+
21+
# TODO: add a deprecation warning once the new handler handles 95% of use-cases
22+
1223
log = get_logger(__name__)
1324

1425

0 commit comments

Comments
 (0)