@@ -23,7 +23,7 @@ later in this document):
23
23
#. Was ``configure `` regenerated (if necessary)?
24
24
#. Was ``pyconfig.h.in `` regenerated (if necessary)?
25
25
#. 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)?
27
27
#. Was "What's New" updated (as appropriate)?
28
28
#. Were appropriate labels added to signify necessary backporting of the
29
29
pull request?
@@ -32,7 +32,7 @@ later in this document):
32
32
If you want to share your work-in-progress code on a feature or bugfix,
33
33
either open a ``WIP ``-prefixed PR, publish patches on the
34
34
`issue tracker `_ or create a public fork of the repository.
35
-
35
+
36
36
.. _issue tracker : https://bugs.python.org
37
37
38
38
@@ -79,7 +79,7 @@ The automated patch checklist runs through:
79
79
(using ``Tools/scripts/reindent-rst.py ``)
80
80
* Has the documentation been updated?
81
81
* Has the test suite been updated?
82
- * Has ``Misc/NEWS `` been updated ?
82
+ * Has an entry under ``Misc/NEWS.d/next `` been added ?
83
83
* Has ``Misc/ACKS `` been updated?
84
84
* Has ``configure `` been regenerated, if necessary?
85
85
* 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.
115
115
First, make sure the patch is in a good state. Both :ref: `patch ` and
116
116
:ref: `helptriage `
117
117
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 ``
119
119
entries (which a core developer should make sure are updated appropriately).
120
120
121
121
Second, make sure the patch does not break backwards-compatibility without a
@@ -127,13 +127,13 @@ is worth it, ask on python-dev.
127
127
128
128
Third, ensure the patch is attributed correctly with the contributor's
129
129
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
132
132
patch by <x>" is an appropriate alternate wording.
133
133
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).
137
137
138
138
Finally, make sure that the submitter of the
139
139
patch has a CLA in place (indicated by an asterisk following their username
@@ -171,17 +171,17 @@ for inclusion.
171
171
https://www.python.org/psf/contrib/contrib-form/
172
172
173
173
174
- What's New and NEWS Entries
174
+ What's New and News Entries
175
175
---------------------------
176
176
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 ``.
178
178
If the change is particularly interesting for end users (e.g. new features,
179
179
significant improvements, or backwards-incompatible changes), an entry in
180
180
the ``What's New in Python `` document (in ``Doc/whatsnew/ ``) should be added
181
181
as well.
182
182
183
183
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
185
185
been included in any formal release (including alpha and beta releases).
186
186
These exceptions are:
187
187
@@ -191,7 +191,7 @@ These exceptions are:
191
191
then cut prior to the first beta).
192
192
193
193
* 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
195
195
needed.
196
196
197
197
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
201
201
Python 2.7 Maintenance Releases" section of the Python 2.7 What's New
202
202
document.
203
203
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)
208
222
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 ``.
212
225
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::
215
231
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.
218
234
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.)
223
238
224
239
225
240
Commit Messages
@@ -230,15 +245,16 @@ communicate that reason to other core developers. Python core developers have
230
245
developed a standard way of formatting commit messages that everyone is
231
246
expected to follow.
232
247
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::
236
252
237
253
bpo-42: the spam module is now more spammy.
238
-
254
+
239
255
The spam module sporadically came up short on spam. This change
240
256
raises the amount of spam in the module by making it more spammy.
241
-
257
+
242
258
Thanks to Monty Python for the patch.
243
259
244
260
The first line or sentence is meant to be a dense, to-the-point explanation
@@ -272,7 +288,7 @@ Working with Git_
272
288
273
289
.. seealso ::
274
290
:ref: `gitbootcamp `
275
-
291
+
276
292
As a core developer, the ability to push changes to the official Python
277
293
repositories means you have to be more careful with your workflow:
278
294
@@ -282,10 +298,10 @@ repositories means you have to be more careful with your workflow:
282
298
dedicated to maintenance of the work before the work gets integrated in the
283
299
main repository.
284
300
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
286
302
maintenance branches (``2.7 ``, ``3.5 ``, or ``3.6 ``). You should commit against
287
303
your own feature branch, and create a pull request.
288
-
304
+
289
305
It is recommended to keep a fork of the main repository around, as it allows simple
290
306
reversion of all local changes (even "committed" ones) if your local clone gets
291
307
into a state you aren't happy with.
@@ -410,7 +426,7 @@ new features. The other branches only receive bug fixes or security fixes.
410
426
Backporting Changes to an Older Version
411
427
---------------------------------------
412
428
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
414
430
the maintenance branches, a core developer can apply the labels ``needs backport to X.Y ``
415
431
to the pull request.
416
432
@@ -421,13 +437,13 @@ on the ``master`` branch. To display the 10 most recent commit hashes and their
421
437
line of the commit message::
422
438
423
439
git log -10 --oneline
424
-
440
+
425
441
Prefix the backport pull request with the branch, for example::
426
442
427
443
[3.6] bpo-12345: Fix the Spam Module
428
-
444
+
429
445
Note that cherry_picker.py _ adds the branch prefix automatically.
430
-
446
+
431
447
Once the backport pull request has been created, remove the
432
448
``needs backport to X.Y `` label from the original pull request. (Only Core
433
449
Developers can apply labels to GitHub pull requests).
0 commit comments