diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-10-14 14:03:09 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-10-14 14:03:09 +0000 |
commit | f7537c549909ff3b75157c12004422b213d7b629 (patch) | |
tree | 6ca77a6d76577e6a7039d49249d7ce5ab087954e /pbr | |
parent | 787d63dca20f2c2c00d119162d5ef720711c59c8 (diff) | |
parent | 0d6bfaf2e3f839704f07b265ba81e224936a2b49 (diff) | |
download | pbr-f7537c549909ff3b75157c12004422b213d7b629.tar.gz |
Merge "Adds option for excluding files from autodoc trees"
Diffstat (limited to 'pbr')
-rw-r--r-- | pbr/packaging.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py index 13e0cdb..71012fc 100644 --- a/pbr/packaging.py +++ b/pbr/packaging.py @@ -734,7 +734,8 @@ try: def _sphinx_tree(self): source_dir = self._get_source_dir() - apidoc.main(['apidoc', '.', '-H', 'Modules', '-o', source_dir]) + cmd = ['apidoc', '.', '-H', 'Modules', '-o', source_dir] + apidoc.main(cmd + self.autodoc_tree_excludes) def _sphinx_run(self): if not self.verbose: @@ -808,6 +809,14 @@ try: else: setup_command.BuildDoc.run(self) + def initialize_options(self): + # Not a new style class, super keyword does not work. + setup_command.BuildDoc.initialize_options(self) + + # NOTE(dstanek): exclude setup.py from the autodoc tree index + # builds because all projects will have an issue with it + self.autodoc_tree_excludes = ['setup.py'] + def finalize_options(self): # Not a new style class, super keyword does not work. setup_command.BuildDoc.finalize_options(self) @@ -815,6 +824,14 @@ try: if not isinstance(self.builders, list) and self.builders: self.builders = self.builders.split(',') + # NOTE(dstanek): check for autodoc tree exclusion overrides + # in the setup.cfg + opt = 'autodoc_tree_excludes' + option_dict = self.distribution.get_option_dict('pbr') + if opt in option_dict: + self.autodoc_tree_excludes = option_dict[opt][1] + self.ensure_string_list(opt) + class LocalBuildLatex(LocalBuildDoc): builders = ['latex'] command_name = 'build_sphinx_latex' |