summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElod Illes <elod.illes@est.tech>2019-06-27 12:57:48 +0200
committerElod Illes <elod.illes@est.tech>2019-07-10 16:52:17 +0200
commit39f61e4392ef3c0f1852b87a9d2cb0bc4f410bec (patch)
treea2617852f8fc98816eb41669bb853214b5031240
parent1861a85f13074365c3d2eee5e78612e52f710a24 (diff)
downloadstevedore-stable/rocky.tar.gz
Add local bindep.txt and update sphinx loggingstable/rocky
This is a combination of two commits to fix the check / gate jobs: 1. Add local bindep.txt As it was announced [1] global bindep-fallback.txt was removed and now projects need to have a local bindep.txt to be able to install binary dependencies for testing. In documentation zuul job graphviz package ('dot' command) is needed. Without that the job fails with: dot command 'dot' cannot be run (needed for graphviz output), check the graphviz_dot setting [1] http://lists.openstack.org/pipermail/openstack-discuss/2019-June/007272.html (cherry picked from commit feac47186d79569bb564e18216e07f18ed5ccd8b) (cherry picked from commit caf65ed26066b5f7d13cc50e67f1df852414b2dc) 2. Update sphinx logging to not use app object Logging via the application object was deprecated in sphinx 1.6 and is now removed in the master branch that will become 2.0. This updates our sphinx extension to use the recommended sphinx.util.logging instead. Closes-bug: #1798174 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com> (cherry picked from commit 5b39123aa4d2988fc773003d166c2bde590ea080) Change-Id: I5efddfc72e9dc0dd1b8b9e1e37708e1d30ef3c39
-rw-r--r--bindep.txt7
-rw-r--r--stevedore/sphinxext.py12
-rw-r--r--tox.ini12
3 files changed, 25 insertions, 6 deletions
diff --git a/bindep.txt b/bindep.txt
new file mode 100644
index 0000000..7a2df73
--- /dev/null
+++ b/bindep.txt
@@ -0,0 +1,7 @@
+# This is a cross-platform list tracking distribution packages needed for install and tests;
+# see https://docs.openstack.org/infra/bindep/ for additional information.
+
+# graphviz is necessary for documentation build
+graphviz [!platform:gentoo]
+media-gfx/graphviz [platform:gentoo]
+
diff --git a/stevedore/sphinxext.py b/stevedore/sphinxext.py
index 3c9b6ce..8ca88bb 100644
--- a/stevedore/sphinxext.py
+++ b/stevedore/sphinxext.py
@@ -18,10 +18,13 @@ from docutils import nodes
from docutils.parsers import rst
from docutils.parsers.rst import directives
from docutils.statemachine import ViewList
+from sphinx.util import logging
from sphinx.util.nodes import nested_parse_with_titles
from stevedore import extension
+LOG = logging.getLogger(__name__)
+
def _get_docstring(plugin):
return inspect.getdoc(plugin) or ''
@@ -72,16 +75,13 @@ class ListPluginsDirective(rst.Directive):
has_content = True
def run(self):
- env = self.state.document.settings.env
- app = env.app
-
namespace = ' '.join(self.content).strip()
- app.info('documenting plugins from %r' % namespace)
+ LOG.info('documenting plugins from %r' % namespace)
overline_style = self.options.get('overline-style', '')
underline_style = self.options.get('underline-style', '=')
def report_load_failure(mgr, ep, err):
- app.warn(u'Failed to load %s: %s' % (ep.module_name, err))
+ LOG.warning(u'Failed to load %s: %s' % (ep.module_name, err))
mgr = extension.ExtensionManager(
namespace,
@@ -111,5 +111,5 @@ class ListPluginsDirective(rst.Directive):
def setup(app):
- app.info('loading stevedore.sphinxext')
+ LOG.info('loading stevedore.sphinxext')
app.add_directive('list-plugins', ListPluginsDirective)
diff --git a/tox.ini b/tox.ini
index fbf8a1e..a370b63 100644
--- a/tox.ini
+++ b/tox.ini
@@ -48,6 +48,18 @@ deps =
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
+[testenv:bindep]
+basepython = python3
+# Do not install any requirements. We want this to be fast and work even if
+# system dependencies are missing, since it's used to tell you what system
+# dependencies are missing! This also means that bindep must be installed
+# separately, outside of the requirements files, and develop mode disabled
+# explicitly to avoid unnecessarily installing the checked-out repo too (this
+# further relies on "tox.skipsdist = True" above).
+deps = bindep
+commands = bindep test
+usedevelop = False
+
[testenv:lower-constraints]
basepython = python3
deps =