Skip to content

Commit

Permalink
Merge pull request #2097 from mitya57/stable
Browse files Browse the repository at this point in the history
Make alabaster and sphinx_rtd_theme dependencies optional
  • Loading branch information
shimizukawa committed Jan 19, 2016
2 parents 0329edc + 32591a7 commit dcdcdb4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sphinx/theming.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
from sphinx import package_dir
from sphinx.errors import ThemeError

import alabaster
import sphinx_rtd_theme

NODEFAULT = object()
THEMECONF = 'theme.conf'

Expand Down Expand Up @@ -73,10 +70,12 @@ def init_themes(cls, confdir, theme_path, warn=None):
def load_extra_theme(cls, name):
if name in ('alabaster', 'sphinx_rtd_theme'):
if name == 'alabaster':
import alabaster
themedir = alabaster.get_path()
# alabaster theme also requires 'alabaster' extension, it will be loaded
# at sphinx.application module.
elif name == 'sphinx_rtd_theme':
import sphinx_rtd_theme
themedir = sphinx_rtd_theme.get_html_theme_path()
else:
raise NotImplementedError('Programming Error')
Expand Down

0 comments on commit dcdcdb4

Please sign in to comment.