8000 Document the news file format (#212) · python/devguide@daaa4b5 · GitHub
[go: up one dir, main page]

Skip to content

Commit daaa4b5

Browse files
authored
Document the news file format (#212)
1 parent 867581f commit daaa4b5

File tree

4 files changed

+63
-47
lines changed

4 files changed

+63
-47
lines changed

committing.rst

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ later in this document):
2323
#. Was ``configure`` regenerated (if necessary)?
2424
#. Was ``pyconfig.h.in`` regenerated (if necessary)?
2525
#. Was the submitter added to ``Misc/ACKS`` (as appropriate)?
26-
#. Was ``Misc/NEWS`` updated (as appropriate)?
26+
#. Was an entry added under ``Misc/NEWS.d/next`` (as appropriate)?
2727
#. Was "What's New" updated (as appropriate)?
2828
#. Were appropriate labels added to signify necessary backporting of the
2929
pull request?
@@ -32,7 +32,7 @@ later in this document):
3232
If you want to share your work-in-progress code on a feature or bugfix,
3333
either open a ``WIP``-prefixed PR, publish patches on the
3434
`issue tracker`_ or create a public fork of the repository.
35-
35+
3636
.. _issue tracker: https://bugs.python.org
3737

3838

@@ -79,7 +79,7 @@ The automated patch checklist runs through:
7979
(using ``Tools/scripts/reindent-rst.py``)
8080
* Has the documentation been updated?
8181
* Has the test suite been updated?
82-
* Has ``Misc/NEWS`` been updated?
82+
* Has an entry under ``Misc/NEWS.d/next`` been added?
8383
* Has ``Misc/ACKS`` been updated?
8484
* Has ``configure`` been regenerated, if necessary?
8585
* Has ``pyconfig.h.in`` been regenerated, if necessary?
@@ -115,7 +115,7 @@ someone else. When doing so you will want to make sure of some things.
115115
First, make sure the patch is in a good state. Both :ref:`patch` and
116116
:ref:`helptriage`
117117
explain what is to be expected of a patch. Typically patches that get cleared by
118-
triagers are good to go except maybe lacking ``Misc/ACKS`` and ``Misc/NEWS``
118+
triagers are good to go except maybe lacking ``Misc/ACKS`` and ``Misc/NEWS.d``
119119
entries (which a core developer should make sure are updated appropriately).
120120

121121
Second, make sure the patch does not break backwards-compatibility without a
@@ -127,13 +127,13 @@ is worth it, ask on python-dev.
127127

128128
Third, ensure the patch is attributed correctly with the contributor's
129129
name in ``Misc/ACKS`` if they aren't already there (and didn't add themselves
130-
in their patch) and by mentioning "Patch by <x>" in the ``Misc/NEWS`` entry
131-
and the checkin message. If the patch has been heavily modified then "Initial
130+
in their patch) and by mentioning "Patch by <x>" in the ``Misc/NEWS.d`` entry
131+
and the check-in message. If the patch has been heavily modified then "Initial
132132
patch by <x>" is an appropriate alternate wording.
133133

134-
If you omit correct attribution in the initial checkin, then update ``ACKS``
135-
and ``NEWS`` in a subsequent checkin (don't worry about trying to fix the
136-
original checkin message in that case).
134+
If you omit correct attribution in the initial check-in, then update ``ACKS``
135+
and ``NEWS.d`` in a subsequent check-in (don't worry about trying to fix the
136+
original check-in message in that case).
137137

138138
Finally, make sure that the submitter of the
139139
patch has a CLA in place (indicated by an asterisk following their username
@@ -171,17 +171,17 @@ for inclusion.
171171
https://www.python.org/psf/contrib/contrib-form/
172172

173173

174-
What's New and NEWS Entries
174+
What's New and News Entries
175175
---------------------------
176176

177-
Almost all changes made to the code base deserve an entry in ``Misc/NEWS``.
177+
Almost all changes made to the code base deserve an entry in ``Misc/NEWS.d``.
178178
If the change is particularly interesting for end users (e.g. new features,
179179
significant improvements, or backwards-incompatible changes), an entry in
180180
the ``What's New in Python`` document (in ``Doc/whatsnew/``) should be added
181181
as well.
182182

183183
There are two notable exceptions to this general principle, and they
184-
both relate to changes that *already* have a NEWS entry, and have not yet
184+
both relate to changes that *already* have a news entry, and have not yet
185185
been included in any formal release (including alpha and beta releases).
186186
These exceptions are:
187187

@@ -191,7 +191,7 @@ These exceptions are:
191191
then cut prior to the first beta).
192192

193193
* If a change is a fix (or other adjustment) to an earlier unreleased change
194-
and the original NEWS entry remains valid, then no additional entry is
194+
and the original news entry remains valid, then no additional entry is
195195
needed.
196196

197197
Needing a What's New entry almost always means that a change is *not*
@@ -201,25 +201,40 @@ when implemented, these changes *must* be noted in the "New Additions in
201201
Python 2.7 Maintenance Releases" section of the Python 2.7 What's New
202202
document.
203203

204-
New NEWS entries are customarily added at or near the top of their
205-
respective sections, so that entries within a section appear in approximate
206-
order from newest to oldest. However, this is customary and not a
207-
requirement.
204+
News entries go into the ``Misc/NEWS.d`` directory as individual files. The
205+
easiest way to create a news entry is to use the
206+
`blurb <https://pypi.org/project/blurb/>`_ tool and its ``blurb add`` command.
207+
208+
If you are unable to use the tool you can create the news entry file manually.
209+
The ``Misc/NEWS.d`` directory contains a sub-directory named ``next`` which
210+
itself contains various sub-directories representing classifications for what
211+
was affected (e.g. ``Misc/NEWS.d/next/Library`` for changes relating to the
212+
standard library). The file name itself should be of the format
213+
``<date>.bpo-<issue-number>.<nonce>.rst``:
214+
215+
* ``<date>`` is today's date in ``YYYY-MM-DD`` format, e.g. ``2017-05-27``
216+
* ``<issue-number>`` is the issue number the change is for, e.g. ``12345``
217+
for ``bpo-12345``
218+
* ``<nonce>`` is some "unique" string to guarantee the file name is
219+
unique across branches, e.g. ``Yl4gI2`` (typically six characters, but it can
220+
be any length of letters and numbers, and its uniqueness can be satisfied by
221+
typing random characters on your keyboard)
208222

209-
The NEWS file is now read by Sphinx to produce the "Changelog" page; accordingly
210-
it should be valid reStructuredText. The "default role" (single backticks) can
211-
be used to refer to objects in the documentation. Example NEWS entry::
223+
So a file name may be
224+
``Misc/NEWS.d/next/Library/2017-05-27.bpo-12345.Yl4gI2.rst``.
212225

213-
- bpo-15304: Fix warning message when `os.chdir()` fails inside
214-
`test.support.temp_cwd()`. Patch by Chris Jerdonek.
226+
The contents of a news file should be valid reStructuredText. The "default role"
227+
(single backticks) in reST can be used to refer to objects in the documentation.
228+
An 80 character column width should be used. There is no indentation or leading
229+
marker in the file (e.g. ``-``). There is also no need to start the entry with
230+
the issue number as it's part of the file name itself. Example news entry::
215231

216-
(In all other ``.rst`` files, the single backticks should not be used. They are
217-
allowed here because NEWS is meant to be as readable as possible unprocessed.)
232+
Fix warning message when `os.chdir()` fails inside
233+
`test.support.temp_cwd()`. Patch by Chris Jerdonek.
218234

219-
A nice trick to make merging across branches work more smoothly is to
220-
put a new entry after the first or first two entries rather than at the very
221-
top. This way if you commit, pull new changesets and merge, the merge will
222-
succeed automatically.
235+
(In other ``.rst`` files the single backticks should not be used. They are
236+
allowed here because news entries are meant to be as readable as possible
237+
unprocessed.)
223238

224239

225240
Commit Messages
@@ -230,15 +245,16 @@ communicate that reason to other core developers. Python core developers have
230245
developed a standard way of formatting commit messages that everyone is
231246
expected to follow.
232247

233-
Our usual convention mimics that used in the ``Misc/NEWS`` file. Actually,
234-
it is common to simply paste the NEWS entry into the commit message. Here
235-
is an example::
248+
Our usual convention mimics that used in news entries (it is actually common to
249+
start by pasting the news entry into the commit message). The only key
250+
difference when compared to a news entry is the inclusion of the issue number
251+
as the beginning of the commit message. Here is an example::
236252

237253
bpo-42: the spam module is now more spammy.
238-
254+
239255
The spam module sporadically came up short on spam. This change
240256
raises the amount of spam in the module by making it more spammy.
241-
257+
242258
Thanks to Monty Python for the patch.
243259

244260
The first line or sentence is meant to be a dense, to-the-point explanation
@@ -272,7 +288,7 @@ Working with Git_
272288

273289
.. seealso::
274290
:ref:`gitbootcamp`
275-
291+
276292
As a core developer, the ability to push changes to the official Python
277293
repositories means you have to be more careful with your workflow:
278294

@@ -282,10 +298,10 @@ repositories means you have to be more careful with your workflow:
282298
dedicated to maintenance of the work before the work gets integrated in the
283299
main repository.
284300

285-
* You should not commit directly into the ``master`` branch, or any of the
301+
* You should not commit directly into the ``master`` branch, or any of the
286302
maintenance branches (``2.7``, ``3.5``, or ``3.6``). You should commit against
287303
your own feature branch, and create a pull request.
288-
304+
289305
It is recommended to keep a fork of the main repository around, as it allows simple
290306
reversion of all local changes (even "committed" ones) if your local clone gets
291307
into a state you aren't happy with.
@@ -410,7 +426,7 @@ new features. The other branches only receive bug fixes or security fixes.
410426
Backporting Changes to an Older Version
411427
---------------------------------------
412428

413-
When it is determined that a pull request needs to be backported into one or more of
429+
When it is determined that a pull request needs to be backported into one or more of
414430
the maintenance branches, a core developer can apply the labels ``needs backport to X.Y``
415431
to the pull request.
416432

@@ -421,13 +437,13 @@ on the ``master`` branch. To display the 10 most recent commit hashes and their
421437
line of the commit message::
422438

423439
git log -10 --oneline
424-
440+
425441
Prefix the backport pull request with the branch, for example::
426442

427443
[3.6] bpo-12345: Fix the Spam Module
428-
444+
429445
Note that cherry_picker.py_ adds the branch prefix automatically.
430-
446+
431447
Once the backport pull request has been created, remove the
432448
``needs backport to X.Y`` label from the original pull request. (Only Core
433449
Developers can apply labels to GitHub pull requests).

developers.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ This file is a running log of developers given commit privileges for Python.
88
The purpose is to provide some institutional memory of who was given access
99
and why.
1010

11-
The first entry starts in April 2005. In keeping with the style of Misc/NEWS,
12-
newer entries should be added to the top. Entries should include the name
13-
or initials of the project admin who made the change or granted access. The
14-
procedure for adding or removing users is described in :ref:`altering-access`.
11+
The first entry starts in April 2005. Newer entries should be added to the top.
12+
Entries should include the name or initials of the project admin who made the
13+
change or granted access. The procedure for adding or removing users is
14+
described in :ref:`altering-access`.
1515

1616
Note, when giving new commit permissions, be sure to get a contributor agreement
1717
from the committer. See https://www.python.org/psf/contrib/ for details. Commit
@@ -27,7 +27,7 @@ Permissions History
2727

2828
- Carol Willing was given push privileges on May 24, 2017 by Brett Cannon,
2929
on his own recommendation.
30-
30+
3131
- Mariatta Wijaya was given push privileges on January 27, 2017 by Brett Cannon,
3232
on the recommendation of Raymond Hettinger.
3333

gitbootcamp.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ When a pull request submitter has enabled the `Allow edits from maintainers`_
304304
option, Python Core Developers may decide to make any remaining edits needed
305305
prior to merging themselves, rather than asking the submitter to do them. This
306306
can be particularly appropriate when the remaining changes are bookkeeping
307-
items like updating ``Misc/ACKS`` and ``Misc/NEWS``.
307+
items like updating ``Misc/ACKS``.
308308

309309
.. _Allow edits from maintainers: https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/
310310

pullrequest.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,6 @@ Crediting
352352
---------
353353

354354
Non-trivial contributions are credited in the ``Misc/ACKS`` file (and, most
355-
often, in a contribution's ``Misc/NEWS`` entry as well). You may be
355+
often, in a contribution's news entry as well). You may be
356356
asked to make these edits on the behalf of the core developer who
357357
accepts your pull request.

0 commit comments

Comments
 (0)
0