Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make alabaster and sphinx_rtd_theme dependencies optional #2097

Merged
merged 1 commit into from
Jan 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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