source: general/prog/python3.xml@ ba6e7d32

12.2 gimp3 lazarus trunk xry111/for-12.3 xry111/spidermonkey128
Last change on this file since ba6e7d32 was ba6e7d32, checked in by Bruce Dubbs <bdubbs@…>, 6 months ago

Update to Python3-3.12.3.

  • Property mode set to 100644
File size: 14.0 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY python3-download-http
8 "https://www.python.org/ftp/python/&python3-version;/Python-&python3-version;.tar.xz">
9 <!ENTITY python3-download-ftp " ">
10 <!ENTITY python3-md5sum "8defb33f0c37aa4bdd3a38ba52abde4e">
11 <!ENTITY python3-size "20 MB">
12 <!ENTITY python3-buildsize "335 MB (add 57 MB for tests)">
13 <!ENTITY python3-time "2.2 SBU (add 1.0 SBU for tests; both using parallelism=4)">
14 <!--
15 Note: Size does not reflect docs that were installed in LFS.
16 -->
17 <!ENTITY python3htmldoc-download-http
18 "https://www.python.org/ftp/python/doc/&python3-version;/python-&python3-version;-docs-html.tar.bz2">
19 <!ENTITY python3-docs-md5sum "8a6310f6288e7f60c3565277ec3b5279" >
20]>
21
22<sect1 id="python3" xreflabel="Python-&python3-version;">
23 <?dbhtml filename="python3.html" ?>
24
25
26 <title>Python-&python3-version;</title>
27
28 <indexterm zone="python3">
29 <primary sortas="a-Python3">Python3</primary>
30 </indexterm>
31
32 <sect2 role="package">
33 <title>Introduction to Python 3</title>
34
35 <para>
36 The <application>Python 3</application> package contains the
37 <application>Python</application> development environment.
38 This is useful for object-oriented programming, writing scripts,
39 prototyping large programs or developing entire applications.
40 </para>
41
42 <note>
43 <para>
44 <application>Python 3</application> was installed in LFS.
45 The only reason to rebuild it here is if optional modules
46 are needed, or to upgrade this package.
47 </para>
48 </note>
49
50 &lfs121_checked;
51
52 <important>
53 <para>
54 If upgrading to a new Python-3 minor version (for example,
55 from Python-3.11.x to Python-3.12.0), you will need to reinstall
56 any Python3 modules you have installed. You should also
57 reinstall packages that generate Python3 modules
58 including
59 &gobject-introspection;,
60 <xref linkend="libxml2"/>,
61 <xref linkend="opencv"/>,
62 <xref linkend="graphviz"/> (if swig is installed).
63 </para>
64
65 <para>Before you upgrade, you can get a list of modules installed
66 with <command>pip3 list</command>. The list may be incomplete as
67 some Python modules are not installed with <command>pip3</command>,
68 for example the <literal>cracklib</literal> module installed by
69 <xref role='nodep' linkend='cracklib'/>. Use <command>ls
70 /usr/lib/python3.<replaceable>minor</replaceable>/site-packages</command>
71 for a comprehensive list.
72 </para>
73
74 <para>
75 The Python modules from LFS will also have to be reinstalled:
76 <ulink url="&lfs-root;/chapter08/flit-core.html">flit-core</ulink>,
77 <ulink url="&lfs-root;/chapter08/wheel.html">wheel</ulink>,
78 <ulink url="&lfs-root;/chapter08/setuptools.html">setuptools</ulink>,
79 <ulink url="&lfs-root;/chapter08/meson.html">meson</ulink>,
80 <ulink url="&lfs-root;/chapter08/markupsafe.html">MarkupSafe</ulink>,
81 and <ulink url="&lfs-root;/chapter08/jinja2.html">Jinja2</ulink>.
82 </para>
83 </important>
84
85 <bridgehead renderas="sect3">Package Information</bridgehead>
86 <itemizedlist spacing="compact">
87 <listitem>
88 <para>
89 Download (HTTP): <ulink url="&python3-download-http;"/>
90 </para>
91 </listitem>
92 <listitem>
93 <para>
94 Download (FTP): <ulink url="&python3-download-ftp;"/>
95 </para>
96 </listitem>
97 <listitem>
98 <para>
99 Download MD5 sum: &python3-md5sum;
100 </para>
101 </listitem>
102 <listitem>
103 <para>
104 Download size: &python3-size;
105 </para>
106 </listitem>
107 <listitem>
108 <para>
109 Estimated disk space required: &python3-buildsize;
110 </para>
111 </listitem>
112 <listitem>
113 <para>
114 Estimated build time: &python3-time;
115 </para>
116 </listitem>
117 </itemizedlist>
118
119 <bridgehead renderas="sect3">Additional Optional Download</bridgehead>
120 <itemizedlist spacing="compact">
121 <listitem>
122 <para>
123 Download (HTTP): <ulink url="&python3htmldoc-download-http;"/>
124 </para>
125 </listitem>
126 <listitem>
127 <para>
128 Download MD5 sum: &python3-docs-md5sum;
129 </para>
130 </listitem>
131 </itemizedlist>
132
133 <bridgehead renderas="sect3">Python 3 Dependencies</bridgehead>
134
135 <bridgehead renderas="sect4">Recommended</bridgehead>
136 <para role="recommended">
137 <xref linkend="sqlite"/> (required if building firefox or thunderbird)
138 </para>
139
140 <bridgehead renderas="sect4">Optional</bridgehead>
141 <para role="optional">
142 <xref linkend="bluez"/>,
143 <xref linkend="gdb"/> (required for some tests),
144 <xref linkend="valgrind"/>, and
145 <ulink url="https://www.bytereef.org/mpdecimal/">libmpdec</ulink>
146 </para>
147
148 <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
149 <para role="optional">
150 <xref linkend="libnsl"/>,
151 <xref linkend="tk"/>, and
152 &berkeley-db;
153 </para>
154
155 <para condition="html" role="usernotes">Editor Notes:
156 <ulink url="&blfs-wiki;/Python3"/>
157 </para>
158 </sect2>
159
160 <sect2 role="installation">
161 <title>Installation of Python 3</title>
162
163 <para>
164 Install <application>Python 3</application> by running the following
165 commands:
166 </para>
167
168<screen><userinput>CXX="/usr/bin/g++" \
169./configure --prefix=/usr \
170 --enable-shared \
171 --with-system-expat \
172 --enable-optimizations &amp;&amp;
173make</userinput></screen>
174
175 <para>
176 <!-- I'm getting a test failure with empty $LANG:
177 "test test_curses failed"
178 "_curses.error: inswstr() returned ERR"
179 not sure why, but let's just work around it with LC_ALL.
180
181 For Python-3.12.0 all tests pass with only LANG=en_US.utf8.
182 Total tests: run=41,505 skipped=1,199
183 Total test files: run=477/483 skipped=12 resource_denied=6
184
185 For Python-3.12.1 all tests pass
186 Total tests: run=40,624 skipped=1,136
187 Total test files: run=486/489 skipped=24 resource_denied=3
188
189 For Python-3.12.2 all tests pass
190 Total tests: run=41,580 skipped=1,144
191 Total test files: run=485/488 skipped=23 resource_denied=3
192
193 For Python-3.12.3 all tests pass
194 Total tests: run=41,778 skipped=1,155
195 Total test files: run=485/488 skipped=24 resource_denied=3
196 -->
197 To test the result, issue <command>LC_ALL=en_US.UTF-8
198 make test</command>.
199 Some tests may need an Internet connection.
200 </para>
201
202 <para>
203 Now, as the <systemitem class="username">root</systemitem> user:
204 </para>
205
206<screen role="root"><userinput>make install</userinput></screen>
207
208 <para>
209 If upgrading and the documentation has been downloaded, optionally install
210 it as the &root; user:
211 </para>
212
213<screen role="root"><userinput>install -v -dm755 /usr/share/doc/python-&python3-version;/html
214
215tar --strip-components=1 \
216 --no-same-owner \
217 --no-same-permissions \
218 -C /usr/share/doc/python-&python3-version;/html \
219 -xvf ../python-&python3-version;-docs-html.tar.bz2</userinput></screen>
220
221 </sect2>
222
223 <sect2 role="commands">
224 <title>Command Explanations</title>
225
226 <para>
227 <command> CXX="/usr/bin/g++" ./configure ...</command>: Avoid an annoying
228 message during configuration.
229 </para>
230
231 <para>
232 <parameter>--with-system-expat</parameter>: This switch enables linking
233 against the system version of <application>Expat</application>.
234 </para>
235
236<!--
237 <para>
238 <parameter>- -with-ensurepip=yes</parameter> : This switch enables building
239 the <command>pip</command> and <command>setuptools</command> packaging
240 programs. <command>setuptools</command> is needed for building some
241 Python modules.
242 </para>
243-->
244 <para>
245 <option>--with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
246 if you want to build the <application>Python</application> DBM Module
247 against <application>Berkeley DB</application> instead of
248 <application>GDBM</application>.
249 </para>
250
251 <para>
252 <parameter>--enable-optimizations</parameter>: This switch enables
253 stable, but expensive, optimizations.
254 </para>
255
256 <para>
257 <option>--with-lto</option>: This optional switch enables thick Link
258 Time Optimization. Unusually, it creates a much larger <filename
259 class="libraryfile">/usr/lib/python&python3-majorver;/config-&python3-majorver;-&lt;arch&gt;-linux-gnu/libpython&python3-majorver;.a</filename>
260 with a small increase in the time to compile
261 <application>Python</application>. Run-time results do not appear to show
262 any benefit from doing this.
263 </para>
264
265 </sect2>
266
267 <sect2 role="configuration">
268 <title>Configuring Python 3</title>
269
270 <para>
271 In order for <command>python3</command> to find the installed
272 documentation, create the following version independent symlink:
273 </para>
274
275<screen role="root"><userinput>ln -svfn python-&python3-version; /usr/share/doc/python-3</userinput></screen>
276
277 <para>
278 and add the following environment variable to the individual user's or
279 system's profile:
280 </para>
281
282<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-3/html</userinput></screen>
283
284 </sect2>
285
286 <sect2 role="content">
287 <title>Contents</title>
288
289 <segmentedlist>
290 <segtitle>Installed Programs</segtitle>
291 <segtitle>Installed Libraries</segtitle>
292 <segtitle>Installed Directories</segtitle>
293
294 <seglistitem>
295 <seg>
296 2to3 (symlink) and
297 2to3-&python3-majorver;,
298
299 <!--
300 easy_install-&python3-majorver;,
301 -->
302
303 idle3 (symlink) and
304 idle&python3-majorver;,
305
306 pip3 and
307 pip&python3-majorver;,
308
309 pydoc3 (symlink) and
310 pydoc&python3-majorver;,
311
312 python3 (symlink) and
313 python&python3-majorver;, and
314
315 python3-config (symlink) and
316 python&python3-majorver;-config
317 </seg>
318 <seg>
319 libpython&python3-majorver;.so and libpython3.so
320 </seg>
321 <seg>
322 /usr/include/python&python3-majorver;,
323 /usr/lib/python&python3-majorver;, and
324 /usr/share/doc/python-&python3-version;
325 </seg>
326 </seglistitem>
327 </segmentedlist>
328
329 <variablelist>
330 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
331 <?dbfo list-presentation="list"?>
332 <?dbhtml list-presentation="table"?>
333 <!--
334 <varlistentry id="2to3">
335 <term><command>2to3</command></term>
336 <listitem>
337 <para>
338 is designed to assist in the transition between python2 and python3
339 by automatically converting code to be Python3 compatible.
340 </para>
341 <indexterm zone="python3 2to3">
342 <primary sortas="b-2to3">2to3</primary>
343 </indexterm>
344 </listitem>
345 </varlistentry>
346 Put here for easy use when removing Python2 -->
347 <!--
348 <varlistentry id="easy_install">
349 <term><command>easy_install</command></term>
350 <listitem>
351 <para>
352 is a frontend to pip3 to make it easier to configure python modules
353 through the PIP package manager
354 </para>
355 <indexterm zone="python3 easy_install">
356 <primary sortas="python3 easy_install">easy_install</primary>
357 </indexterm>
358 </listitem>
359 </varlistentry>
360 -->
361 <varlistentry id="idle3">
362 <term><command>idle3</command></term>
363 <listitem>
364 <para>
365 is a wrapper script that opens a <application>Python</application>
366 aware GUI editor. For this script to run, you must have installed
367 <application>Tk</application> before Python so that the Tkinter
368 Python module is built
369 </para>
370 <indexterm zone="python3 idle3">
371 <primary sortas="b-idle3">idle3</primary>
372 </indexterm>
373 </listitem>
374 </varlistentry>
375
376 <varlistentry id="pydoc3">
377 <term><command>pydoc3</command></term>
378 <listitem>
379 <para>
380 is the <application>Python</application> documentation
381 tool
382 </para>
383 <indexterm zone="python3 pydoc3">
384 <primary sortas="b-pydoc3">pydo3c</primary>
385 </indexterm>
386 </listitem>
387 </varlistentry>
388
389 <varlistentry id="python3-prog">
390 <term><command>python3</command></term>
391 <listitem>
392 <para>
393 is an interpreted, interactive, object-oriented programming
394 language
395 </para>
396 <indexterm zone="python3 python3-prog">
397 <primary sortas="b-python3">python3</primary>
398 </indexterm>
399 </listitem>
400 </varlistentry>
401
402 <varlistentry id="python-ver">
403 <term><command>python&python3-majorver;</command></term>
404 <listitem>
405 <para>
406 is a version-specific name for the <command>python</command>
407 program
408 </para>
409 <indexterm zone="python3 python-ver">
410 <primary sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
411 </indexterm>
412 </listitem>
413 </varlistentry>
414 <!--
415 <varlistentry id="pyvenv">
416 <term><command>pyvenv</command></term>
417 <listitem>
418 <para>
419 creates virtual <application>Python</application> environments in
420 one or more target directories.
421 </para>
422 <indexterm zone="python3 pyvenv">
423 <primary
424 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
425 </indexterm>
426 </listitem>
427 </varlistentry>
428 -->
429 </variablelist>
430
431 </sect2>
432
433</sect1>
Note: See TracBrowser for help on using the repository browser.