Browse Source

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

tags/5.1.0^0
Zuul 8 months ago
parent
commit
bd300d07ee
3 changed files with 32 additions and 0 deletions
  1. 17
    0
      doc/source/user/packagers.rst
  2. 8
    0
      doc/source/user/using.rst
  3. 7
    0
      pbr/packaging.py

+ 17
- 0
doc/source/user/packagers.rst View File

@@ -103,3 +103,20 @@ skipped. Similarly setting ``SKIP_WRITE_GIT_CHANGELOG``
103 103
 
104 104
 will cause logic around generating ``ChangeLog`` file using *git*
105 105
 information to be skipped.
106
+
107
+.. _packaging-releasenotes:
108
+
109
+Release Notes
110
+-------------
111
+
112
+*pbr* generates a release notes file, typically called ``RELEASENOTES.rst``,
113
+if `reno`_ is present and configured. You may wish to disable this
114
+functionality. If that is the case setting ``SKIP_GENERATE_RENO``
115
+
116
+::
117
+
118
+   export SKIP_GENERATE_RENO
119
+
120
+will disable this feature.
121
+
122
+.. _reno: https://docs.openstack.org/reno/latest/

+ 8
- 0
doc/source/user/using.rst View File

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

+ 7
- 0
pbr/packaging.py View File

@@ -577,6 +577,13 @@ class LocalSDist(sdist.sdist):
577 577
         if hasattr(self, '_has_reno'):
578 578
             return self._has_reno
579 579
 
580
+        option_dict = self.distribution.get_option_dict('pbr')
581
+        should_skip = options.get_boolean_option(option_dict, 'skip_reno',
582
+                                                 'SKIP_GENERATE_RENO')
583
+        if should_skip:
584
+            self._has_reno = False
585
+            return False
586
+
580 587
         try:
581 588
             # versions of reno witout this module will not have the required
582 589
             # feature, hence the import

Loading…
Cancel
Save