Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop installing setuptools and wheel #243

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Stop installing setuptools and wheel #243

merged 1 commit into from
Aug 7, 2024

Commits on Aug 7, 2024

  1. Stop installing setuptools and wheel

    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-isolation
    pypa/pip#10717
    python/cpython#101039
    pypa/get-pip#218
    astral-sh/uv#2252
    
    GUS-W-16437776.
    edmorley committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    27b15e3 View commit details
    Browse the repository at this point in the history