Changeset 8e751f7


Ignore:
Timestamp:
12/07/2022 06:54:04 PM (17 months ago)
Author:
David Bryant <davidbryant@…>
Branches:
11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, bdubbs/gcc13, multilib, renodr/libudev-from-systemd, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/update-glibc
Children:
156a414e, d988306
Parents:
e9c46b3
Message:

Added an explanation. Python is a language. python3 is a program.
Inserted the definite article where idiom requires it. Added more
detail to an option description. Broke an extremely long paragraph
into three pieces; cleaned up English idiom and punctuation all the
way through this section. In "Short Descriptions", inserted periods
where appropriate, and clarified the description of python3, which
is a program, not a language.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter08/python.xml

    re9c46b3 r8e751f7  
    2626    <para>The Python 3 package contains the Python development environment. It
    2727    is useful for object-oriented programming, writing scripts, prototyping
    28     large programs, or developing entire applications.</para>
     28    large programs, and developing entire applications. Python is an interpreted
     29    computer language.</para>
    2930
    3031    <segmentedlist>
     
    5758      <term><parameter>--with-system-expat</parameter></term>
    5859      <listitem>
    59         <para>This switch enables linking against system version of
     60        <para>This switch enables linking against the system version of
    6061        <application>Expat</application>.</para>
    6162       </listitem>
     
    6566      <term><parameter>--with-system-ffi</parameter></term>
    6667      <listitem>
    67         <para>This switch enables linking against system version of
    68         <application>libffi</application>.</para>
     68        <para>This switch enables linking against the system version of
     69        <application>libffi.so</application>.</para>
    6970      </listitem>
    7071    </varlistentry>
     
    7374      <term><parameter>--enable-optimizations</parameter></term>
    7475      <listitem>
    75         <para>This switch enables stable, but expensive, optimizations.</para>
     76        <para>This switch enables extensive, but time-consuming, optimization
     77        steps. The interpreter is built twice; tests performed on the first
     78        build are used to improve the optimized final version.</para>
     79        <!-- This description was drawn from the README.rst file
     80        in the Python-3.11.0 package. -->
    7681      </listitem>
    7782    </varlistentry>
     
    8590    <para>Running the tests at this point is not recommended.  The
    8691    tests are known to hang indefinitely in the partial LFS environment.
    87     If desired, the tests can be rerun at the end of this chapter or
     92    If desired, the tests can be rerun at the end of this chapter, or
    8893    when Python 3 is reinstalled in BLFS.  To run the tests anyway,
    8994    issue <command>make test</command>.</para>
     
    9398<screen><userinput remap="install">make install</userinput></screen>
    9499
    95     <para>In several places we use the <command>pip3</command> command to
     100    <para>We use the <command>pip3</command> command to
    96101    install Python 3 programs and modules for all users as
    97     <systemitem class='username'>root</systemitem>. This conflicts
    98     with the Python developers recommendation to install packages into a
    99     virtual environment or the home directory of a regular user (by running
    100     <command>pip3</command> as this user). To this end, a multi-line warning
    101     is written when using <command>pip3</command> as the
    102     <systemitem class='username'>root</systemitem> user.  The main reason
    103     of this recommendation is for avoiding a conflict with the system
    104     package manager (<command>dpkg</command> for example), but LFS does not
    105     have a system-wide package manager so this is not a problem.  And,
    106     <command>pip3</command> will attempt to check for a new version of
    107     itself whenever it's run.  As domain name resolving is not configured
    108     yet in LFS chroot environment, it will fail to check for a new version
    109     and produce a warning.  Once we boot the LFS system and set up network
    110     connection, it will then produce a warning telling the user to update it
    111     from a pre-built wheel on PyPI if any new version is available.  But LFS
    112     consider <command>pip3</command> a part of Python 3 so it should not be
    113     updated separately, and an update from a pre-built wheel will deviate
    114     from our purpose to build a Linux system from source code.  So the
    115     warning for a new <command>pip3</command> version should be ignored as
    116     well. If desired, suppress these warnings by running the following
    117     commands:</para>
     102    <systemitem class='username'>root</systemitem> in several places in this book.
     103    This conflicts with the Python developers' recommendation: to install packages into a
     104    virtual environment, or into the home directory of a regular user (by running
     105    <command>pip3</command> as this user). A multi-line warning
     106    is triggered whenever <command>pip3</command> is issued by the
     107    <systemitem class='username'>root</systemitem> user.</para>
     108   
     109    <para>The main reason
     110    for the recommendation is to avoid conflicts with the system's
     111    package manager (<command>dpkg</command>, for example). LFS does not
     112    have a system-wide package manager, so this is not a problem.  Also,
     113    <command>pip3</command> will check for a new version of
     114    itself whenever it's run.  Since domain name resolution is not yet configured
     115    in the LFS chroot environment, <command>pip3</command> cannot check
     116    for a new version of itself, and will
     117    produce a warning. </para>
     118 
     119    <para>After we boot the LFS system and set up a network connection,
     120    a different warning will be issued, telling the user to update <command>pip3</command>
     121    from a pre-built wheel on PyPI (whenever a new version is available).  But LFS
     122    considers <command>pip3</command> to be a part of Python 3, so it should not be
     123    updated separately. Also, an update from a pre-built wheel would deviate
     124    from our objective: to build a Linux system from source code.  So the
     125    warning about a new version of <command>pip3</command> should be ignored as
     126    well. If you wish, you can suppress all these warnings by running the following
     127    command, which creates a configuration file:</para>
    118128
    119129<screen><userinput remap="install">cat &gt; /etc/pip.conf &lt;&lt; EOF
     
    131141      <para>
    132142        In LFS and BLFS we normally build and install Python modules with the
    133         <command>pip3</command> command.  Please take care that the
    134         <command>pip3 install</command> commands in both the books should be
    135         run as the &root; user unless it's for a Python virtual environment.
    136         Running a <command>pip3 install</command> as a non-&root; user may seem
    137         to work fine, but it will cause the installed module to be inaccessible
     143        <command>pip3</command> command.  Please be sure that the
     144        <command>pip3 install</command> commands in both books are
     145        run as the &root; user (unless it's for a Python virtual environment).
     146        Running <command>pip3 install</command> as a non-&root; user may seem
     147        to work, but it will cause the installed module to be inaccessible
    138148        by other users.
    139149      </para>
     
    141151      <para>
    142152        <command>pip3 install</command> will not reinstall an already installed
    143         module by default.  For using the <command>pip3 install</command>
     153        module automatically.  When using the <command>pip3 install</command>
    144154        command to upgrade a module (for example, from meson-0.61.3 to
    145155        meson-0.62.0), insert the option <parameter>--upgrade</parameter> into
    146         the command line.  If it's really necessary to downgrade a module or
     156        the command line.  If it's really necessary to downgrade a module, or
    147157        reinstall the same version for some reason, insert
    148158        <parameter>--force-reinstall --no-deps</parameter> into the command
     
    168178      <listitem>
    169179        <para>Ensure the installed files have the correct ownership and
    170         permissions.  Without these options, using <application>tar</application>
     180        permissions.  Without these options, <application>tar</application>
    171181        will install the package files with the upstream creator's values.
    172182        </para>
     
    227237            is a wrapper script that opens a <application>Python</application>
    228238            aware GUI editor. For this script to run, you must have installed
    229             <application>Tk</application> before Python so that the Tkinter
    230             Python module is built
     239            <application>Tk</application> before Python, so that the Tkinter
     240            Python module is built.
    231241          </para>
    232242          <indexterm zone="ch-system-Python">
     
    241251          <para>
    242252            The package installer for Python. You can use pip to install
    243             packages from Python Package Index and other indexes
     253            packages from Python Package Index and other indexes.
    244254          </para>
    245255          <indexterm zone="ch-system-Python">
     
    265275        <listitem>
    266276          <para>
    267             is an interpreted, interactive, object-oriented programming
    268             language
     277            is the interpreter for Python, an interpreted, interactive,
     278            object-oriented programming language
    269279          </para>
    270280          <indexterm zone="ch-system-Python">
Note: See TracChangeset for help on using the changeset viewer.