From e3187f489593fe719800b980c94634ecff9dfe96 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 22 Nov 2022 16:56:41 +0800 Subject: 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. --- chapter08/wheel.xml | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) (limited to 'chapter08') diff --git a/chapter08/wheel.xml b/chapter08/wheel.xml index 0f6ba7cb6..5b09fc65b 100644 --- a/chapter08/wheel.xml +++ b/chapter08/wheel.xml @@ -40,12 +40,39 @@ Installation of Wheel + Compile wheel with the following command: + +PYTHONPATH=src pip3 wheel -w dist --no-build-isolation --no-deps $PWD + Install wheel with the following command: -pip3 install --no-index $PWD +pip3 install --no-index --find-links=dist wheel - The meaning of the pip3 options: + The meaning of the pip3 commands: + + + PYTHONPATH=src + + Allow using this package (not installed yet) to build a + wheel archive for itself, to avoid a chicken-or-egg problem. + + + + + wheel + + Build wheel archive for this package. + + + + + -w dist + + Put the created wheels into the + dist directory. + + install @@ -55,24 +82,25 @@ - --no-index + --no-build-isolation, + --no-deps, and + --no-index Prevent pip from fetching files from the online package 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 - option adds some safety in case of user error. + then it won't need to fetch any files in the first place, but these + options add some safety in case of user error. - $PWD + --find-links dist - Look for files to install in the current working directory. + Search wheel archives from the + dist directory. - - @@ -86,7 +114,7 @@ wheel /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 -- cgit v1.2.3-54-g00ecf