Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1ac6c5a
Remove setup.py develop code path
sbidoul Mar 8, 2025
6547480
Remove legacy editable tests
sbidoul May 10, 2025
5217ae5
Refactor get_created_direct_url test
sbidoul May 18, 2025
38f3c88
Rework PipTestResult for detection of modern editables
sbidoul May 18, 2025
4da9174
Update tests that were looking for egg-link files to detect editables
sbidoul May 10, 2025
ccf5726
Test there is no fallback when backend has no PEP 660
sbidoul Sep 27, 2025
d99e0c0
Update uninstall tests that depend on legacy install methods
sbidoul Sep 27, 2025
65297aa
Update pip show test that depends on legacy install method
sbidoul Sep 27, 2025
f860790
Remove non PEP 517 code paths
sbidoul Sep 28, 2025
a9f6a56
Remove --use-pep517 option test
sbidoul Sep 28, 2025
517dad5
Remove --no-use-pep517 test
sbidoul Sep 28, 2025
7347a51
Update creation of test package that must fail building
sbidoul Sep 28, 2025
69b762c
Run unit tests with no build isolation
sbidoul Sep 28, 2025
a709e54
Remove tests that exercise --global-option
sbidoul Sep 28, 2025
f53a7b1
Rework test that needed --global-option to use --config-setting
sbidoul Sep 28, 2025
45bae46
Test install pip without build isolation
sbidoul Sep 28, 2025
57ceb90
Remove legacy 'setup.py clean' tests
sbidoul Sep 28, 2025
52d4439
Add --no-build-isolation to tests
sbidoul Sep 28, 2025
51bdf61
Add news
sbidoul Sep 27, 2025
61ebd05
Fix and expand PEP 660 detection
sbidoul Sep 28, 2025
93befb8
Remove a few more obsolete pep517 things from the test suite
sbidoul Sep 29, 2025
3aff09a
Docs: reflect removal of direct setup.py invocations
sbidoul Oct 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/html/cli/pip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ when decision is needed.
.. _`2-build-system-interface`:
.. rubric:: Build System Interface

This is now covered in :doc:`../reference/build-system/index`.
This is now covered in :doc:`../reference/build-system`.

.. _`General Options`:

Expand Down
2 changes: 1 addition & 1 deletion docs/html/cli/pip_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ This is now covered in :doc:`../topics/local-project-installs`.
.. _`0-build-system-interface`:
.. rubric:: Build System Interface

This is now covered in :doc:`../reference/build-system/index`.
This is now covered in :doc:`../reference/build-system`.

.. _`pip install Options`:

Expand Down
2 changes: 1 addition & 1 deletion docs/html/cli/pip_wheel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Description
.. _`1-build-system-interface`:
.. rubric:: Build System Interface

This is now covered in :doc:`../reference/build-system/index`.
This is now covered in :doc:`../reference/build-system`.

Differences to ``build``
------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
# `pyproject.toml`
(build-interface)=

```{versionadded} 10.0

```

```{versionchanged} 23.1
The legacy interface where pip could invoke `setup.py install`
in some circumstances was removed,
in favor of the fallback behavior described below.
```

```{versionchanged} 25.3
The legacy interface where pip could invoke `setup.py build_wheel` or
`setup.py develop` in some circumstances was removed,
in favor of the fallback behavior described below..
```

# Build System Interface

When dealing with installable source distributions of a package, pip does not
directly handle the build process for the package. This responsibility is
delegated to "build backends" -- also known as "build systems". This means
that pip needs an interface, to interact with these build backends.

Modern Python packages can contain a `pyproject.toml` file, first introduced in
{pep}`518` and later expanded in {pep}`517`, {pep}`621` and {pep}`660`.
This file contains build system requirements and information, which are used by
Expand Down Expand Up @@ -96,16 +115,6 @@ For performing editable installs, pip will use {pep}`660`
`build_wheel_for_editable` hook that has to be provided by the build backend.
The wheels generated using this mechanism are not cached.

```{admonition} Compatibility fallback
If this hook is missing on the build backend _and_ there's a `setup.py` file
in the project, pip will fallback to the legacy setup.py-based editable
installation.

This is considered a stopgap solution until setuptools adds support for
{pep}`660`, at which point this functionality will be removed; following pip's
regular {ref}`deprecation policy <Deprecation Policy>`.
```

### Backend Configuration

Build backends have the ability to accept configuration settings, which can
Expand All @@ -125,8 +134,7 @@ files.
## Build output

It is the responsibility of the build backend to ensure that the output is
in the correct encoding, as described in {pep}`517`. This likely involves
dealing with [the same challenges as pip has for legacy builds](build-output).
in the correct encoding, as described in {pep}`517`.

## Fallback Behaviour

Expand All @@ -138,7 +146,8 @@ https://setuptools.pypa.io/en/stable/userguide/quickstart.html#basic-use).
```

If a project does not have a `pyproject.toml` file containing a `build-system`
section, it will be assumed to have the following backend settings:
section, and contains a `setup.py` it will be assumed to have the following
backend settings:

```toml
[build-system]
Expand Down
127 changes: 0 additions & 127 deletions docs/html/reference/build-system/index.md

This file was deleted.

124 changes: 0 additions & 124 deletions docs/html/reference/build-system/setup-py.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/html/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interoperability standards that pip utilises/implements.
```{toctree}
:titlesonly:
build-system/index
build-system
requirement-specifiers
requirements-file-format
installation-report
Expand Down
28 changes: 0 additions & 28 deletions docs/html/reference/requirements-file-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ and two {ref}`--find-links <install_--find-links>` locations:

The options which can be applied to individual requirements are:

- {ref}`--global-option <install_--global-option>`
- {ref}`--config-settings <install_--config-settings>`
- `--hash` (for {ref}`Hash-checking mode`)

Expand Down Expand Up @@ -150,30 +149,3 @@ You can now store sensitive data (tokens, keys, etc.) in environment variables
and only specify the variable name for your requirements, letting pip lookup
the value at runtime. This approach aligns with the commonly used
[12-factor configuration pattern](https://12factor.net/config).


## Influencing the build system

```{danger}
This disables the use of wheels (cached or otherwise). This could mean that builds will be slower, less deterministic, less reliable and may not behave correctly upon installation.

This mechanism is only preserved for backwards compatibility and should be considered deprecated. A future release of pip may drop these options.
```

The `--global-option` option is used to pass options to `setup.py`.

```{attention}
These options are highly coupled with how pip invokes setuptools using the {doc}`../reference/build-system/setup-py` build system interface. It is not compatible with newer {doc}`../reference/build-system/pyproject-toml` build system interface.

This is will not work with other build-backends or newer setup.cfg-only projects.
```

If you have a declaration like:

FooProject >= 1.2 --global-option="--no-user-cfg"

The above translates roughly into running FooProject's `setup.py` script as:

python setup.py --no-user-cfg install

Note that the only way of giving more than one option to `setup.py` is through multiple `--global-option` options.
Loading