mirror of https://github.com/pypa/pip
Merge 76cd925004
into a15dd75d98
This commit is contained in:
commit
4e9e783ade
|
@ -17,7 +17,7 @@ setup-py
|
|||
```
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
[`pyproject.toml` based](pyproject-toml)
|
||||
[*Backend API* based](pyproject-toml)
|
||||
: Standards-backed interface, that has explicit declaration and management of
|
||||
build dependencies.
|
||||
|
||||
|
@ -33,36 +33,50 @@ the build system interfaces that pip may use.
|
|||
|
||||
## Determining which build system interface is used
|
||||
|
||||
Currently, pip uses the `pyproject.toml` based build system interface, if a
|
||||
`pyproject.toml` file exists. If not, the legacy build system interface is used.
|
||||
The intention is to switch to using the `pyproject.toml` build system interface
|
||||
Currently, pip uses the *backend API* based build system interface, in the
|
||||
following scenarios:
|
||||
|
||||
- if a `pyproject.toml` file exists, or
|
||||
- if {pypi}`setuptools` or {pypi}`wheel` is not installed.
|
||||
|
||||
Otherwise, the legacy build system interface is used.
|
||||
The intention is to switch to using the *backend API* build system interface
|
||||
unconditionally and to drop support for the legacy build system interface at
|
||||
some point in the future.
|
||||
|
||||
When performing a build, pip will mention which build system interface it is
|
||||
using. Typically, this will take the form of a message like:
|
||||
using. For the *backend API* based build system interface,
|
||||
typically this will take the form of a message like[^2]:
|
||||
|
||||
```none
|
||||
Building wheel for pip (pyproject.toml)... done
|
||||
Building wheel for pip (<build backend identification>)... done
|
||||
```
|
||||
|
||||
[^2]: Here `<build backend identification>` is replaced with the actual value for
|
||||
the given package, e.g. `Building wheel for pip (setuptools.build_meta)... done`
|
||||
|
||||
For the `setup.py` based build system interface, typically this will look like
|
||||
the following:
|
||||
|
||||
```none
|
||||
Building wheel for pip (setup.py)... done
|
||||
```
|
||||
|
||||
The content in the brackets, refers to which build system interface is being
|
||||
used.
|
||||
|
||||
```{versionchanged} 21.3
|
||||
The output uses "pyproject.toml" instead of "PEP 517" to refer to be
|
||||
`pyproject.toml` based build system interface.
|
||||
*backend API* based build system interface.
|
||||
```
|
||||
|
||||
```{versionchanged} 23.X
|
||||
The output uses the backend specification instead of "pyproject.toml"
|
||||
to refer to be *backend API* based build system interface.
|
||||
```
|
||||
|
||||
## Controlling which build system interface is used
|
||||
|
||||
The [`--use-pep517`](install_--use-pep517) flag (and corresponding environment
|
||||
variable: `PIP_USE_PEP517`) can be used to force all packages to build using
|
||||
the `pyproject.toml` based build system interface. There is no way to force
|
||||
the *backend API* based build system interface. There is no way to force
|
||||
the use of the legacy build system interface.
|
||||
|
||||
(controlling-setup_requires)=
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# `pyproject.toml`
|
||||
# Backend API
|
||||
|
||||
```{versionadded} 10.0
|
||||
|
||||
|
@ -168,3 +168,6 @@ changes and improvements in it.
|
|||
- Prior to pip 18.1, build dependencies using `.pth` files are not properly
|
||||
supported; as a result namespace packages do not work under Python 3.2 and
|
||||
earlier.
|
||||
- Starting from version 23.1, pip uses the fallback behaviour of
|
||||
`setuptools.build_meta:__legacy__` when `wheel` or `setuptools` are not
|
||||
installed.
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# `setup.py` (legacy)
|
||||
|
||||
Prior to the introduction of pyproject.toml-based builds (in {pep}`517` and
|
||||
Prior to the introduction of *backend API* based builds (in {pep}`517` and
|
||||
{pep}`518`), pip had only supported installing packages using `setup.py` files
|
||||
that were built using {pypi}`setuptools`.
|
||||
|
||||
The interface documented here is retained currently solely for legacy purposes,
|
||||
until the migration to `pyproject.toml`-based builds can be completed.
|
||||
until the migration to *backend API* based builds can be completed.
|
||||
|
||||
```{caution}
|
||||
The arguments and syntax of the various invocations of `setup.py` made by
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Avoid referring to "backend API"-based builds as ``pyproject.toml``-based.
|
|
@ -0,0 +1 @@
|
|||
Replace confusing ``pyproject.toml`` with backend string in logs.
|
|
@ -29,7 +29,9 @@ def generate_metadata(
|
|||
# Note that BuildBackendHookCaller implements a fallback for
|
||||
# prepare_metadata_for_build_wheel, so we don't have to
|
||||
# consider the possibility that this hook doesn't exist.
|
||||
runner = runner_with_spinner_message("Preparing metadata (pyproject.toml)")
|
||||
runner = runner_with_spinner_message(
|
||||
f"Preparing metadata ({backend.build_backend})"
|
||||
)
|
||||
with backend.subprocess_runner(runner):
|
||||
try:
|
||||
distinfo_dir = backend.prepare_metadata_for_build_wheel(metadata_dir)
|
||||
|
|
|
@ -30,7 +30,7 @@ def generate_editable_metadata(
|
|||
# prepare_metadata_for_build_wheel/editable, so we don't have to
|
||||
# consider the possibility that this hook doesn't exist.
|
||||
runner = runner_with_spinner_message(
|
||||
"Preparing editable metadata (pyproject.toml)"
|
||||
f"Preparing editable metadata ({backend.build_backend})"
|
||||
)
|
||||
with backend.subprocess_runner(runner):
|
||||
try:
|
||||
|
|
|
@ -24,7 +24,7 @@ def build_wheel_pep517(
|
|||
logger.debug("Destination directory: %s", tempd)
|
||||
|
||||
runner = runner_with_spinner_message(
|
||||
f"Building wheel for {name} (pyproject.toml)"
|
||||
f"Building wheel for {name} ({backend.build_backend})"
|
||||
)
|
||||
with backend.subprocess_runner(runner):
|
||||
wheel_name = backend.build_wheel(
|
||||
|
|
|
@ -24,7 +24,7 @@ def build_wheel_editable(
|
|||
logger.debug("Destination directory: %s", tempd)
|
||||
|
||||
runner = runner_with_spinner_message(
|
||||
f"Building editable for {name} (pyproject.toml)"
|
||||
f"Building editable for {name} ({backend.build_backend})"
|
||||
)
|
||||
with backend.subprocess_runner(runner):
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue