Skip to content

Commit 8c613a3

Browse files
committed
refactor(sphinx): Simplify imports
1 parent c496ccc commit 8c613a3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

oembedpy/ext/sphinx.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
"""Sphinx extension module."""
22

3-
import logging
43
from datetime import datetime
54
from typing import Union, Tuple
65

76
try:
8-
from docutils import nodes
9-
from docutils.parsers.rst import Directive, directives
10-
from sphinx.application import Sphinx
11-
from sphinx.domains import Domain
12-
from sphinx.environment import BuildEnvironment
7+
import sphinx # noqa
138
except ModuleNotFoundError as err:
9+
import logging
10+
1411
msg = "To use it, install with Sphinx."
1512
logging.error(msg)
1613
raise err
1714

15+
from docutils import nodes
16+
from docutils.parsers.rst import Directive, directives
1817
from oembedpy import __version__
1918
from oembedpy.application import Oembed, Workspace
2019
from oembedpy.types import Content
20+
from sphinx.application import Sphinx
21+
from sphinx.domains import Domain
22+
from sphinx.environment import BuildEnvironment
2123
from sphinx.util.logging import getLogger
2224

2325
logger = getLogger(__name__)

0 commit comments

Comments
 (0)