diff options
Diffstat (limited to 'sphinx/ext/autosummary/__init__.py')
-rw-r--r-- | sphinx/ext/autosummary/__init__.py | 54 |
1 files changed, 2 insertions, 52 deletions
diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py index 539d72057..861b1e6b0 100644 --- a/sphinx/ext/autosummary/__init__.py +++ b/sphinx/ext/autosummary/__init__.py @@ -66,13 +66,13 @@ from typing import cast from docutils import nodes from docutils.nodes import Element, Node, system_message from docutils.parsers.rst import directives -from docutils.parsers.rst.states import Inliner, RSTStateMachine, Struct, state_classes +from docutils.parsers.rst.states import RSTStateMachine, Struct, state_classes from docutils.statemachine import StringList import sphinx from sphinx import addnodes from sphinx.application import Sphinx -from sphinx.deprecation import RemovedInSphinx40Warning, RemovedInSphinx50Warning +from sphinx.deprecation import RemovedInSphinx50Warning from sphinx.environment import BuildEnvironment from sphinx.environment.adapters.toctree import TocTree from sphinx.ext.autodoc import Documenter @@ -404,29 +404,6 @@ class Autosummary(SphinxDirective): return [table_spec, table] - def warn(self, msg: str) -> None: - warnings.warn('Autosummary.warn() is deprecated', - RemovedInSphinx40Warning, stacklevel=2) - logger.warning(msg) - - @property - def genopt(self) -> Options: - warnings.warn('Autosummary.genopt is deprecated', - RemovedInSphinx40Warning, stacklevel=2) - return self.bridge.genopt - - @property - def warnings(self) -> List[Node]: - warnings.warn('Autosummary.warnings is deprecated', - RemovedInSphinx40Warning, stacklevel=2) - return [] - - @property - def result(self) -> StringList: - warnings.warn('Autosummary.result is deprecated', - RemovedInSphinx40Warning, stacklevel=2) - return self.bridge.result - def strip_arg_typehint(s: str) -> str: """Strip a type hint from argument definition.""" @@ -647,33 +624,6 @@ def _import_by_name(name: str) -> Tuple[Any, Any, str]: # -- :autolink: (smart default role) ------------------------------------------- -def autolink_role(typ: str, rawtext: str, etext: str, lineno: int, inliner: Inliner, - options: Dict = {}, content: List[str] = [] - ) -> Tuple[List[Node], List[system_message]]: - """Smart linking role. - - Expands to ':obj:`text`' if `text` is an object that can be imported; - otherwise expands to '*text*'. - """ - warnings.warn('autolink_role() is deprecated.', RemovedInSphinx40Warning) - env = inliner.document.settings.env - pyobj_role = env.get_domain('py').role('obj') - objects, msg = pyobj_role('obj', rawtext, etext, lineno, inliner, options, content) - if msg != []: - return objects, msg - - assert len(objects) == 1 - pending_xref = cast(addnodes.pending_xref, objects[0]) - prefixes = get_import_prefixes_from_env(env) - try: - name, obj, parent, modname = import_by_name(pending_xref['reftarget'], prefixes) - except ImportError: - literal = cast(nodes.literal, pending_xref[0]) - objects[0] = nodes.emphasis(rawtext, literal.astext(), classes=literal['classes']) - - return objects, msg - - class AutoLink(SphinxRole): """Smart linking role. |