summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--sphinx/builders/dirhtml.py9
-rw-r--r--sphinx/builders/html.py24
-rw-r--r--sphinx/builders/singlehtml.py9
4 files changed, 23 insertions, 20 deletions
diff --git a/CHANGES b/CHANGES
index ef568431a..545cdff8e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -24,6 +24,7 @@ Bugs fixed
* #6220, #6225: napoleon: AttributeError is raised for raised section having
references
+* #6245: circular import error on importing SerializingHTMLBuilder
Testing
--------
diff --git a/sphinx/builders/dirhtml.py b/sphinx/builders/dirhtml.py
index 7ab6fad98..d5d61c273 100644
--- a/sphinx/builders/dirhtml.py
+++ b/sphinx/builders/dirhtml.py
@@ -11,6 +11,7 @@
from os import path
from sphinx.builders.html import StandaloneHTMLBuilder
+from sphinx.deprecation import RemovedInSphinx40Warning, deprecated_alias
from sphinx.util import logging
from sphinx.util.osutil import SEP, os_path
@@ -55,6 +56,14 @@ class DirectoryHTMLBuilder(StandaloneHTMLBuilder):
self.globalcontext['no_search_suffix'] = True
+# for compatibility
+deprecated_alias('sphinx.builders.html',
+ {
+ 'DirectoryHTMLBuilder': DirectoryHTMLBuilder,
+ },
+ RemovedInSphinx40Warning)
+
+
def setup(app):
# type: (Sphinx) -> Dict[str, Any]
app.setup_extension('sphinx.builders.html')
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index 3f167d0d3..287b96a92 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -24,9 +24,7 @@ from docutils.utils import relative_path
from sphinx import package_dir, __display_version__
from sphinx.builders import Builder
-from sphinx.deprecation import (
- RemovedInSphinx30Warning, RemovedInSphinx40Warning, deprecated_alias
-)
+from sphinx.deprecation import RemovedInSphinx30Warning, RemovedInSphinx40Warning
from sphinx.environment.adapters.asset import ImageAdapter
from sphinx.environment.adapters.indexentries import IndexEntries
from sphinx.environment.adapters.toctree import TocTree
@@ -1232,23 +1230,9 @@ def validate_math_renderer(app):
# for compatibility
-from sphinx.builders.dirhtml import DirectoryHTMLBuilder # NOQA
-from sphinx.builders.singlehtml import SingleFileHTMLBuilder # NOQA
-from sphinxcontrib.serializinghtml import ( # NOQA
- LAST_BUILD_FILENAME, JSONHTMLBuilder, PickleHTMLBuilder, SerializingHTMLBuilder
-)
-
-deprecated_alias('sphinx.builders.html',
- {
- 'LAST_BUILD_FILENAME': LAST_BUILD_FILENAME,
- 'DirectoryHTMLBuilder': DirectoryHTMLBuilder,
- 'JSONHTMLBuilder': JSONHTMLBuilder,
- 'PickleHTMLBuilder': PickleHTMLBuilder,
- 'SerializingHTMLBuilder': SerializingHTMLBuilder,
- 'SingleFileHTMLBuilder': SingleFileHTMLBuilder,
- 'WebHTMLBuilder': PickleHTMLBuilder,
- },
- RemovedInSphinx40Warning)
+import sphinx.builders.dirhtml # NOQA
+import sphinx.builders.singlehtml # NOQA
+import sphinxcontrib.serializinghtml # NOQA
def setup(app):
diff --git a/sphinx/builders/singlehtml.py b/sphinx/builders/singlehtml.py
index 1ee5a37b1..068d1c1c2 100644
--- a/sphinx/builders/singlehtml.py
+++ b/sphinx/builders/singlehtml.py
@@ -13,6 +13,7 @@ from os import path
from docutils import nodes
from sphinx.builders.html import StandaloneHTMLBuilder
+from sphinx.deprecation import RemovedInSphinx40Warning, deprecated_alias
from sphinx.environment.adapters.toctree import TocTree
from sphinx.locale import __
from sphinx.util import logging
@@ -201,6 +202,14 @@ class SingleFileHTMLBuilder(StandaloneHTMLBuilder):
self.handle_page('opensearch', {}, 'opensearch.xml', outfilename=fn)
+# for compatibility
+deprecated_alias('sphinx.builders.html',
+ {
+ 'SingleFileHTMLBuilder': SingleFileHTMLBuilder,
+ },
+ RemovedInSphinx40Warning)
+
+
def setup(app):
# type: (Sphinx) -> Dict[str, Any]
app.setup_extension('sphinx.builders.html')