You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the buildpack performs a system site-packages install of not
only pip, but also setuptools and wheel. This has historically been
necessary for pip to be able to build source distributions (sdists) for
packages that don't ship with compatible wheels.
However:
- Thanks to PEP 518, packages can now (and many already do) specify an
explicit build backend using `[build-system]` in their
`pyproject.toml`. The dependencies specified in that config (such as
setuptools and wheel) will be installed by pip into an isolated and
ephemeral build environment as part of the source distribution build
process. Such packages therefore don't need/use globally installed
setuptools/wheel versions.
- As of pip v22.1, pip will now default to the isolated build environment
mode (along with a fallback legacy setuptools build backend), if the
setuptools package isn't installed globally. This means that packages
that haven't yet migrated to a PEP 518 `pyproject.toml` build backend
config can still build even if setuptools isn't installed globally.
There are a small number of rarely used packages in the wild that
aren't compatible with build isolation mode, however, these typically
require more build dependencies than just setuptools, which means they
wouldn't have worked with this buildpack anyway.
As such, it's no longer necessary for us to install setuptools and wheel
globally. This matches the behaviour of the `venv` and `ensurepip` modules
in Python 3.12+, where setuptools and wheel installation has also been
removed. And it also matches the default behaviour of Poetry too, whose
`install --sync` command removes any implicitly installed packages in the
current environment (other than pip).
See:
https://peps.python.org/pep-0518/https://pip.pypa.io/en/stable/reference/build-system/https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/#build-isolationpypa/pip#10717python/cpython#101039pypa/get-pip#218astral-sh/uv#2252GUS-W-16437776.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [Unreleased]
9
9
10
+
### Removed
11
+
12
+
- Stopped explicitly installing setuptools and wheel. They will be automatically installed by pip into an isolated build environment if they are required for building a package. ([#243](https://github.com/heroku/buildpacks-python/pull/243))
0 commit comments