Skip to content

Update instructions on upgrading to Python 3.12 #2379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions .overrides/upgrade-python-version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,32 @@
How to update to a new Python version
=====================================

We are currently in branch 3.10, and we want to update the strings from 3.11.
We are currently in branch 3.11, and we want to update the strings from 3.12.

#. Make sure you are in a clean state of the branch 3.11

#. Make sure you are in a clean state of the branch 3.10

#. Create a new branch called ``3.11``
#. Create a new branch called ``3.12``

#. Initialize the submodules::

git submodule init
git submodule update

#. Fetch the `latest commit of 3.11 branch <https://github.com/python/cpython/commit/b3cafb60afeb2300002af9982d43703435b8302d>`_::
#. Fetch the `latest commit of 3.12 branch <https://github.com/python/cpython/commit/0fb18b02c8ad56299d6a2910be0bab8ad601ef24>`_::

cd cpython/
git fetch --depth 1 origin b3cafb60afeb2300002af9982d43703435b8302d
git fetch --depth 1 origin 0fb18b02c8ad56299d6a2910be0bab8ad601ef24

.. note:: you could also base the hash on the 'git tag' from the desired
version: ``git checkout tags/v3.11.0 -b 3.11`` considering that
``3.11`` doesn't exist locally.
version: ``git checkout tags/v3.12.0 -b 3.12`` considering that
``3.12`` doesn't exist locally.

#. Checkout that commit locally::

git checkout b3cafb60afeb2300002af9982d43703435b8302d
git checkout 0fb18b02c8ad56299d6a2910be0bab8ad601ef24

#. Update the branch on the ``Makefile`` and check the ``requirements.txt`` from
the cpython repository, to see if upgrades on the modules like sphinx is
``./cpython/Doc`` directory, to see if upgrades on the modules like sphinx is
needed.

#. Commit the update of the submodule change::
Expand All @@ -43,7 +42,7 @@ We are currently in branch 3.10, and we want to update the strings from 3.11.
#. Verify that the docs build with the new versions you changed from
``requirements.txt`` mainly the sphinx version::

make html
make build

.. note::

Expand Down Expand Up @@ -75,7 +74,7 @@ We are currently in branch 3.10, and we want to update the strings from 3.11.

.. note::

In ``../python-docs-es-pot`` directory, we will have the new .pot files with new strings from 3.11 branch.
In ``../python-docs-es-pot`` directory, we will have the new .pot files with new strings from 3.12 branch.
All these strings will be *untranslated* at this point.

#. Now, we update our translated files form the source language (English) with new strings::
Expand All @@ -85,8 +84,8 @@ We are currently in branch 3.10, and we want to update the strings from 3.11.
#. At this point, all the ``.po`` files will have a different comment on each translation phrase,
for example::

-#: ../python-docs-es/cpython/Doc/whatsnew/3.11.rst:3
+#: ../Doc/whatsnew/3.11.rst:3
-#: ../python-docs-es/cpython/Doc/whatsnew/3.12.rst:3
+#: ../Doc/whatsnew/3.12.rst:3

As you can see, it added the path of the local repository, but you can
remove it from it with this regular expression::
Expand Down Expand Up @@ -115,10 +114,9 @@ We are currently in branch 3.10, and we want to update the strings from 3.11.
of the new branch is done. So prepare a cup of any hot beverage
and fix them.


Once the process is completely and you are happy with the results,
there are a few extra steps to finish the process::

#. Upgrade GitHub Actions to use Python 3.11
#. Upgrade GitHub Actions to use Python 3.12

#. Update Read the Docs project to use 3.11 in the build and also as default branch/version
#. Update Read the Docs project to use 3.12 in the build and also as default branch/version