Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH news] 2022-06-13-python3-10: new entry
Date: Fri, 10 Jun 2022 08:09:52
Message-Id: 20220610080937.568647-1-mgorny@gentoo.org
1 Add a news item for the switch to Python 3.10. The text is roughly
2 the same as for 3.9, with some minor grammar fixes.
3
4 Signed-off-by: Michał Górny <mgorny@g.o>
5 ---
6 .../2022-06-13-python3-10.en.txt | 120 ++++++++++++++++++
7 1 file changed, 120 insertions(+)
8 create mode 100644 2022-06-13-python3-10/2022-06-13-python3-10.en.txt
9
10 diff --git a/2022-06-13-python3-10/2022-06-13-python3-10.en.txt b/2022-06-13-python3-10/2022-06-13-python3-10.en.txt
11 new file mode 100644
12 index 0000000..305646d
13 --- /dev/null
14 +++ b/2022-06-13-python3-10/2022-06-13-python3-10.en.txt
15 @@ -0,0 +1,120 @@
16 +Title: Python 3.10 to become the default on 2021-07-01
17 +Author: Michał Górny <mgorny@g.o>
18 +Posted: 2022-06-13
19 +Revision: 1
20 +News-Item-Format: 2.0
21 +Display-If-Installed: dev-lang/python:3.8
22 +Display-If-Installed: dev-lang/python:3.9
23 +
24 +We are planning to switch the default Python target of Gentoo systems
25 +on 2022-07-01, from Python 3.9 to Python 3.10. If you have not changed
26 +the values of PYTHON_TARGETS or PYTHON_SINGLE_TARGET, the change will
27 +have immediate effect on your system and the package manager will try
28 +to switch automatically on the next upgrade following the change.
29 +
30 +If you did change the values, prefer a safer approach or have problems
31 +with the update, read on.
32 +
33 +Please note that the default upgrade method switches packages to the new
34 +Python versions as they are rebuilt. This means that all interdependent
35 +packages have to support the new version for the upgrade to proceed,
36 +and that some programs may temporarily fail to find their dependencies
37 +throughout the upgrade (although programs that are already started
38 +are unlikely to be affected).
39 +
40 +
41 +If you have PYTHON_TARGETS or PYTHON_SINGLE_TARGET declared
42 +in make.conf, please remove these declarations as they will interfere
43 +with the package.use samples provided below. Using make.conf for Python
44 +targets is discouraged as it prevents package defaults from applying
45 +when necessary. This news item assumes using /etc/portage/package.use
46 +or your package manager's equivalent file for configuration.
47 +
48 +
49 +At this point, you have a few configuration options to choose from:
50 +
51 +1. If you wish Python upgrades to apply automatically, you can remove
52 + PYTHON_TARGETS and PYTHON_SINGLE_TARGET declarations. When
53 + the defaults change, your package manager should handle the upgrade
54 + automatically. However, you may still need to run the update
55 + commands if any problems arise.
56 +
57 +2. If you wish to defer the upgrade for the time being, you can
58 + explicitly set the old values in package.use.
59 +
60 +3. If you wish to force the upgrade earlier, you can explicitly set
61 + the new values and run the upgrade commands.
62 +
63 +4. If you wish to use a safer approach (i.e. less likely to temporarily
64 + break packages during the upgrade), you can perform a multi-step
65 + upgrade as outlined below.
66 +
67 +5. Finally, you can use an arbitrary combination of PYTHON_TARGETS
68 + and PYTHON_SINGLE_TARGET.
69 +
70 +
71 +Deferring the upgrade
72 +=====================
73 +To defer the upgrade, explicitly set the old targets:
74 +
75 + */* PYTHON_TARGETS: -* python3_9
76 + */* PYTHON_SINGLE_TARGET: -* python3_9
77 +
78 +This will enforce Python 3.9 and block any future updates. However,
79 +please note that this is only a temporary solution and you will
80 +eventually need to perform the migration.
81 +
82 +
83 +Forcing the upgrade
84 +===================
85 +To force the upgrade earlier, explicitly select the Python 3.10 targets:
86 +
87 + */* PYTHON_TARGETS: -* python3_10
88 + */* PYTHON_SINGLE_TARGET: -* python3_10
89 +
90 +However, it is important to remember to remove this after the defaults
91 +change, as it will interfere with the automatic switch to the next
92 +Python version in the future.
93 +
94 +
95 +Safer upgrade procedure
96 +=======================
97 +A safer approach is to add Python 3.10 support to your system first,
98 +and only then remove Python 3.9. However, note that this involves two
99 +rebuilds of all the affected packages, so it will take noticeably
100 +longer.
101 +
102 +First, enable both Python 3.9 and Python 3.10, and then run the upgrade
103 +commands:
104 +
105 + */* PYTHON_TARGETS: -* python3_9 python3_10
106 + */* PYTHON_SINGLE_TARGET: -* python3_9
107 +
108 +Then switch PYTHON_SINGLE_TARGET and run the second batch of upgrades:
109 +
110 + */* PYTHON_TARGETS: -* python3_9 python3_10
111 + */* PYTHON_SINGLE_TARGET: -* python3_10
112 +
113 +Finally, switch to the final version and upgrade:
114 +
115 + */* PYTHON_TARGETS: -* python3_10
116 + */* PYTHON_SINGLE_TARGET: -* python3_10
117 +
118 +You may wish to remove the target overrides after the defaults switch.
119 +Alternatively, you can keep them to block the next automatic upgrade
120 +to Python 3.11, and upgrade manually then.
121 +
122 +
123 +Upgrade commands
124 +================
125 +The Python 3.9 cleanup requires that Python 3.9 is removed from
126 +the complete dependency trees in batch. If some of the
127 +installed packages using an older Python version are not triaged
128 +for the upgrade, the package manager will throw dependency conflicts.
129 +This makes it important that the upgrade is carried via a --deep
130 +--changed-use @world upgrade, as well as that any stray packages
131 +are removed prior to it, e.g.:
132 +
133 + emerge --depclean
134 + emerge -1vUD @world
135 + emerge --depclean
136 --
137 2.35.1

Replies

Subject Author
Re: [gentoo-dev] [PATCH news] 2022-06-13-python3-10: new entry "Mickaël Bucas" <mbucas@×××××.com>