mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
Merge pull request #2097 from mitya57/stable
Make alabaster and sphinx_rtd_theme dependencies optional
This commit is contained in:
+2
-3
@@ -26,9 +26,6 @@ except ImportError:
|
|||||||
from sphinx import package_dir
|
from sphinx import package_dir
|
||||||
from sphinx.errors import ThemeError
|
from sphinx.errors import ThemeError
|
||||||
|
|
||||||
import alabaster
|
|
||||||
import sphinx_rtd_theme
|
|
||||||
|
|
||||||
NODEFAULT = object()
|
NODEFAULT = object()
|
||||||
THEMECONF = 'theme.conf'
|
THEMECONF = 'theme.conf'
|
||||||
|
|
||||||
@@ -73,10 +70,12 @@ class Theme(object):
|
|||||||
def load_extra_theme(cls, name):
|
def load_extra_theme(cls, name):
|
||||||
if name in ('alabaster', 'sphinx_rtd_theme'):
|
if name in ('alabaster', 'sphinx_rtd_theme'):
|
||||||
if name == 'alabaster':
|
if name == 'alabaster':
|
||||||
|
import alabaster
|
||||||
themedir = alabaster.get_path()
|
themedir = alabaster.get_path()
|
||||||
# alabaster theme also requires 'alabaster' extension, it will be loaded
|
# alabaster theme also requires 'alabaster' extension, it will be loaded
|
||||||
# at sphinx.application module.
|
# at sphinx.application module.
|
||||||
elif name == 'sphinx_rtd_theme':
|
elif name == 'sphinx_rtd_theme':
|
||||||
|
import sphinx_rtd_theme
|
||||||
themedir = sphinx_rtd_theme.get_html_theme_path()
|
themedir = sphinx_rtd_theme.get_html_theme_path()
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError('Programming Error')
|
raise NotImplementedError('Programming Error')
|
||||||
|
|||||||
Reference in New Issue
Block a user