Merge "Add an option to skip generating RELEASENOTES.rst"

This commit is contained in:
Zuul 2018-10-16 16:08:13 +00:00 committed by Gerrit Code Review
commit bd300d07ee
3 changed files with 32 additions and 0 deletions

View File

@ -103,3 +103,20 @@ skipped. Similarly setting ``SKIP_WRITE_GIT_CHANGELOG``
will cause logic around generating ``ChangeLog`` file using *git*
information to be skipped.
.. _packaging-releasenotes:
Release Notes
-------------
*pbr* generates a release notes file, typically called ``RELEASENOTES.rst``,
if `reno`_ is present and configured. You may wish to disable this
functionality. If that is the case setting ``SKIP_GENERATE_RENO``
::
export SKIP_GENERATE_RENO
will disable this feature.
.. _reno: https://docs.openstack.org/reno/latest/

View File

@ -230,6 +230,13 @@ The ``pbr`` section controls *pbr*-specific options and behaviours.
This can also be configured using the ``SKIP_GENERATE_AUTHORS`` environment
variable, as described :ref:`here <packaging-authors-changelog>`
``skip_reno``
If enabled, *pbr* will not generate a ``RELEASENOTES.txt`` file if `reno`_ is
present and configured.
This can also be configured using the ``SKIP_GENERATE_RENO`` environment
variable, as described :ref:`here <packaging-releasenotes>`.
``autodoc_tree_index_modules``
A boolean option controlling whether *pbr* should generate an index of
modules using ``sphinx-apidoc``. By default, all files except ``setup.py``
@ -487,3 +494,4 @@ this file.
.. _setuptools: http://www.sphinx-doc.org/en/stable/setuptools.html
.. _sphinxcontrib-apidoc: https://pypi.org/project/sphinxcontrib-apidoc/
.. _reno: https://docs.openstack.org/reno/latest/

View File

@ -577,6 +577,13 @@ class LocalSDist(sdist.sdist):
if hasattr(self, '_has_reno'):
return self._has_reno
option_dict = self.distribution.get_option_dict('pbr')
should_skip = options.get_boolean_option(option_dict, 'skip_reno',
'SKIP_GENERATE_RENO')
if should_skip:
self._has_reno = False
return False
try:
# versions of reno witout this module will not have the required
# feature, hence the import