summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2017-04-29 15:22:34 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2017-04-29 15:29:51 +0900
commit370bdddc7c9cc20383d6211a27ef6868773bd82e (patch)
tree704b7476bf8b9734020226abf043795c43e471e2
parent721c3d5faec85d6daa8d7b0ef3d518af7566438e (diff)
downloadsphinx-git-370bdddc7c9cc20383d6211a27ef6868773bd82e.tar.gz
make websupport-dependency optional
-rw-r--r--CHANGES1
-rw-r--r--setup.py4
-rw-r--r--sphinx/websupport/__init__.py19
3 files changed, 16 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES
index 0ed869b50..c333a95f3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -20,6 +20,7 @@ Bugs fixed
* #3661: sphinx-build crashes on parallel build
* #3669: gettext builder fails with "ValueError: substring not found"
+* #3660: Sphinx always depends on sphinxcontrib-websupport and its dependencies
Testing
--------
diff --git a/setup.py b/setup.py
index 1fd2d34d0..4354b0baa 100644
--- a/setup.py
+++ b/setup.py
@@ -51,7 +51,6 @@ requires = [
'alabaster>=0.7,<0.8',
'imagesize',
'requests>=2.0.0',
- 'sphinxcontrib-websupport',
'typing',
'setuptools',
]
@@ -60,6 +59,9 @@ extras_require = {
':sys_platform=="win32"': [
'colorama>=0.3.5',
],
+ 'websupport': [
+ 'sphinxcontrib-websupport',
+ ],
'test': [
'pytest',
'mock', # it would be better for 'test:python_version in 2.7'
diff --git a/sphinx/websupport/__init__.py b/sphinx/websupport/__init__.py
index f06d98433..f71034708 100644
--- a/sphinx/websupport/__init__.py
+++ b/sphinx/websupport/__init__.py
@@ -12,11 +12,16 @@
import warnings
from sphinx.deprecation import RemovedInSphinx20Warning
-from sphinxcontrib.websupport import WebSupport # NOQA
-from sphinxcontrib.websupport import errors # NOQA
-from sphinxcontrib.websupport.search import BaseSearch, SEARCH_ADAPTERS # NOQA
-from sphinxcontrib.websupport.storage import StorageBackend # NOQA
-warnings.warn('sphinx.websupport module is now provided as sphinxcontrib.webuspport. '
- 'sphinx.websupport will be removed in Sphinx-2.0. Please use it instaed',
- RemovedInSphinx20Warning)
+try:
+ from sphinxcontrib.websupport import WebSupport # NOQA
+ from sphinxcontrib.websupport import errors # NOQA
+ from sphinxcontrib.websupport.search import BaseSearch, SEARCH_ADAPTERS # NOQA
+ from sphinxcontrib.websupport.storage import StorageBackend # NOQA
+
+ warnings.warn('sphinx.websupport module is now provided as sphinxcontrib-webuspport. '
+ 'sphinx.websupport will be removed in Sphinx-2.0. Please use it instaed',
+ RemovedInSphinx20Warning)
+except ImportError:
+ warnings.warn('Since Sphinx-1.6, sphinx.websupport module is now separated to '
+ 'sphinxcontrib-webuspport package. Please add it into your dependency list.')