8.18. Python-Flit-Core 3.12.0
Build and install flit_core so Python packages using the Flit PEP 517 backend can be built.
Input assumption: flit_core-3.12.0.tar.gz is already present in /sources from the chapter 4 source staging step.
Source URL: https://pypi.org/packages/source/f/flit-core/flit_core-3.12.0.tar.gz
Upstream build note: upstream pyproject.toml declares requires = [], build-backend = "flit_core.buildapi", and backend-path = ["."], so the source tree can build its own wheel without build isolation or extra build dependencies.
Licenses:
- BSD-3-Clause
- MIT (vendored tomli)
Dependencies:
- python
- pip
Python-Flit-Core is the distribution-building core of Flit and provides a PEP 517 build backend. we need it to build Python packages that use flit_core.buildapi as their build backend.
Extract and Enter the Source Tree
cd /sources
rm -rf flit_core-3.12.0
tar -xf flit_core-3.12.0.tar.gz
cd flit_core-3.12.0
Build Python-Flit-Core
pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD
Install Python-Flit-Core
pip3 install --no-index --find-links dist flit_core
After this step is complete, you can remove the extracted source directory and source tarball from
/sources if you do not plan to rebuild Python-Flit-Core again.
Command Explanations
rm -rf flit_core-...: Removes any previous extracted flit-core tree.tar -xf flit_core-...tar.gz: Extracts the staged flit-core source archive.pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD: Builds a local wheel without downloading dependencies or using build isolation.pip3 install --no-index --find-links dist flit_core: Installs flit-core from the locally built wheel only.