File: release_process.rst

package info (click to toggle)
ipython 5.8.0-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,600 kB
  • sloc: python: 34,423; makefile: 174; sh: 143
file content (239 lines) | stat: -rw-r--r-- 7,928 bytes parent folder | download
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
.. _release_process:

=======================
IPython release process
=======================

This document contains the process that is used to create an IPython release.

Conveniently, the ``release`` script in the ``tools`` directory of the ``IPython``
repository automates most of the release process. This document serves as a
handy reminder and checklist for the release manager. 

During the release process, you might need the extra following dependencies:

 - ``keyring`` to access your GitHub authentication tokens
 - ``graphviz`` to generate some graphs in the documentation
 
Make sure you have all the required dependencies to run the tests as well.
 

1. Set Environment variables
----------------------------

Set environment variables to document previous release tag, current
release milestone, current release version, and git tag.

These variables may be used later to copy/paste as answers to the script
questions instead of typing the appropriate command when the time comes. These
variables are not used by the scripts directly; therefore, there is no need to
``export`` them. The format for bash is as follows, but note that these values
are just an example valid only for the 5.0 release; you'll need to update them
for the release you are actually making::

    PREV_RELEASE=4.2.1
    MILESTONE=5.0
    VERSION=5.0.0
    BRANCH=master


2. Create GitHub stats and finish release note
----------------------------------------------

.. note::

    This step is optional if making a Beta or RC release.

.. note::

    Before generating the GitHub stats, verify that all closed issues and pull
    requests have `appropriate milestones
    <https://github.com/ipython/ipython/wiki/Dev:-GitHub-workflow#milestones>`_.
    `This search
    <https://github.com/ipython/ipython/issues?q=is%3Aclosed+no%3Amilestone+is%3Aissue>`_
    should return no results before creating the GitHub stats.

If a major release:

    - merge any pull request notes into what's new::

          python tools/update_whatsnew.py

    - update ``docs/source/whatsnew/development.rst``, to ensure it covers
      the major release features

    - move the contents of ``development.rst`` to ``versionX.rst`` where ``X`` is
      the numerical release version

    - generate summary of GitHub contributions, which can be done with::

          python tools/github_stats.py --milestone $MILESTONE > stats.rst

      which may need some manual cleanup of ``stats.rst``. Add the cleaned
      ``stats.rst`` results to ``docs/source/whatsnew/github-stats-X.rst``
      where ``X`` is the numerical release version (don't forget to add it to
      the git repo as well). If creating a major release, make a new
      ``github-stats-X.rst`` file; if creating a minor release, the content
      from ``stats.rst`` may simply be added to the top of an existing
      ``github-stats-X.rst`` file.  Finally, edit
      ``docs/source/whatsnew/index.rst`` to list the new ``github-stats-X``
      file you just created and remove temporarily the first entry called
      ``development`` (you'll need to add it back after release).

      Make sure that the stats file has a header or it won't be rendered in
      the final documentation. 

To find duplicates and update `.mailmap`, use::

    git log --format="%aN <%aE>" $PREV_RELEASE... | sort -u -f

3. Make sure the repository is clean
------------------------------------

of any file that could be problematic.
   Remove all non-tracked files with:

   .. code::

       git clean -xfdi

   This will ask for confirmation before removing all untracked files. Make
   sure the ``dist/`` folder is clean to avoid any stale builds from
   previous build attempts.


4. Update the release version number
------------------------------------

Edit ``IPython/core/release.py`` to have the current version.

in particular, update version number and ``_version_extra`` content in
``IPython/core/release.py``.

Step 5 will validate your changes automatically, but you might still want to
make sure the version number matches pep440.

In particular, ``rc`` and ``beta`` are not separated by ``.`` or the ``sdist``
and ``bdist`` will appear as different releases. For example, a valid version
number for a release candidate (rc) release is: ``1.3rc1``. Notice that there
is no separator between the '3' and the 'r'. Check the environment variable
``$VERSION`` as well.

You will likely just have to modify/comment/uncomment one of the lines setting
``_version_extra``


5. Run the `tools/build_release` script
---------------------------------------

Running ``tools/build_release`` does all the file checking and building that
the real release script will do. This makes test installations, checks that
the build procedure runs OK, and tests other steps in the release process.

The ``build_release`` script will in particular verify that the version number
match PEP 440, in order to avoid surprise at the time of build upload.

We encourage creating a test build of the docs as well.

6. Create and push the new tag
------------------------------

Commit the changes to release.py::

    git commit -am "release $VERSION"
    git push origin $BRANCH

Create and push the tag::

    git tag -am "release $VERSION" "$VERSION"
    git push origin --tags

Update release.py back to ``x.y-dev`` or ``x.y-maint``, and re-add the
``development`` entry in ``docs/source/whatsnew/index.rst`` and push::

    git commit -am "back to development"
    git push origin $BRANCH

7. Get a fresh clone
--------------------

Get a fresh clone of the tag for building the release::

    cd /tmp
    git clone --depth 1 https://github.com/ipython/ipython.git -b "$VERSION"
    cd ipython

.. note::

    You can also cleanup the current working repository with ``git clean -xfdi``

8. Run the release script
-------------------------

Run the ``release`` script, this step requires having a current wheel, Python
>=3.4 and Python 2.7.::

    ./tools/release

This makes the tarballs, zipfiles, and wheels, and put them under the ``dist/``
folder. Be sure to test the ``wheels``  and the ``sdist`` locally before
uploading them to PyPI. We do not use an universal wheel as each wheel
installs an ``ipython2`` or ``ipython3`` script, depending on the version of
Python it is built for. Using an universal wheel would prevent this.

Use the following to actually upload the result of the build::

    ./tools/release upload

It should posts them to ``archive.ipython.org`` and to PyPI.

PyPI/Warehouse will automatically hide previous releases. If you are uploading
a non-stable version, make sure to log-in to PyPI and un-hide previous version.


9. Draft a short release announcement
-------------------------------------

The announcement should include:

- release highlights
- a link to the html version of the *What's new* section of the documentation
- a link to upgrade or installation tips (if necessary)

Post the announcement to the mailing list and or blog, and link from Twitter.

.. note::

    If you are doing a RC or Beta, you can likely skip the next steps.

10. Update milestones on GitHub
-------------------------------

These steps will bring milestones up to date:

- close the just released milestone
- open a new milestone for the next release (x, y+1), if the milestone doesn't
  exist already

11. Update the IPython website
------------------------------

The IPython website should document the new release:

- add release announcement (news, announcements)
- update current version and download links
- update links on the documentation page (especially if a major release)

12. Update readthedocs
----------------------

Make sure to update readthedocs and set the latest tag as stable, as well as
checking that previous release is still building under its own tag. 


13. Celebrate!
--------------

Celebrate the release and please thank the contributors for their work. Great
job!