8.64. Setuptools-76.0.0

Setuptools is a tool used to download, build, install, upgrade, and uninstall Python packages.

Approximate build time: less than 0.1 SBU
Required disk space: 26 MB

8.64.1. Installation of Setuptools

Create the PKGBUILD for the Setuptools package with the following commands:

mkdir /sources/setuptools
cd /sources/setuptools
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>

pkgname="setuptools"
pkgver="76.0.0"
pkgrel="1"
pkgdesc="The Setuptools module provides a method to easily download, build, install, upgrade, and uninstall Python packages."
arch=('any')
url="https://pypi.org/project/setuptools/"
license=('custom'
         'MIT')
groups=('core')
depends=('python')
makedepends=('wheel')
source=('https://pypi.org/packages/source/s/setuptools/setuptools-76.0.0.tar.gz')
md5sums=('a15701d19326a1d4132fce56f2861a60')

build(){
  cd "${pkgname}-${pkgver}"
  pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD
}

package(){
  cd "${pkgname}-${pkgver}"
  pip3 install --root "${pkgdir}" --no-index --find-links dist setuptools
}
REALEOF

Prepare the build directory for the pacman user and build the package:

chown -R root:pacman .
chmod 2775 .
chmod 664 PKGBUILD
su pacman -c 'makepkg -L --nodeps'

Add the newly created package to the central package repository:

cp setuptools-76.0.0-1-any.pkg.tar.xz \
   /srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
         /srv/pacman/repos/LFS/setuptools-76.0.0-1-any.pkg.tar.xz

Update the local cache and install the Setuptools package:

pacman -Syu
pacman -S setuptools --overwrite \* -dd --noconfirm

Finally, copy the source files into the source repository and clean up the build directory:

mkdir /srv/pacman/source/LFS/setuptools
cp PKGBUILD /srv/pacman/source/LFS/setuptools
cd /sources
rm -rf setuptools

8.64.2. Contents of Setuptools

Installed directory: /usr/lib/python3.13/site-packages/_distutils_hack, /usr/lib/python3.13/site-packages/pkg_resources, /usr/lib/python3.13/site-packages/setuptools, and /usr/lib/python3.13/site-packages/setuptools-76.0.0.dist-info