aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2022-04-17 23:08:16 -0500
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2022-04-17 23:08:16 -0500
commit9749744481352f1d1fdc62a6a3275496b3deb6e6 (patch)
tree357804b8cf4c0c25d295fa043624075ae307fcd5
parent5a2aca56267b238d44b538bd3e5d71d86e1335b3 (diff)
Use pip3 to install Python modules and programs
meson, Markupsafe, and Jinja2
-rw-r--r--chapter08/jinja2.xml12
-rw-r--r--chapter08/markupsafe.xml11
-rw-r--r--chapter08/meson.xml29
3 files changed, 29 insertions, 23 deletions
diff --git a/chapter08/jinja2.xml b/chapter08/jinja2.xml
index 3ac2bdb41..6548dff8b 100644
--- a/chapter08/jinja2.xml
+++ b/chapter08/jinja2.xml
@@ -40,9 +40,13 @@
<sect2 role="installation">
<title>Installation of Jinja2</title>
+ <para>Build the package:</para>
+
+<screen><userinput remap="install">pip3 wheel -w dist --no-build-isolation --no-deps $PWD</userinput></screen>
+
<para>Install the package:</para>
-<screen><userinput remap="install">python3 setup.py install --optimize=1</userinput></screen>
+<screen><userinput remap="install">pip3 install --no-index --find-links dist Jinja2</userinput></screen>
</sect2>
@@ -50,10 +54,12 @@
<title>Contents of Jinja2</title>
<segmentedlist>
- <segtitle>Installed directories</segtitle>
+ <segtitle>Installed directory</segtitle>
<seglistitem>
- <seg>/usr/lib/python&python-minor;/site-packages/Jinja2-&jinja2-version;-py&python-minor;.egg</seg>
+ <seg>
+ /usr/lib/python&python-minor;/site-packages/Jinja2-&jinja2-version;.dist-info
+ </seg>
</seglistitem>
</segmentedlist>
diff --git a/chapter08/markupsafe.xml b/chapter08/markupsafe.xml
index 32aa9e8b5..322ec2730 100644
--- a/chapter08/markupsafe.xml
+++ b/chapter08/markupsafe.xml
@@ -42,13 +42,13 @@
<para>Compile MarkupSafe with the following command:</para>
-<screen><userinput remap="make">python3 setup.py build</userinput></screen>
+<screen><userinput remap="make">pip3 wheel -w dist --no-build-isolation --no-deps $PWD</userinput></screen>
<para>This package does not come with a test suite.</para>
<para>Install the package:</para>
-<screen><userinput remap="install">python3 setup.py install --optimize=1</userinput></screen>
+<screen><userinput remap="install">pip3 install --no-index --find-links dist Markupsafe</userinput></screen>
</sect2>
@@ -59,10 +59,9 @@
<segtitle>Installed directory</segtitle>
<seglistitem>
- <!-- Suffix "-linux-<arch>" is different from meson and jinja:
- This package contains binary code (compiled from C), but meson
- and jinja only contain Python code. -->
- <seg>/usr/lib/python&python-minor;/site-packages/MarkupSafe-&markupsafe-version;-py&python-minor;-linux-<replaceable>&lt;arch&gt;</replaceable>.egg</seg>
+ <seg>
+ /usr/lib/python&python-minor;/site-packages/MarkupSafe-&markupsafe-version;.dist-info
+ </seg>
</seglistitem>
</segmentedlist>
diff --git a/chapter08/meson.xml b/chapter08/meson.xml
index ffd4153b0..91b4b61bc 100644
--- a/chapter08/meson.xml
+++ b/chapter08/meson.xml
@@ -54,14 +54,13 @@
-->
<para>Compile Meson with the following command:</para>
-<screen><userinput remap="make">python3 setup.py build</userinput></screen>
+<screen><userinput remap="make">pip3 wheel -w dist --no-build-isolation --no-deps $PWD</userinput></screen>
<para>The test suite requires some packages out of the scope of LFS.</para>
<para>Install the package:</para>
-<screen><userinput remap="install">python3 setup.py install --root=dest
-cp -rv dest/* /
+<screen><userinput remap="install">pip3 install --no-index --find-links dist meson
install -vDm644 data/shell-completions/bash/meson /usr/share/bash-completion/completions/meson
install -vDm644 data/shell-completions/zsh/_meson /usr/share/zsh/site-functions/_meson</userinput></screen>
@@ -69,14 +68,16 @@ install -vDm644 data/shell-completions/zsh/_meson /usr/share/zsh/site-functions/
<title>The meaning of the install parameters:</title>
<varlistentry>
- <term><parameter>--root=dest</parameter></term>
+ <term><parameter>-w dist</parameter></term>
<listitem>
- <para>By default <command>python3 setup.py install</command>
- installs various files (such as man pages) into Python Eggs.
- With a specified root location, <command>setup.py</command> installs
- these files into a standard hierarchy. Then the hierarchy
- can just be copied to the standard location.
- </para>
+ <para>Put the created wheels into the `dist` directory.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><parameter>--find-links dist</parameter></term>
+ <listitem>
+ <para>Install wheels from the 'dist' directory.</para>
</listitem>
</varlistentry>
@@ -92,10 +93,10 @@ install -vDm644 data/shell-completions/zsh/_meson /usr/share/zsh/site-functions/
<seglistitem>
<seg>meson</seg>
- <!-- We are using DESTDIR installation here, so the directory layout
- is different than other Python modules in LFS
- (Jinja2 & MarkupSafe). -->
- <seg>/usr/lib/python&python-minor;/site-packages/meson-&meson-version;-py&python-minor;.egg-info and /usr/lib/python&python-minor;/site-packages/mesonbuild</seg>
+ <seg>
+ /usr/lib/python&python-minor;/site-packages/meson-&meson-version;.dist-info and
+ /usr/lib/python&python-minor;/site-packages/mesonbuild
+ </seg>
</seglistitem>
</segmentedlist>