forked from python/peps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pep-0101.txt
1038 lines (754 loc) · 40.9 KB
/
pep-0101.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
PEP: 101
Title: Doing Python Releases 101
Version: $Revision$
Last-Modified: $Date$
Author: Barry Warsaw <[email protected]>, Guido van Rossum <[email protected]>
Status: Active
Type: Informational
Content-Type: text/x-rst
Created: 22-Aug-2001
Post-History:
Replaces: 102
Abstract
========
Making a Python release is a thrilling and crazy process. You've heard
the expression "herding cats"? Imagine trying to also saddle those
purring little creatures up, and ride them into town, with some of their
buddies firmly attached to your bare back, anchored by newly sharpened
claws. At least they're cute, you remind yourself.
Actually, no that's a slight exaggeration <wink>. The Python release
process has steadily improved over the years and now, with the help of our
amazing community, is really not too difficult. This PEP attempts to
collect, in one place, all the steps needed to make a Python release. It
is organized as a recipe and you can actually print this out and check
items off as you complete them.
Things You'll Need
==================
As a release manager there are a lot of resources you'll need to access.
Here's a hopefully-complete list.
* A GPG key.
Python releases are digitally signed with GPG; you'll need a key,
which hopefully will be on the "web of trust" with at least one of
the other release managers.
* A bunch of software:
* "release.py", the Python release manager's friend. It's in the
python/release-tools repo on GitHub. It doesn't pip install
or have any sort of install process--you'll have to put it on
your path yourself, or just run it with a relative path, or
whatever.
* "blurb", the Misc/NEWS management tool. The release process
currently uses three blurb subcommands:
release, merge, and export. Installable via pip3.
* "virtualenv". The release script installs Sphinx in a virtualenv
when building the docs (for 2.7 and 3.5+).
* A fairly complete installation of a recent TeX distribution,
such as texlive. You need that for building the PDF docs.
* Access to ``downloads.nyc1.psf.io``, the server that hosts download files,
and ``docs.nyc1.psf.io``, the server that hosts the documentation.
You'll be uploading files directly here.
* Admin access to ``https://github.com/python/cpython``
* An administrator account on www.python.org, including an "API key".
* Write access to the PEP repository.
If you're reading this, you probably already have this--the first
task of any release manager is to draft the release schedule. But
in case you just signed up... sucker! I mean, uh, congratulations!
* Posting access to http://blog.python.org, a Blogger-hosted weblog.
The RSS feed from this blog is used for the 'Python News' section
on www.python.org.
* A subscription to the super secret release manager mailing list, which may
or may not be called ``python-cabal``. Bug Barry about this.
Types of Releases
=================
There are several types of releases you will need to make. These include:
* ``alpha``
* ``beta``
* ``release candidate 1``
* ``release candidate 2+``
* ``final``
* ``new branch``
* ``begin bugfix mode``
* ``begin security-only mode``
* ``end-of-life``
Some of these release types actually involve more than
one release branch. In particular, a **new branch** is that point in the
release cycle when a new feature release cycle begins. Under the current
organization of the cpython git repository, the *master* branch is always
the target for new features. At some point in the release cycle of the
next feature release, a **new branch** release is made which creates a
new separate branch for stabilization and later maintenance of the
current in-progress feature release (x.y.0) and the *master* branch is modified
to build a new version (which will eventually be released as x.y+1.0).
While the **new branch** release step could occur at one of several points
in the release cycle, current practice is for it to occur at feature code
cutoff for the release which is scheduled for the first beta release.
In the descriptions that follow, steps specific to release types are
labeled accordingly, for now, **new branch** and **final**.
How to Make A Release
=====================
Here are the steps taken to make a Python release. Some steps are more
fuzzy than others because there's little that can be automated (e.g.
writing the NEWS entries). Where a step is usually performed by An
Expert, the role of that expert is given. Otherwise, assume the step is
done by the Release Manager (RM), the designated person performing the
release. The roles and their current experts are:
* RM = Release Manager
- Łukasz Langa <[email protected]> (Central Europe)
- Ned Deily <[email protected]> (US)
- Larry Hastings <[email protected]> (US)
- Benjamin Peterson <[email protected]> (US)
* WE = Windows - Steve Dower <[email protected]>
* ME = Mac - Ned Deily <[email protected]> (US)
* DE = Docs - Julien Palard <[email protected]> (Central Europe)
* IE = Idle Expert - Terry Reedy <[email protected]> (US)
.. note:: It is highly recommended that the RM contact the Experts the day
before the release. Because the world is round and everyone lives
in different timezones, the RM must ensure that the release tag is
created in enough time for the Experts to cut binary releases.
You should not make the release public (by updating the website and
sending announcements) before all experts have updated their bits.
In rare cases where the expert for Windows or Mac is MIA, you may add
a message "(Platform) binaries will be provided shortly" and proceed.
XXX: We should include a dependency graph to illustrate the steps that can
be taken in parallel, or those that depend on other steps.
As much as possible, the release steps are automated and guided by the
release script, which is available in a separate repository:
https://github.com/python/release-tools
We use the following conventions in the examples below. Where a release
number is given, it is of the form ``X.Y.ZaN``, e.g. 3.3.0a3 for Python 3.3.0
alpha 3, where "a" == alpha, "b" == beta, "rc" == release candidate.
Release tags are named ``vX.Y.ZaN``. The branch name for minor release
maintenance branches is ``X.Y``.
This helps by performing several automatic editing steps, and guides you
to perform some manual editing steps.
- Log into irc.freenode.net and join the #python-dev channel.
You probably need to coordinate with other people around the world.
This IRC channel is where we've arranged to meet.
- Check to see if there are any showstopper bugs.
Go to https://bugs.python.org and look for any open bugs that can block
this release. You're looking at the Priority of the open bugs for the
release you're making; here are the relevant definitions:
release blocker
Stops the release dead in its tracks. You may not
make any release with any open release blocker bugs.
deferred blocker
Doesn't block this release, but it will block a
future release. You may not make a final or
candidate release with any open deferred blocker
bugs.
critical
Important bugs that should be fixed, but which does not block
a release.
Review the release blockers and either resolve them, bump them down to
deferred, or stop the release and ask for community assistance. If
you're making a final or candidate release, do the same with any open
deferred.
- Check the stable buildbots.
Go to https://buildbot.python.org/all/#/release_status
Look at the buildbots for the release
you're making. Ignore any that are offline (or inform the community so
they can be restarted). If what remains are (mostly) green buildbots,
you're good to go. If you have non-offline red buildbots, you may want
to hold up the release until they are fixed. Review the problems and
use your judgement, taking into account whether you are making an alpha,
beta, or final release.
- Make a release clone.
On a fork of the cpython repository on GitHub, create a release branch
within it (called the "release clone" from now on). You can use the same
GitHub fork you use for cpython development. Using the standard setup
recommended in the Python Developer's Guide, your fork would be referred
to as `origin` and the standard cpython repo as `upstream`. You will
use the branch on your fork to do the release engineering work, including
tagging the release, and you will use it to share with the other experts
for making the binaries.
For a **final** or **release candidate 2+** release, if you are going
to cherry-pick a subset of changes for the next rc or final from all those
merged since the last rc, you should create a release
engineering branch starting from the most recent release candidate tag,
i.e. ``v3.8.0rc1``. You will then cherry-pick changes from the standard
release branch as necessary into the release engineering branch and
then proceed as usual. If you are going to take all of the changes
since the previous rc, you can proceed as normal.
- Notify all committers by sending email to [email protected].
Since we're now working with a distributed version control system, there
is no need to stop everyone from pushing to the main repo; you'll just
work in your own clone. Therefore, there won't be any checkin freezes.
However, all committers should know the point at which your release
clone was made, as later commits won't make it into the release without
extra effort.
- Make sure the current branch of your release clone is the branch you
want to release from. (``git status``)
- Run ``blurb release <version>`` specifying the version number
(e.g. ``blurb release 3.4.7rc1``). This merges all the recent news
blurbs into a single file marked with this release's version number.
- Check the docs for markup errors.
cd to the Doc directory and run ``make suspicious``. If any markup
errors are found, fix them.
- Regenerate Lib/pydoc-topics.py.
While still in the Doc directory, run ``make pydoc-topics``. Then copy
``build/pydoc-topics/topics.py`` to ``../Lib/pydoc_data/topics.py``.
- Commit your changes to ``pydoc_topics.py``
(and any fixes you made in the docs).
- Consider running ``autoconf`` using the currently accepted standard version
in case ``configure`` or other autoconf-generated files were last
committed with a newer or older version and may contain spurious or
harmful differences. Currently, autoconf 2.69 is our de-facto standard.
if there are differences, commit them.
- Make sure the ``SOURCE_URI`` in ``Doc/tools/extensions/pyspecific.py``
points to the right branch in the git repository (``master`` or ``X.Y``).
For a **new branch** release, change the branch in the file from *master*
to the new release branch you are about to create (``X.Y``).
- Bump version numbers via the release script::
$ .../release-tools/release.py --bump X.Y.ZaN
Reminder: X, Y, Z, and N should be integers.
a should be one of "a", "b", or "rc" (e.g. "3.4.3rc1").
For **final** releases omit the aN ("3.4.3"). For the first
release of a new version Z should be 0 ("3.6.0").
This automates updating various release numbers, but you will have to
modify a few files manually. If your $EDITOR environment variable is
set up correctly, release.py will pop up editor windows with the files
you need to edit.
Review the blurb-generated Misc/NEWS file and edit as necessary.
- Make sure all changes have been committed. (``release.py --bump``
doesn't check in its changes for you.)
- Check the years on the copyright notice. If the last release
was some time last year, add the current year to the copyright
notice in several places:
- README
- LICENSE (make sure to change on trunk and the branch)
- Python/getcopyright.c
- Doc/copyright.rst
- Doc/license.rst
- PC/python_ver_rc.h sets up the DLL version resource for Windows
(displayed when you right-click on the DLL and select
Properties). This isn't a C include file, it's a Windows
"resource file" include file.
- Check with the IE (if there is one <wink>) to be sure that
Lib/idlelib/NEWS.txt has been similarly updated.
- For a **final** major release, edit the first paragraph of
Doc/whatsnew/X.Y.rst to include the actual release date; e.g. "Python
2.5 was released on August 1, 2003." There's no need to edit this for
alpha or beta releases.
- Do a "git status" in this directory.
You should not see any files. I.e. you better not have any uncommitted
changes in your working directory.
- Tag the release for X.Y.ZaN::
$ .../release-tools/release.py --tag X.Y.ZaN
This executes a `git tag` command with the `-s` option so that the
release tag in the repo is signed with your gpg key. When prompted
choose the private key you use for signing release tarballs etc.
- For a **new branch** release, ``Doc/tools/static/switchers.js``
must be updated in all maintained branches, so that the new maintenance
branch is now ``pre`` (for ``pre-release``) and add the new "dev" version.
Also, update ``Doc/tools/templates/indexsidebar.html`` to
increment the version number of the ``in development`` version
and add an entry under it for the new release branch with ``pre-release``
status. Review the remaining branch entires and consider removing the
oldest ``security-fixes`` branch.
Also, similar changes must be made and committed to these files in all
of the other active branches. Or ask the DE to do this.
- For a **final** major release, ``Doc/tools/static/switchers.js``
and ``Doc/tools/templates/indexsidebar.html``
must be updated in all maintained branches, changing the release branch
from ``pre-release`` to ``stable``.
- For **begin security-only mode** and **end-of-life** releases, review the
two files and update the versions accordingly in all active branches.
- Time to build the source tarball. Use the release script to create
the source gzip and xz tarballs,
documentation tar and zip files, and gpg signature files::
$ .../release-tools/release.py --export X.Y.ZaN
This can take a while for **final** releases, and it will leave all the
tarballs and signatures in a subdirectory called ``X.Y.ZaN/src``, and the
built docs in ``X.Y.ZaN/docs`` (for **final** releases).
- Now you want to perform the very important step of checking the
tarball you just created, to make sure a completely clean,
virgin build passes the regression test. Here are the best
steps to take::
$ cd /tmp
$ tar xvf /path/to/your/release/clone/<version>//Python-3.2rc2.tgz
$ cd Python-3.2rc2
$ ls
(Do things look reasonable?)
$ ls Lib
(Are there stray .pyc files?)
$ ./configure
(Loads of configure output)
$ make test
(Do all the expected tests pass?)
If you're feeling lucky and have some time to kill, or if you are making
a release candidate or **final** release, run the full test suite::
$ make testall
If the tests pass, then you can feel good that the tarball is
fine. If some of the tests fail, or anything else about the
freshly unpacked directory looks weird, you better stop now and
figure out what the problem is.
- Push your commits to the remote release branch in your GitHub fork.::
# Do a dry run first.
$ git push --dry-run --tags origin
# Make sure you are pushing to your GitHub fork, *not* to the main
# python/cpython repo!
$ git push --tags origin
- Notify the experts that they can start building binaries.
- STOP STOP STOP STOP STOP STOP STOP STOP
At this point you must receive the "green light" from other experts in
order to create the release. There are things you can do while you wait
though, so keep reading until you hit the next STOP.
- The WE builds the Windows helpfile, using (in Doc/)::
% make.bat htmlhelp (on Windows)
to create suitable input for HTML Help Workshop in build/htmlhelp. HTML
Help Workshop is then fired up on the created python33.hhp file, finally
resulting in an python33.chm file.
- The WE then generates Windows installer files for each Windows
target architecture (for Python 3.3, this means x86 and AMD64).
- The WE has one checkout tree per target architecture, and builds the
pcbuild.sln project for the appropriate architecture.
- PC\icons.mak must have been run with nmake.
- The cmd.exe window in which this is run must have Cygwin/bin in its
path (at least for x86).
- The cmd.exe window must have MS compiler tools for the target
architecture in its path (VS 2010 for Python 3.3).
- The WE then edits Tools/msi/config.py (a file only present locally)
to update full_current_version and sets snapshot to false. Currently
for a release config.py looks like::
snapshot=0
full_current_version="3.3.5rc2"
certname="Python Software Foundation
PCBUILD='PCbuild\\amd64'
The last line is only present for the amd64 checkout.
- Now the WE runs msi.py with ActivePython or Python with pywin32.
The WE checksums the files (``*.msi``, ``*.chm``, ``*-pdb.zip``), uploads them to
downloads.nyc1.psf.io together with gpg signature files, and emails you the
location and md5sums.
- The ME builds Mac installer packages and uploads them to
downloads.nyc1.psf.io together with gpg signature files.
- scp or rsync all the files built by ``release.py --export``
to your home directory on downloads.nyc1.psf.io.
While you're waiting for the files to finish uploading, you can continue
on with the remaining tasks. You can also ask folks on #python-dev
and/or python-committers to download the files as they finish uploading
so that they can test them on their platforms as well.
- Now you need to go to downloads.nyc1.psf.io and move all the files in place
over there. Our policy is that every Python version gets its own
directory, but each directory contains all releases of that version.
- On downloads.nyc1.psf.io, cd /srv/www.python.org/ftp/python/X.Y.Z
creating it if necessary. Make sure it is owned by group 'downloads'
and group-writable.
- Move the release .tgz, and .tar.xz files into place, as well as the
.asc GPG signature files. The Win/Mac binaries are usually put there
by the experts themselves.
Make sure they are world readable. They should also be group
writable, and group-owned by downloads.
- Use ``gpg --verify`` to make sure they got uploaded intact.
- If this is a **final** or rc release: Move the doc zips and tarballs to
``/srv/www.python.org/ftp/python/doc/X.Y.Z[rcA]``, creating the directory
if necessary, and adapt the "current" symlink in ``.../doc`` to point to
that directory. Note though that if you're releasing a maintenance
release for an older version, don't change the current link.
- If this is a **final** or rc release (even a maintenance release), also
unpack the HTML docs to ``/srv/docs.python.org/release/X.Y.Z[rcA]`` on
docs.nyc1.psf.io. Make sure the files are in group ``docs`` and are
group-writeable. If it is a release of a security-fix-only version,
tell the DE to build a version with the "version switcher"
and put it there.
- Let the DE check if the docs are built and work all right.
- If this is a **final** major release: Tell the DE to adapt redirects for
docs.python.org/X.Y in the nginx config for docs.python.org, update
the `docsbuild-scripts <https://github.com/python/docsbuild-scripts>`_
to point to the right stable/development branches, and to install it
and make the initial checkout.
The Doc's ``version_switcher.js`` script also needs to be
updated. In general, please don't touch things in the toplevel
``/srv/docs.python.org/`` directory unless you know what you're doing.
- Note both the documentation and downloads are behind a caching CDN. If
you change archives after downloading them through the website, you'll
need to purge the stale data in the CDN like this::
$ curl -X PURGE https://www.python.org/ftp/python/2.7.5/Python-2.7.5.tar.xz
You should always purge the cache of the directory listing as people
use that to browse the release files::
$ curl -X PURGE https://www.python.org/ftp/python/2.7.5/
- For the extra paranoid, do a completely clean test of the release.
This includes downloading the tarball from www.python.org.
Make sure the md5 checksums match. Then unpack the tarball,
and do a clean make test.::
$ make distclean
$ ./configure
$ make test
To ensure that the regression test suite passes. If not, you
screwed up somewhere!
- STOP STOP STOP STOP STOP STOP STOP STOP
- Have you gotten the green light from the WE?
- Have you gotten the green light from the ME?
- Have you gotten the green light from the DE?
If green, it's time to merge the release engineering branch back into
the main repo.
- If the branch is not yet in "security fixes only mode", temporarily
disable others' pushes to the branch in the main cpython
repo and bypass the normal status checks. Go to the
Settings -> Branches page:
https://github.com/python/cpython/settings/branches/
and choose the Edit button for the branch you are working on.
On the Branch Protection page, check the "Restrict who can push to
this branch" box and add yourself. Also, uncheck the "Include
administrators" box and save changes.
(This step isn't necessary for branches already in "security fixes mode".
However, the next step is!)
- While you're editing the settings for your branch, you'll also need to
uncheck "Require status checks to pass before merging". This temporarily
disables requiring CI status checks (Travis, AppVeyor, etc) be run and
passed before a revision may be pushed.
- Merge your release clone into the main development repo::
# Pristine copy of the upstream repo branch
$ git clone [email protected]:python/cpython.git merge
$ cd merge
# Checkout the correct branch:
# 1. For feature pre-releases up to and including a
# **new branch** release, i.e. alphas and first beta
# do a checkout of the master branch
$ git checkout master
# 2. Else, for all other releases, checkout the
# appropriate release branch.
$ git checkout X.Y
# Fetch the newly created and signed tag from your clone repo
$ git fetch --tags [email protected]:your-github-id/cpython.git vX.Y.ZaN
# Merge the temporary release engineering branch back into
$ git merge --no-squash vX.Y.ZaN
$ git commit -m 'Merge release engineering branch'
- If this is a **new branch** release, i.e. first beta,
now create the new release branch::
$ git checkout -b X.Y
Do any steps needed to setup the new release branch, including:
* In README.rst, change all references from ``master`` to
the new branch, in particular, GitHub repo URLs.
- For *all* releases, do the guided post-release steps with the
release script.::
$ .../release-tools/release.py --done X.Y.ZaN
- For a **final** or **release candidate 2+** release, you may need to
do some post-merge cleanup. Check the top-level ``README.rst``
and ``include/patchlevel.h`` files to ensure they now reflect
the desired post-release values for on-going development.
The patchlevel should be the release tag with a `+`.
Also, if you cherry-picked changes from the standard release
branch into the release engineering branch for this release,
you will now need to manual remove each blurb entry from
the ``Misc/NEWS.d/next`` directory that was cherry-picked
into the release you are working on since that blurb entry
is now captured in the merged x.y.z.rst fils for the new
release. Otherwise, the blurb entry will appear twice in
the `changelog.html` file, once under `Python next` and again
under `x.y.z`.
- Review and commit these changes::
$ git commit -m 'Post release updates'
- If this is a **new branch** release (e.g. the first beta),
update the master branch to start development for the
following feature release. When finished, the ``master``
branch will now build Python ``X.Y+1``.
- First, set master up to be the next release, i.e.X.Y+1.a0::
$ git checkout master
$ .../release-tools/release.py --bump 3.9.0a0
- Edit all version references in README.rst
- Move any historical "what's new" entries from ``Misc/NEWS`` to
``Misc/HISTORY``.
- Edit ``Doc/tutorial/interpreter.rst`` (2 references to '[Pp]ython3x',
one to 'Python 3.x', also make the date in the banner consistent).
- Edit ``Doc/tutorial/stdlib.rst`` and ``Doc/tutorial/stdlib2.rst``, which
have each one reference to '[Pp]ython3x'.
- Add a new ``whatsnew/3.x.rst`` file (with the comment near the top
and the toplevel sections copied from the previous file) and
add it to the toctree in ``whatsnew/index.rst``. But beware that
the initial ``whatsnew/3.x.rst`` checkin from previous releases
may be incorrect due to the initial midstream change to ``blurb``
that propagates from release to release! Help break the cycle: if
necessary make the following change::
- For full details, see the :source:`Misc/NEWS` file.
+ For full details, see the :ref:`changelog <changelog>`.
- Update the version number in ``configure.ac`` and re-run ``autoconf``.
- Make sure the ``SOURCE_URI`` in ``Doc/tools/extensions/pyspecific.py``
points to ``master``.
- Update the version numbers for the Windows builds in PC/ and
PCbuild/, which have references to python38.
NOTE, check with Steve Dower about this step, it is probably obsolete.::
$ find PC/ PCbuild/ -type f | xargs sed -i 's/python38/python39/g'
$ git mv -f PC/os2emx/python38.def PC/os2emx/python39.def
$ git mv -f PC/python38stub.def PC/python39stub.def
$ git mv -f PC/python38gen.py PC/python39gen.py
- Commit these changes to the master branch::
$ git status
$ git add ...
$ git commit -m 'Bump to 3.9.0a0'
- Do another ``git status`` in this directory.
You should not see any files. I.e. you better not have any uncommitted
changes in your working directory.
- Commit and push to the main repo.::
# Do a dry run first.
# For feature pre-releases prior to a **new branch** release,
# i.e. a feature alpha release:
$ git push --dry-run --tags [email protected]:python/cpython.git master
# If it looks OK, take the plunge. There's no going back!
$ git push --tags [email protected]:python/cpython.git master
# For a **new branch** release, i.e. first beta:
$ git push --dry-run --tags [email protected]:python/cpython.git X.Y
$ git push --dry-run --tags [email protected]:python/cpython.git master
# If it looks OK, take the plunge. There's no going back!
$ git push --tags [email protected]:python/cpython.git X.Y
$ git push --tags [email protected]:python/cpython.git master
# For all other releases:
$ git push --dry-run --tags [email protected]:python/cpython.git X.Y
# If it looks OK, take the plunge. There's no going back!
$ git push --tags [email protected]:python/cpython.git X.Y
- If this is a **new branch** release, add a ``Branch protection rule``
for the newly created branch (X.Y). Look at the values for the previous
release branch (X.Y-1) and use them as a template.
https://github.com/python/cpython/settings/branches/
Also, add a ``needs backport to X.Y`` label to the Github repo.
https://github.com/python/cpython/labels
- For all releases, if you made temporary changes to the permissions
for the branch on GitHub, undo those temporary changes now.
https://github.com/python/cpython/settings/branches/
A reminder of changes you may have made:
- Uncheck the "Restrict who can push to this branch". (Only necessary
if the branch is not in "security-fixes-only mode".)
- Check the "Include administrators" box. (Only necessary
if the branch is not in "security-fixes-only mode".)
- Check the "Require status checks to pass before merging" box. (Always needed.)
Save your changes.
Now it's time to twiddle the web site. None of this is automated by release.py
at the moment, sorry.
To do these steps, you must have the permission to edit the website. If you
don't have that, ask someone on [email protected] for the proper
permissions. (Or ask Ewa, who coordinated the effort for the new website
with RevSys.)
- Log in to https://www.python.org/admin .
- Create a new "release" for the release. Currently "Releases" are
sorted under "Downloads".
The easiest thing is probably to copy fields from an existing
Python release "page", editing as you go.
You can use `Markdown <https://daringfireball.net/projects/markdown/syntax>`_ or
`ReStructured Text <http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_
to describe your release. The former is less verbose, while the latter has nifty
integration for things like referencing PEPs.
Leave the "Release page" field on the form empty.
- "Save" the release.
- Populate the release with the downloadable files.
Your friend and mine, Georg Brandl, made a lovely tool
called "add-to-pydotorg.py". You can find it in the
"release" tree (next to "release.py"). You run the
tool on downloads.nyc1.psf.io, like this::
$ AUTH_INFO=<username>:<python.org-api-key> python add-to-pydotorg.py <version>
This walks the correct download directory for <version>,
looks for files marked with <version>, and populates
the "Release Files" for the correct "release" on the web
site with these files. Note that clears the "Release Files"
for the relevant version each time it's run. You may run
it from any directory you like, and you can run it as
many times as you like if the files happen to change.
Keep a copy in your home directory on dl-files and
keep it fresh.
If new types of files are added to the release
(e.g. the web-based installers or redistributable zip
files added to Python 3.5) someone will need to update
add-to-pydotorg.py so it recognizes these new files.
(It's best to update add-to-pydotorg.py when file types
are removed, too.)
- If this is a **final** release:
- Add the new version to the *Python Documentation by Version*
page `https://www.python.org/doc/versions/` and
remove the current version from any 'in development' section.
- For X.Y.Z, edit all the previous X.Y releases' page(s) to
point to the new release. This includes the content field of the
`Downloads -> Releases` entry for the release::
Note: Python x.y.m has been superseded by
`Python x.y.n </downloads/release/python-xyn/>`_.
And, for those releases having separate release page entries
(phasing these out?), update those pages as well,
e.g. `download/releases/x.y.z`::
Note: Python x.y.m has been superseded by
`Python x.y.n </download/releases/x.y.n/>`_.
- Update the "Current Pre-release Testing Versions web page".
There's a page that lists all the currently-in-testing versions
of Python:
https://www.python.org/download/pre-releases/
Every time you make a release, one way or another you'll
have to update this page:
- If you're releasing a version before *x.y.0*,
or *x.y.z release candidate N,*
you should add it to this page, removing the previous pre-release
of version *x.y* as needed.
- If you're releasing *x.y.z final*, you need to remove the pre-release
version from this page.
This is in the "Pages" category on the Django-based website, and finding
it through that UI is kind of a chore. However! If you're already logged
in to the admin interface (which, at this point, you should be), Django
will helpfully add a convenient "Edit this page" link to the top of the
page itself. So you can simply follow the link above, click on the
"Edit this page" link, and make your changes as needed. How convenient!
- If appropriate, update the "Python Documentation by Version" page:
https://www.python.org/doc/versions/
This lists all releases of Python by version number and links to their
static (not built daily) online documentation. There's a list at the
bottom of in-development versions, which is where all alphas/betas/RCs
should go. And yes you should be able to click on the link above then
press the shiny, exciting "Edit this page" button.
- Other steps (other update for new web site)??
- Write the announcement for the mailing lists. This is the
fuzzy bit because not much can be automated. You can use an earlier
announcement as a template, but edit it for content!
- Once the announcement is ready, send it to the following
addresses:
- Also post the announcement to
`The Python Insider blog <http://blog.python.org>`_.
To add a new entry, go to
`your Blogger home page, here. <https://www.blogger.com/home>`_
- Send email to python-committers informing them that the release has been
published and a reminder about any relevant changes in policy
based on the phase of the release cycle. In particular,
if this is a **new branch** release, remind everyone that the
new release branch exists and that they need to start
considering whether to backport to it when merging changes to
master.
- Update any release PEPs (e.g. 361) with the release dates.
- Update the tracker at https://bugs.python.org:
- Flip all the deferred blocker issues back to release blocker
for the next release.
- Add version X.Y+1 as when version X.Y enters alpha.
- Change non-doc RFEs to version X.Y+1 when version X.Y enters beta.
- Add ``X.Yregression`` keyword (https://bugs.python.org/keyword)
when version X.Y enters beta.
- Update 'behavior' issues from versions that your release make
unsupported to the next supported version.
- Review open issues, as this might find lurking showstopper bugs,
besides reminding people to fix the easy ones they forgot about.
- You can delete the remote release clone branch from your repo clone.
- If this is a **new branch** release, you will need to ensure various
pieces of the development infrastructure are updated for the new branch.
These include:
- Update the issue tracker for the new branch.
* Add the new version to the versions list (contact the tracker
admins?).
* Add a `regressions keyword <https://bugs.python.org/keyword>`_
for the release
- Update the devguide to reflect the new branches and versions.
- Create a PR to update the supported releases table on the
`downloads page <https://www.python.org/downloads/>`_.
(See https://github.com/python/pythondotorg/issues/1302)
- Ensure buildbots are defined for the new branch (contact zware).
- Ensure the daily docs build scripts are updated to include
the new branch (contact DE).
- Ensure the various Github bots are updated, as needed, for the
new branch, in particular, make sure backporting to the new
branch works (contact core-workflow team)
https://github.com/python/core-workflow/issues
- Review the most recent commit history for the master and new release
branches to identify and backport any merges that might have been made
to the master branch during the release engineering phase and that
should be in the release branch.
- Verify that CI is working for new PRs for the master and new release
branches and that the release branch is properly protected (no direct
pushes, etc).
- Verify that the on-line docs are building properly (this may take up to
24 hours for a complete build on the web site).
What Next?
==========
* Verify! Pretend you're a user: download the files from python.org, and
make Python from it. This step is too easy to overlook, and on several
occasions we've had useless release files. Once a general server problem
caused mysterious corruption of all files; once the source tarball got
built incorrectly; more than once the file upload process on SF truncated
files; and so on.
* Rejoice. Drink. Be Merry. Write a PEP like this one. Or be
like unto Guido and take A Vacation.
You've just made a Python release!
Moving to End-of-life
=====================
Under current policy, a release branch normally reaches end-of-life status
5 years after its initial release. The policy is discussed in more detail
in `the Python Developer's Guide <https://devguide.python.org/devcycle/>`_.
When end-of-life is reached, there are a number of tasks that need to be
performed either directly by you as release manager or by ensuring someone
else does them. Some of those tasks include:
- Optionally making a final release to publish any remaining unreleased
changes.
- Check the `docsbuild server script
<https://github.com/python/docsbuild-scripts/blob/master/build_docs.py>`_
to ensure that the docs set for the branch is no longer being built.
If still present, ask the DE to remove this branch from the BRANCHES list.
- On the docs download server (docs.nyc1.psf.io), ensure the top-level
symlink points to the upload of unpacked html docs from final release::
cd /srv/docs.python.org
ls -l 3.3
lrwxrwxrwx 1 nad docs 13 Sep 6 21:38 3.3 -> release/3.3.7
- In each unretired cpython branch, remove any remaining references to the
retired branch in the Doc version switcher and side bar templates
(file names may vary between branches) [DE]::
Doc/tools/static/version_switch.js
Doc/tools/templates/indexsidebar.html
- Freeze the state of the release branch by creating a tag of its current HEAD
and then deleting the branch from the cpython repo. The current HEAD should
be at or beyond the final security release for the branch::
git fetch upstream
git tag --sign -m 'Final head of the former 3.3 branch' 3.3 upstream/3.3
git push upstream refs/tags/3.3
- If all looks good, delete the branch. This may require the assistance of
someone with repo administrator privileges::
git push upstream --delete 3.3 # or perform from Github Settings page
- Add retired notice to each release page on python.org for the retired branch.
For example:
https://www.python.org/downloads/release/python-337/
https://www.python.org/downloads/release/python-336/
- In the developer's guide, add the branch to the recent end-of-life branches
list (https://devguide.python.org/devcycle/#end-of-life-branches) and update
or remove references to the branch elsewhere in the devguide.
- If necessary, create a PR to update the supported releases table on the
`downloads page <https://www.python.org/downloads/>`_.
(See https://github.com/python/pythondotorg/issues/1302)
- Retire the release from the bugs.python.org issue tracker. Tasks include:
* remove branch from tracker list of versions
* remove any release-release keywords (3.3regressions)
* review and dispose of open issues marked for this branch
Note, with the likely future migration of bug tracking from the current
Roundup bugs.python.org to Github issues and with the impending end-of-life
of Python 2.7, it probably makes sense to avoid unnecessary churn for
currently and about-to-be retired 3.x branches by deferring any major
wholesale changes to existing issues until the migration process is
clarified.
- Announce the branch retirement in the usual places:
* mailing lists (python-committers, python-dev, python-list, python-announcements)
* discuss.python.org and Zulip
* Python Dev blog
- Enjoy your retirement and bask in the glow of a job well done!
Windows Notes
=============
NOTE, have Steve Dower review; probably obsolete.
Windows has a MSI installer, various flavors of Windows have
"special limitations", and the Windows installer also packs
precompiled "foreign" binaries (Tcl/Tk, expat, etc). So Windows