3
3
How to update to a new Python version
4
4
=====================================
5
5
6
- We are currently in branch 3.10 , and we want to update the strings from 3.11 .
6
+ We are currently in branch 3.11 , and we want to update the strings from 3.12 .
7
7
8
+ #. Make sure you are in a clean state of the branch 3.11
8
9
9
- #. Make sure you are in a clean state of the branch 3.10
10
-
11
- #. Create a new branch called ``3.11 ``
10
+ #. Create a new branch called ``3.12 ``
12
11
13
12
#. Initialize the submodules::
14
13
15
14
git submodule init
16
15
git submodule update
17
16
18
- #. Fetch the `latest commit of 3.11 branch <https://github.com/python/cpython/commit/b3cafb60afeb2300002af9982d43703435b8302d >`_::
17
+ #. Fetch the `latest commit of 3.12 branch <https://github.com/python/cpython/commit/0fb18b02c8ad56299d6a2910be0bab8ad601ef24 >`_::
19
18
20
19
cd cpython/
21
- git fetch --depth 1 origin b3cafb60afeb2300002af9982d43703435b8302d
20
+ git fetch --depth 1 origin 0fb18b02c8ad56299d6a2910be0bab8ad601ef24
22
21
23
22
.. note:: you could also base the hash on the 'git tag' from the desired
24
- version: ``git checkout tags/v3.11 .0 -b 3.11 `` considering that
25
- ``3.11 `` doesn't exist locally.
23
+ version: ``git checkout tags/v3.12 .0 -b 3.12 `` considering that
24
+ ``3.12 `` doesn't exist locally.
26
25
27
26
#. Checkout that commit locally::
28
27
29
- git checkout b3cafb60afeb2300002af9982d43703435b8302d
28
+ git checkout 0fb18b02c8ad56299d6a2910be0bab8ad601ef24
30
29
31
30
#. Update the branch on the ``Makefile `` and check the ``requirements.txt `` from
32
- the cpython repository , to see if upgrades on the modules like sphinx is
31
+ `` ./ cpython/Doc `` directory , to see if upgrades on the modules like sphinx is
33
32
needed.
34
33
35
34
#. Commit the update of the submodule change::
@@ -40,10 +39,16 @@ We are currently in branch 3.10, and we want to update the strings from 3.11.
40
39
.. note:: This is important, so the later ``make build`` step will not reset
41
40
the cpython submodule to the previous hash on the old branch.
42
41
42
+ #. Create a virtual environment and install the dependencies of the project::
43
+
44
+ python -m venv env
45
+ source env/bin/activate # Windows: env\Scripts\activate.bat
46
+ pip install -r requirements.txt
47
+
43
48
#. Verify that the docs build with the new versions you changed from
44
49
``requirements.txt `` mainly the sphinx version::
45
50
46
- make html
51
+ make build
47
52
48
53
.. note ::
49
54
@@ -54,28 +59,21 @@ We are currently in branch 3.10, and we want to update the strings from 3.11.
54
59
55
60
#. Clean possible garbage (form previous builds)::
56
61
57
- rm -rf _build ../python-docs-es-pot cpython/Doc/CONTRIBUTING.rst cpython/Doc/upgrade-python-version.rst
62
+ rm -rf _build ../python-docs-es-pot cpython/Doc/CONTRIBUTING.rst cpython/Doc/upgrade-python-version.rst reviewers-guide.rst
58
63
59
64
.. note::
60
65
61
66
The 'python-docs-es-pot' is a temporary directory that is created
62
67
in the next step. It's included here because it might be a leftover
63
68
from previous attempts on your machine.
64
69
65
- #. Create a virtual environment and install the dependencies of the project::
66
-
67
- python -m venv env
68
- source env/bin/activate # Windows: env\Scripts\activate.bat
69
- pip install -r requirements.txt
70
-
71
-
72
70
#. Create the .po files from the new source code. This will generate all the .po files for version 3.11::
73
71
74
72
SPHINX_GETTEXT=True sphinx-build -j auto -b gettext -d _build/doctrees . ../python-docs-es-pot
75
73
76
74
.. note::
77
75
78
- In ``../python-docs-es-pot`` directory, we will have the new .pot files with new strings from 3.11 branch.
76
+ In ``../python-docs-es-pot`` directory, we will have the new .pot files with new strings from 3.12 branch.
79
77
All these strings will be *untranslated* at this point.
80
78
81
79
#. Now, we update our translated files form the source language (English) with new strings::
@@ -85,8 +83,8 @@ We are currently in branch 3.10, and we want to update the strings from 3.11.
85
83
#. At this point, all the ``.po `` files will have a different comment on each translation phrase,
86
84
for example::
87
85
88
- -#: ../python-docs-es/cpython/Doc/whatsnew/3.11 .rst:3
89
- +#: ../Doc/whatsnew/3.11 .rst:3
86
+ -#: ../python-docs-es/cpython/Doc/whatsnew/3.12 .rst:3
87
+ +#: ../Doc/whatsnew/3.12 .rst:3
90
88
91
89
As you can see, it added the path of the local repository, but you can
92
90
remove it from it with this regular expression::
@@ -115,10 +113,16 @@ We are currently in branch 3.10, and we want to update the strings from 3.11.
115
113
of the new branch is done. So prepare a cup of any hot beverage
116
114
and fix them.
117
115
116
+ **Once the process is completely and you are happy with the results,
117
+ there are a few extra steps to finish the process **
118
118
119
- Once the process is completely and you are happy with the results,
120
- there are a few extra steps to finish the process::
119
+ #. Upgrade GitHub Actions to use Python 3.12, by updating Python version to 3.12 in the ``.github/workflows/main.yml `` file.
121
120
122
- #. Upgrade GitHub Actions to use Python 3.11
121
+ #. Update the *Read the Docs * project to use 3.12 in the build and also as default branch/version.
122
+
123
+ #. Commit all the newly created files locally.
124
+
125
+ #. Create branch 3.12 in the repository in order to merge changes there.
126
+
127
+ #. Inside the github project settings, set 3.12 branch as the default branch for the repository.
123
128
124
- #. Update Read the Docs project to use 3.11 in the build and also as default branch/version
0 commit comments