[Distutils] PEP453 - Explicit bootstrapping of pip in Python installations

Brett Cannon brett at python.org
Fri Aug 30 17:39:09 CEST 2013

On Fri, Aug 30, 2013 at 9:44 AM, Donald Stufft <donald at stufft.io> wrote:

> [SNIP]
> Pre-installation
> ================
> During the installation of Python from Python.org ``python -m getpip``
> should
> be executed. Leaving people using the Windows or OSX installers with a
> working
> copy of pip once the installation has completed.

"should be executed, leaving".

> The exact method of this is
> left up to the maintainers of the installers however if the bootstrapping
> is
> optional it should be opt out rather than opt in.

"installers, however"
"opt-in", "opt-out"

> The Windows and OSX installers distributed by Python.org will automatically
> attempt to run ``python -m getpip`` by default however the ``make install``
> and ``make altinstall`` commands of the source distribution will not.

Is the plan to leave getpip entirely out of the source distribution or to
have it checked into hg.python.org/cpython?

> Keeping the pip bootstrapping as a separate step for make based
> installations should minimize the changes CPython redistributors need to
> make to their build processes. Avoiding the layer of indirection through
> make for the getpip invocation also ensures those installing from a custom
> source build can easily force an offline installation of pip, install it
> from a private index server, or skip installing pip entirely.
> Python Virtual Environments
> ===========================
> Python 3.3 included a standard library approach to virtual Python
> environments
> through the ``venv`` module. Since it's release it has become clear that
> very
> few users have been willing to use this feature in part due to the lack of
> an installer present by default inside of the virtual environment. They
> have
> instead opted to continue using the ``virtualenv`` package which *does*
> include
> pip installed by default.
> To make the ``venv`` more useful to users it will be modified to issue the
> pip bootstrap by default inside of the new environment while creating it.
> This
> will allow people the same convenience inside of the virtual environment as
> this PEP provides outside of it as well as bringing the ``venv`` module
> closer
> to feature parity with the external ``virtualenv`` package making it a more
> suitable replacement.

What about a --without-pip option?

> Recommendations for Downstream Distributors
> ===========================================
> A common source of Python installations are through downstream distributors
> such as the various Linux Distributions [#ubuntu]_ [#debian]_ [#fedora]_,
> package managers [#homebrew]_, or python specific tools [#conda]_. In
> order to
> provide a consistent, user friendly experience to all users of Python
> regardless of how they attained Python this PEP recommends and asks that
> downstream distributors:
> * Ensure that whenever Python is installed pip is also installed.
>   * This may take the form of separate with dependencies on each either so
> that
>     installing the python package installs the pip package and installing
> the
>     pip package installs the Python package.
> * Do not remove the bundled copy of pip.
>   * This is required for offline installation of pip into a virtual
> environment.
>   * This is similar to the existing ``virtualenv`` package for which many
>     downstream distributors have already made exception to the common
>     "debundling" policy.
>   * This does mean that if ``pip`` needs to be updated due to a security
>     issue, so does the bundled version in the ``getpip`` bootstrap module
> * Migrate build systems to utilize `pip`_ and `Wheel`_ instead of directly
>   using ``setup.py``.
>   * This will ensure that downstream packages can utilize the new formats
> which
>     will not have a ``setup.py`` easier.
> * Ensure that all features of this PEP continue to work with any
> modifications
>   made.
>   * Online installation of the latest version of pip into a global or
> virtual
>     python environment using ``python -m getpip``.
>   * Offline installation of the bundled version of pip into a global or
> virtual
>     python environment using ``python -m getpip``.
>   * ``pip install --upgrade pip`` in a global installation should not
> affect
>     any already created virtual environments.
>   * ``pip install --upgrade pip`` in a virtual environment should not
> affect
>     the global installation.
> Policies & Governance
> =====================
> The maintainers of the bundled software and the CPython core team will work
> together in order to address the needs of both. The bundled software will
> still
> remain external to CPython and this PEP does not include CPython subsuming
> the
> responsibilities or decisions of the bundled software. This PEP aims to
> decrease the burden on end users wanting to use third party packages and
> the
> decisions inside it are pragmatic ones that represent the trust that the
> Python community has placed in the authors and maintainers of the bundled
> software.

This should specify if it is ever expected to be kept in the CPython repo
(and thus distributed in the source tarball) or if it will simply be
bundled in the installers (and thus never included with the source).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130830/caf4f8a3/attachment.html>

More information about the Distutils-SIG mailing list