platypus
platypus

Reputation: 1368

When is wheel required alongside setuptools?

In PEP 518 – Specifying Minimum Build System Requirements for Python Projects it says:

For the vast majority of Python projects that rely upon setuptools, the pyproject.toml file will be:

[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools", "wheel"]  # PEP 508 specifications.

However, using this pyproject.toml without a "wheel" dependency:

[build-system]
requires = ["setuptools"]

[project]
name = "meowpkg"
version = "1.0"
description = "a package that meows"

It is still possible to build wheels, using either build or pip:

$ python3 -m venv .venv
$ .venv/bin/pip install -q build
$ .venv/bin/pip list
Package         Version
--------------- -------
build           1.2.1
packaging       24.0
pip             24.0
pyproject_hooks 1.1.0
$ .venv/bin/python -m build --wheel
...
Successfully built meowpkg-1.0-py3-none-any.whl
$ .venv/bin/python -m pip wheel .
...
Successfully built meowpkg

Why does PEP 518 say to include wheel directly as a build-system requirement?

Upvotes: 2

Views: 78

Answers (0)

Related Questions