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