33How to update to a new Python version
44=====================================
55
6- We are currently in branch 3.11 , and we want to update the strings from 3.12 .
6+ We are currently in branch 3.12 , and we want to update the strings from 3.13 .
77
8- #. Make sure you are in a clean state of the branch 3.11
8+ #. Make sure you are in a clean state of the branch 3.12
99
10- #. Create a new branch called ``3.12 ``
10+ #. Create a new branch called ``3.13 ``
1111
1212#. Initialize the submodules::
1313
1414 git submodule init
1515 git submodule update
1616
17- #. Fetch the `latest commit of 3.12 branch <https://github.com/python/cpython/commit/0fb18b02c8ad56299d6a2910be0bab8ad601ef24 >`_::
17+ #. Fetch the `latest release tag of 3.12 <https://github.com/python/cpython/releases/tag/v3.13.0 >`_::
1818
1919 cd cpython/
20- git fetch --depth 1 origin 0fb18b02c8ad56299d6a2910be0bab8ad601ef24
21-
22- .. note:: you could also base the hash on the 'git tag' from the desired
23- version: ``git checkout tags/v3.12.0 -b 3.12`` considering that
24- ``3.12`` doesn't exist locally.
20+ git fetch --depth 1 origin tags/v3.13.0
2521
2622#. Checkout that commit locally::
2723
28- git checkout 0fb18b02c8ad56299d6a2910be0bab8ad601ef24
24+ git checkout tags/v3.13.0 -b 3.13.0
2925
3026#. Update the branch on the ``Makefile `` and check the ``requirements.txt `` from
3127 ``./cpython/Doc `` directory, to see if upgrades on the modules like sphinx is
@@ -52,14 +48,17 @@ We are currently in branch 3.11, and we want to update the strings from 3.12.
5248
5349 .. note ::
5450
51+ You can also run `make build -j ` to use more than 1 core (but keep in mind
52+ this is not always faster).
53+
5554 It may fail the build because there may be files
5655 that don't exist anymore in the new branch.
5756 If that's the case, just continue with the steps
5857 and verify the build later.
5958
6059#. Clean possible garbage (form previous builds)::
6160
62- rm -rf _build .. /python-docs-es-pot cpython/Doc/CONTRIBUTING.rst cpython/Doc/upgrade-python-version.rst reviewers-guide.rst
61+ rm -rf _build cpython /python-docs-es-pot cpython/Doc/CONTRIBUTING.rst cpython/Doc/upgrade-python-version.rst reviewers-guide.rst
6362
6463 .. note::
6564
@@ -69,32 +68,16 @@ We are currently in branch 3.11, and we want to update the strings from 3.12.
6968
7069#. Create the .po files from the new source code. This will generate all the .po files for version 3.11::
7170
72- SPHINX_GETTEXT=True sphinx-build -j auto -b gettext -d _build/doctrees . .. /python-docs-es-pot
71+ SPHINX_GETTEXT=True sphinx-build -j auto -b gettext -d _build/doctrees . cpython /python-docs-es-pot
7372
7473 .. note::
7574
76- In ``.. /python-docs-es-pot`` directory, we will have the new .pot files with new strings from 3.12 branch.
75+ In ``cpython /python-docs-es-pot`` directory, we will have the new .pot files with new strings from 3.13 branch.
7776 All these strings will be *untranslated* at this point.
7877
7978#. Now, we update our translated files form the source language (English) with new strings::
8079
81- sphinx-intl update --language es --pot-dir ../python-docs-es-pot --locale-dir cpython/locales/
82-
83- #. At this point, all the ``.po `` files will have a different comment on each translation phrase,
84- for example::
85-
86- -#: ../python-docs-es/cpython/Doc/whatsnew/3.12.rst:3
87- +#: ../Doc/whatsnew/3.12.rst:3
88-
89- As you can see, it added the path of the local repository, but you can
90- remove it from it with this regular expression::
91-
92- sed -i **/*.po -e "s|python-docs-es/cpython/||g"
93-
94- .. note ::
95-
96- If you have your local repository cloned with a different name,
97- please make sure to adapt the expression.
80+ sphinx-intl update --language es --pot-dir cpython/python-docs-es-pot --locale-dir cpython/locales/
9881
9982#. Pass ``powrap `` to make the column widths consistent::
10083
@@ -116,13 +99,14 @@ We are currently in branch 3.11, and we want to update the strings from 3.12.
11699**Once the process is completely and you are happy with the results,
117100there are a few extra steps to finish the process **
118101
119- #. Upgrade GitHub Actions to use Python 3.12 , by updating Python version to 3.12 in the ``.github/workflows/main.yml `` file.
102+ #. Upgrade GitHub Actions to use Python 3.13 , by updating Python version to 3.13 in the ``.github/workflows/main.yml `` file.
120103
121- #. Update the *Read the Docs * project to use 3.12 in the build and also as default branch/version.
104+ #. Update the *Read the Docs * project to use 3.13 in the build and also as default branch/version.
122105
123106#. Commit all the newly created files locally.
124107
125- #. Create branch 3.12 in the repository in order to merge changes there.
108+ #. Create branch 3.13 in the repository in order to merge changes there.
126109
127- #. Inside the github project settings, set 3.12 branch as the default branch for the repository.
110+ #. Inside the github project settings, set 3.13 branch as the default branch for the repository.
128111
112+ #. Create GitHub issues with [the script](../scripts/create_issue.py)
0 commit comments