summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bechtold <tbechtold@suse.com>2017-08-23 08:30:23 +0200
committerThomas Bechtold <tbechtold@suse.com>2017-08-23 08:31:27 +0200
commitf9503f1a3069c4a151c8f35f942f892f09451263 (patch)
treefbd34ce372fa2b91165d325e6ca84fa66256d486
parente3e406b39a5b4cee5a94c6ea1d150bfae6cd8d7a (diff)
downloadstevedore-f9503f1a3069c4a151c8f35f942f892f09451263.tar.gz
Make openstackdocstheme an optional doc dependency
stevedore is a library that is used outside of OpenStack, too. Having a build requirement that needs something OpenStack specific makes life in cases (eg. for downstream packagers) more difficult. So let's make openstackdocstheme an optional requirement. Change-Id: Ic8cc577e617e5da699f9dc43830183005bd2ee66
-rw-r--r--doc/source/conf.py16
-rw-r--r--setup.cfg8
-rw-r--r--test-requirements.txt1
-rw-r--r--tox.ini1
4 files changed, 23 insertions, 3 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
index d3582ca..1074cd5 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -14,6 +14,16 @@
import datetime
import subprocess
+# make openstackdocstheme an optional dependency. stevedore is a low level lib
+# that is used outside of OpenStack. Not having something OpenStack specific
+# as build requirement is a good thing.
+try:
+ import openstackdocstheme
+except ImportError:
+ has_openstackdocstheme = False
+else:
+ has_openstackdocstheme = True
+
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -31,9 +41,10 @@ extensions = [
'sphinx.ext.todo',
'sphinx.ext.graphviz',
'sphinx.ext.extlinks',
- 'openstackdocstheme',
'stevedore.sphinxext',
]
+if has_openstackdocstheme:
+ extensions.append('openstackdocstheme')
# openstackdocstheme options
repository_name = 'openstack/stevedore'
@@ -108,7 +119,8 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#html_theme = 'default'
-html_theme = 'openstackdocs'
+if has_openstackdocstheme:
+ html_theme = 'openstackdocs'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
diff --git a/setup.cfg b/setup.cfg
index 278485f..d7afb1d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,6 +16,14 @@ classifier =
Intended Audience :: Developers
Environment :: Console
+[extras]
+docs =
+ # make openstackdocstheme an optional dependency. stevedore is a low level
+ # lib that is used outside of OpenStack. Not having something OpenStack
+ # specific as build requirement is a good thing.
+ openstackdocstheme>=1.16.0 # Apache-2.0
+
+
[global]
setup-hooks =
pbr.hooks.setup_hook
diff --git a/test-requirements.txt b/test-requirements.txt
index 6593222..c607755 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -7,5 +7,4 @@ sphinx>=1.6.2 # BSD
mock>=2.0.0 # BSD
coverage!=4.4,>=4.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
-openstackdocstheme>=1.16.0 # Apache-2.0
reno>=2.5.0 # Apache-2.0
diff --git a/tox.ini b/tox.ini
index 164e92a..bb73ac1 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,6 +10,7 @@ setenv =
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
deps =
-r{toxinidir}/test-requirements.txt
+ .[docs]
distribute = False
commands = python setup.py testr --testr-args='{posargs}'