|
| 1 | +The ``changelog.d`` Directory |
| 2 | +============================= |
| 3 | + |
| 4 | +.. -text-begin- |
| 5 | +
|
| 6 | +A "Changelog" is a record of all notable changes made to a project. Such |
| 7 | +a changelog, in our case the :file:`CHANGELOG.rst`, is read by our *users*. |
| 8 | +Therefor, any description should be aimed to users instead of describing |
| 9 | +internal changes which are only relevant to developers. |
| 10 | + |
| 11 | +To avoid merge conflicts, we use the towncrier_ package to manage our changelog. |
| 12 | + |
| 13 | +The directory :file:`changelog.d` contains "newsfragments" which are short |
| 14 | +ReST-formatted files. |
| 15 | +On release, those news fragments are compiled into our :file:`CHANGELOG.rst`. |
| 16 | + |
| 17 | +You don't need to install ``towncrier`` yourself, use the :command:`tox` command |
| 18 | +to call the tool. |
| 19 | + |
| 20 | +We recommend to follow the steps to make a smooth integration of your changes: |
| 21 | + |
| 22 | +#. After you have created a new pull request (PR), add a new file into the |
| 23 | + directory :file:`changelog.d`. Each filename follows the syntax:: |
| 24 | + |
| 25 | + <ISSUE>.<TYPE>.rst |
| 26 | + |
| 27 | + where ``<ISSUE>`` is the pull request number, and ``<TYPE>`` is one of: |
| 28 | + |
| 29 | + * ``bugfix``: fixes a reported bug. |
| 30 | + * ``deprecation``: informs about deprecation warnings |
| 31 | + * ``doc``: improves documentation. |
| 32 | + * ``feature``: adds new user facing features. |
| 33 | + * ``removal``: removes obsolete or deprecated features. |
| 34 | + * ``trivial``: fixes a small typo or internal change that might be noteworthy. |
| 35 | + |
| 36 | + For example: ``123.feature.rst``, ``456.bugfix.rst`` etc. |
| 37 | + |
| 38 | +#. Create the new file with the command:: |
| 39 | + |
| 40 | + tox -e changelog -- create 123.feature.rst |
| 41 | + |
| 42 | + The file is created int the :file:`changelog.d` directory. |
| 43 | + |
| 44 | +#. Open the file and add describe your changes. |
| 45 | + |
| 46 | + * Wrap symbols like modules, functions, or classes into double backticks |
| 47 | + so they are rendered in a ``monospace font``. |
| 48 | + * Prefer simple past tense or constructions with "now". |
| 49 | + |
| 50 | +#. Check your changes with:: |
| 51 | + |
| 52 | + tox -e changelog -- check |
| 53 | + |
| 54 | +#. Optionally, build a draft version of the changelog file with the command:: |
| 55 | + |
| 56 | + tox -e changelog |
| 57 | + |
| 58 | +#. Commit all your changes and push it. |
| 59 | + |
| 60 | + |
| 61 | +This finishes your steps. |
| 62 | + |
| 63 | +On release, the maintainer compiles a new :file:`CHANGELOG.rst` file by running:: |
| 64 | + |
| 65 | + tox -e changelog -- build |
| 66 | + |
| 67 | +This will remove all newsfragments inside the :file:`changelog.d` directory, |
| 68 | +making it ready for the next release. |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +.. _towncrier: https://pypi.org/project/towncrier |
0 commit comments