wheel: build the wheel archive of wheel itself

This avoids running "python3 setup.py install" (indirectly), which may
not work correctly in the future with Python 3.12.
This commit is contained in:
Xi Ruoyao 2022-11-22 16:56:41 +08:00
parent e354e58462
commit e3187f4895
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3

View File

@ -40,12 +40,39 @@
<sect2 role="installation"> <sect2 role="installation">
<title>Installation of Wheel</title> <title>Installation of Wheel</title>
<para>Compile wheel with the following command:</para>
<screen><userinput remap="make">PYTHONPATH=src pip3 wheel -w dist --no-build-isolation --no-deps $PWD</userinput></screen>
<para>Install wheel with the following command:</para> <para>Install wheel with the following command:</para>
<screen><userinput remap="install">pip3 install --no-index $PWD</userinput></screen> <screen><userinput remap="install">pip3 install --no-index --find-links=dist wheel</userinput></screen>
<variablelist> <variablelist>
<title>The meaning of the pip3 options:</title> <title>The meaning of the pip3 commands:</title>
<varlistentry>
<term><envar>PYTHONPATH=src</envar></term>
<listitem>
<para>Allow using this package (not installed yet) to build a
wheel archive for itself, to avoid a chicken-or-egg problem.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>wheel</command></term>
<listitem>
<para>Build wheel archive for this package.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>-w dist</parameter></term>
<listitem>
<para>Put the created wheels into the
<filename class='directory'>dist</filename> directory.</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><command>install</command></term> <term><command>install</command></term>
@ -55,24 +82,25 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><parameter>--no-index</parameter></term> <term><parameter>--no-build-isolation</parameter>,
<parameter>--no-deps</parameter>, and
<parameter>--no-index</parameter></term>
<listitem> <listitem>
<para>Prevent pip from fetching files from the online package <para>Prevent pip from fetching files from the online package
repository (PyPI). If packages are installed in the correct order, repository (PyPI). If packages are installed in the correct order,
then it won't need to fetch any files in the first place, but this then it won't need to fetch any files in the first place, but these
option adds some safety in case of user error.</para> options add some safety in case of user error.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><parameter>$PWD</parameter></term> <term><parameter>--find-links dist</parameter></term>
<listitem> <listitem>
<para>Look for files to install in the current working directory.</para> <para>Search wheel archives from the
<filename class='directory'>dist</filename> directory.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</sect2> </sect2>
<sect2 id="contents-wheel" role="content"> <sect2 id="contents-wheel" role="content">
@ -86,7 +114,7 @@
<seg>wheel</seg> <seg>wheel</seg>
<seg> <seg>
/usr/lib/python&python-minor;/site-packages/wheel and /usr/lib/python&python-minor;/site-packages/wheel and
/usr/lib/python&python-minor;/site-packages/wheel-0.37.1-py3.10.egg-info /usr/lib/python&python-minor;/site-packages/wheel-&wheel-version;.dist-info
</seg> </seg>
</seglistitem> </seglistitem>
</segmentedlist> </segmentedlist>