From d4e4efd77963ef95906cfbac73468f80cd8e3330 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 12 Apr 2017 10:38:31 +0100 Subject: Stop building man pages by default From pretty much the beginning [1], pbr has defaulted to building both man page and html output, but has failed to document it anywhere. People tend to copy-paste their 'setup.py' and 'conf.py', or rely on the 'cookiecutter' project, with very little understanding of what's going on under the hood (and why would you care - it's docs :)). This means that the vast majority of folks using 'pbr' (basically everyone in OpenStack) have been unwittingly building "man pages" as part of their doc builds for no good reason, which has also led to a lot of confusion when this magic behavior is the cause of bugs [2][3]. There's no good reason that pbr should default to building both man pages and html output. For folks that want this functionality, we should document it so they can use it. For everyone else though, let's do the sane thing and output html like the standard 'build_sphinx' plugin. [1] https://github.com/openstack-dev/pbr/commit/5b8b7f1d [2] https://bugs.launchpad.net/pbr/+bug/1681983 [3] https://bugs.launchpad.net/oslotest/+bug/1379998 Change-Id: I579134a2b7980669180c1666503b848835cc2957 Closes-Bug: #1681983 --- doc/source/index.rst | 6 ++++++ pbr/builddoc.py | 6 +----- pbr/tests/test_setup.py | 3 +-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index 4a4e90a..764edf1 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -380,6 +380,12 @@ documentation`__. In addition, the ``autodoc_index_modules``, ``autodoc_tree_excludes`` options in the ``pbr`` section will affect the output of the automatic module documentation generation. +.. versionchanged:: 3.0 + + The ``build_sphinx`` plugin used to default to building both HTML and man + page output. This is no longer the case, and you should explicitly set + ``builders`` to ``html man`` if you wish to retain this behavior. + __ http://www.sphinx-doc.org/en/stable/man/sphinx-apidoc.html __ http://www.sphinx-doc.org/en/stable/setuptools.html diff --git a/pbr/builddoc.py b/pbr/builddoc.py index eedbd16..cd522c6 100644 --- a/pbr/builddoc.py +++ b/pbr/builddoc.py @@ -63,7 +63,7 @@ def _find_modules(arg, dirname, files): class LocalBuildDoc(setup_command.BuildDoc): - builders = ['html', 'man'] + builders = ['html'] command_name = 'build_sphinx' sphinx_initialized = False @@ -142,10 +142,6 @@ class LocalBuildDoc(setup_command.BuildDoc): self.builder_target_dir, self.doctree_dir, self.builder, confoverrides, status_stream, freshenv=self.fresh_env, warningiserror=self.warning_is_error) - sphinx_config = app.config - if self.builder == 'man' and len( - getattr(sphinx_config, 'man_pages', '')) == 0: - return self.sphinx_initialized = True try: diff --git a/pbr/tests/test_setup.py b/pbr/tests/test_setup.py index 3d2f401..7aa74f6 100644 --- a/pbr/tests/test_setup.py +++ b/pbr/tests/test_setup.py @@ -308,9 +308,8 @@ class BuildSphinxTest(BaseSphinxTest): build_doc = packaging.LocalBuildDoc(self.distr) build_doc.finalize_options() - self.assertEqual(2, len(build_doc.builders)) + self.assertEqual(1, len(build_doc.builders)) self.assertIn('html', build_doc.builders) - self.assertIn('man', build_doc.builders) build_doc = packaging.LocalBuildDoc(self.distr) build_doc.builders = '' -- cgit v1.2.1