@@ -8,43 +8,59 @@ We are currently in branch 3.10, and we want to update the strings from 3.11.
8
8
9
9
#. Make sure you are in a clean state of the branch 3.10
10
10
11
- #. Create a new branch
11
+ #. Create a new branch called `` 3.11 ``
12
12
13
- #. Fetch the `latest commit of 3.10 branch <https://github.com/python/cpython/commit/69b6b56d857440183e227ca0b10c84bca4239985 >`_::
13
+ #. Initialize the submodules::
14
+
15
+ git submodule init
16
+ git submodule update
17
+
18
+ #. Fetch the `latest commit of 3.11 branch <https://github.com/python/cpython/commit/b3cafb60afeb2300002af9982d43703435b8302d >`_::
14
19
15
20
cd cpython/
16
- git fetch --depth 1 origin 69b6b56d857440183e227ca0b10c84bca4239985
21
+ git fetch --depth 1 origin b3cafb60afeb2300002af9982d43703435b8302d
17
22
18
23
.. note:: you could also base the hash on the 'git tag' from the desired
19
- version: `git checkout tags/v3.11.0 -b 3.11` considering that
20
- `3.11` doesn't exist locally.
24
+ version: `` git checkout tags/v3.11.0 -b 3.11` ` considering that
25
+ `` 3.11` ` doesn't exist locally.
21
26
22
27
#. Checkout that commit locally::
23
28
24
- git checkout 69b6b56d857440183e227ca0b10c84bca4239985
29
+ git checkout b3cafb60afeb2300002af9982d43703435b8302d
25
30
26
- #. Update the branch on the `Makefile ` and check the `requirements.txt ` from
31
+ #. Update the branch on the `` Makefile `` and check the `` requirements.txt ` ` from
27
32
the cpython repository, to see if upgrades on the modules like sphinx is
28
33
needed.
29
34
30
- #. Verify that the docs build with the new versions you changed from
31
- `requirements.txt ` mainly the sphinx version.
32
-
33
35
#. Commit the update of the submodule change::
34
36
35
37
git add cpython
36
38
git commit -m "Update the cpython submodule"
37
39
38
- .. note:: This is important, so the later `make build` step will not reset
40
+ .. note:: This is important, so the later `` make build` ` step will not reset
39
41
the cpython submodule to the previous hash on the old branch.
40
42
43
+ #. Verify that the docs build with the new versions you changed from
44
+ ``requirements.txt `` mainly the sphinx version::
45
+
46
+ make html
47
+
48
+ .. note ::
49
+
50
+ It may fail the build because there may be files
51
+ that don't exist anymore in the new branch.
52
+ If that's the case, just continue with the steps
53
+ and verify the build later.
54
+
41
55
#. Clean possible garbage (form previous builds)::
42
56
43
57
rm -rf _build ../python-docs-es-pot cpython/Doc/CONTRIBUTING.rst cpython/Doc/upgrade-python-version.rst
44
58
45
- .. note: the 'python-docs-es-pot' is a temporary directory that is created
46
- in the next step. It's included here because it might be a leftover
47
- from previous attempts on your machine.
59
+ .. note::
60
+
61
+ The 'python-docs-es-pot' is a temporary directory that is created
62
+ in the next step. It's included here because it might be a leftover
63
+ from previous attempts on your machine.
48
64
49
65
#. Create a virtual environment and install the dependencies of the project::
50
66
@@ -53,41 +69,56 @@ We are currently in branch 3.10, and we want to update the strings from 3.11.
53
69
pip install -r requirements.txt
54
70
55
71
56
- #. Create the .po files from the new source code. This will generate all the .po files for version 3.8 ::
72
+ #. Create the .po files from the new source code. This will generate all the .po files for version 3.11 ::
57
73
58
74
SPHINX_GETTEXT=True sphinx-build -j auto -b gettext -d _build/doctrees . ../python-docs-es-pot
59
75
60
76
.. note::
61
77
62
- In `../python-docs-es-pot` directory, we will have the new .pot files with new strings from 3.11 branch.
78
+ In `` ../python-docs-es-pot` ` directory, we will have the new .pot files with new strings from 3.11 branch.
63
79
All these strings will be *untranslated* at this point.
64
80
65
81
#. Now, we update our translated files form the source language (English) with new strings::
66
82
67
83
sphinx-intl update --language es --pot-dir ../python-docs-es-pot --locale-dir cpython/locales/
68
84
69
- #. At this point, all the `.po ` files will have a different comment on each translation phrase,
85
+ #. At this point, all the `` .po ` ` files will have a different comment on each translation phrase,
70
86
for example::
71
87
72
- -#: ../Doc/whatsnew/3.9 .rst:3
73
- +#: ../python-docs-es/cpython/ Doc/whatsnew/3.9 .rst:3
88
+ -#: ../python-docs-es/cpython/ Doc/whatsnew/3.11 .rst:3
89
+ +#: ../Doc/whatsnew/3.11 .rst:3
74
90
75
91
As you can see, it added the path of the local repository, but you can
76
92
remove it from it with this regular expression::
77
93
78
94
sed -i **/*.po -e "s|python-docs-es/cpython/||g"
79
95
80
- ..note:: if you have your local repository cloned with a different name,
81
- please make sure to adapt the expression.
96
+ .. note ::
97
+
98
+ If you have your local repository cloned with a different name,
99
+ please make sure to adapt the expression.
82
100
83
- #. Pass `powrap ` to make the column widths consistent::
101
+ #. Pass `` powrap ` ` to make the column widths consistent::
84
102
85
103
powrap --modified
86
104
105
+ .. note::
106
+
107
+ Make sure you have installed ``gettext``,
108
+ since it's required for the previous command.
109
+
87
110
#. Prepare for fireworks! Now it's time for an initial build::
88
111
89
112
make build
90
113
91
114
you will find many warnings that needs to be fixed before the push
92
115
of the new branch is done. So prepare a cup of any hot beverage
93
116
and fix them.
117
+
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::
121
+
122
+ #. Upgrade GitHub Actions to use Python 3.11
123
+
124
+ #. Update Read the Docs project to use 3.11 in the build and also as default branch/version
0 commit comments