diff --git a/sphinx/builders/latex/compat.py b/sphinx/builders/latex/compat.py deleted file mode 100644 index bf78e27bb..000000000 --- a/sphinx/builders/latex/compat.py +++ /dev/null @@ -1,31 +0,0 @@ -""" - sphinx.builders.latex.compat - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Compatibility module for LaTeX writer. - This module will be removed after deprecation period. - Don't use components in this modules directly. - - :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - -from sphinx.builders.latex.transforms import URI_SCHEMES, ShowUrlsTransform -from sphinx.builders.latex.util import ExtBabel -from sphinx.deprecation import ( - RemovedInSphinx30Warning, RemovedInSphinx40Warning, deprecated_alias -) - - -deprecated_alias('sphinx.writers.latex', - { - 'ShowUrlsTransform': ShowUrlsTransform, - 'URI_SCHEMES': URI_SCHEMES, - }, - RemovedInSphinx30Warning) - -deprecated_alias('sphinx.writers.latex', - { - 'ExtBabel': ExtBabel, - }, - RemovedInSphinx40Warning) diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 41d83d48d..d344db2cb 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -22,10 +22,9 @@ from docutils import nodes, writers from sphinx import addnodes from sphinx import highlighting -from sphinx.builders.latex.nodes import ( - HYPERLINK_SUPPORT_NODES, captioned_literal_block, footnotetext +from sphinx.deprecation import ( + RemovedInSphinx30Warning, RemovedInSphinx40Warning, deprecated_alias ) -from sphinx.deprecation import RemovedInSphinx30Warning, RemovedInSphinx40Warning from sphinx.domains.std import StandardDomain from sphinx.errors import SphinxError from sphinx.locale import admonitionlabels, _, __ @@ -2603,4 +2602,22 @@ class LaTeXTranslator(SphinxTranslator): # Import old modules here for compatibility -import sphinx.builders.latex.compat # NOQA +from sphinx.builders.latex.transforms import URI_SCHEMES, ShowUrlsTransform # NOQA +from sphinx.builders.latex.util import ExtBabel # NOQA + + +deprecated_alias('sphinx.writers.latex', + { + 'ShowUrlsTransform': ShowUrlsTransform, + 'URI_SCHEMES': URI_SCHEMES, + }, + RemovedInSphinx30Warning) +deprecated_alias('sphinx.writers.latex', + { + 'ExtBabel': ExtBabel, + }, + RemovedInSphinx40Warning) + +# FIXME: Workaround to avoid circular import +# refs: https://github.com/sphinx-doc/sphinx/issues/5433 +from sphinx.builders.latex.nodes import HYPERLINK_SUPPORT_NODES, captioned_literal_block, footnotetext # NOQA