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

Replies