<p dir="ltr">Earlier versions of PEP 453 proposed bootstrapping pip into a Python 2.7 maintenance release in addition to including it with Python 3.4. </p>
<p dir="ltr">That part of the proposal proved to be controversial, so we dropped it from the original PEP in order to focus on meeting the Python 3.4 specific release deadlines. This also had the benefit of working out the kinks in the bootstrapping processing as part of the Python 3.4 release cycle.</p>

<p dir="ltr">However, we still think we should start providing pip by default to Python 2.7 users as well, at least as part of the Windows and Mac OS X installers.</p>
<p dir="ltr">One notable difference from PEP 453 is that because there is no venv module in 2.7, and hence no integration between venv and ensurepip, we can give redistributors the option of just disabling ensurepip entirely and redirecting users to platform specific installation tools.</p>

<p dir="ltr">Regards,<br>
Nick.</p>
<p dir="ltr">======================</p>
<p dir="ltr">PEP: 477<br>
Title: Backport ensurepip (PEP 453) to Python 2.7<br>
Version: $Revision$<br>
Last-Modified: $Date$<br>
Author: Donald Stufft <<a href="mailto:donald@stufft.io">donald@stufft.io</a>><br>
        Nick Coghlan <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>><br>
Status: Active<br>
Type: Process<br>
Content-Type: text/x-rst<br>
Created: 26-Aug-2014<br>
Post-History: 1-Sep-2014<br></p>
<p dir="ltr">Abstract<br>
========</p>
<p dir="ltr">This PEP proposes that the ``ensurepip`` module, added to Python 3.4 by PEP<br>
453, be backported to Python 2.7. It also proposes that automatic invocation<br>
of ``ensurepip`` be added to the Python 2.7 Windows and OSX installers. However<br>
it does **not** propose that automatic invocation be added to the ``Makefile``.</p>
<p dir="ltr">It also proposes that the documentation changes for the package distribution<br>
and installation guides be updated to match that in 3.4, which references using<br>
the ``ensurepip`` module to bootstrap the installer.<br></p>
<p dir="ltr">Rationale<br>
=========</p>
<p dir="ltr">Python 2.7 is effectively a LTS release of Python which represents the end of<br>
the 2.x series and there is still a very large contingent of users whom are<br>
still using Python 2.7 as their primary version. These users, in order to<br>
participate in the wider Python ecosystem, must manually attempt to go out and<br>
find the correct way to bootstrap the packaging tools.</p>
<p dir="ltr">It is the opinion of this PEP that making it as easy as possible for end users<br>
to participate in the wider Python ecosystem is important for 3 primary<br>
reasons:</p>
<p dir="ltr">1. The Python 2.x to 3.x migration has a number of painpoints that are eased by<br>
   a number of third party modules such as six [#six]_, modernize [#modernize]_,<br>
   or future [#future]_. However relying on these tools requires that everyone<br>
   who uses the project have a tool to install these packages.<br>
2. In addition to tooling to aid in migration from Python 2.x to 3.x, there are<br>
   also a number of modules that are *new* in Python 3 for which there are<br>
   backports available on PyPI. This can also aid in the ability for people<br>
   to write 2.x and 3.x compatible software as well as enable them to use some<br>
   of the newer features of Python 3 on Python 2.<br>
3. Users also will need a number of tools in order to create python packages<br>
   that conform to the newer standards that are being proposed. Things like<br>
   setuptools [#setuptools]_, Wheel [#wheel]_, and twine [#twine]_ are enabling<br>
   a safer, faster, and more reliable packaging tool chain. These tools can be<br>
   difficult for people to use if first they must be told how to go out and<br>
   install the package manager.<br>
4. One of Pythons biggest strengths is in the huge ecosystem of libraries and<br>
   projects that have been built on top of it, most of which are distributed<br>
   through PyPI. However in order to benefit from this wide ecosystem<br>
   meaningfully requires end users, some of which are going to be new, to make<br>
   a decision on which package manager they should get, how to get it, and then<br>
   finally actually installing it first.</p>
<p dir="ltr">Furthermore, alternative implementations of Python are recognizing the benefits<br>
of PEP 453 and both PyPy and Jython have plans to backport ensurepip to their<br>
2.7 runtimes.<br></p>
<p dir="ltr">Automatic Invocation<br>
====================</p>
<p dir="ltr">PEP 453 has ``ensurepip`` automatically invoked by default in the ``Makefile``<br>
and the Windows and OSX Installers. This allowed it to ensure that, by default,<br>
all users would get Python with pip already installed. This PEP however<br>
believes that while this is fine for the Python 2.7 Windows and Mac OS X<br>
installers it is *not* ok for the Python 2.7 ``Makefile`` in general.</p>
<p dir="ltr">The primary consumers of the ``Makefile`` are downstream package managers which<br>
distribute Python themselves. These downstream distributors typically do not<br>
want pip to be installed via ``ensurepip`` and would prefer that end users<br>
install it with their own package manager. Not invoking ``ensurepip``<br>
automatically from the ``Makefile`` would allow these distributors to simply<br>
ignore the fact that ``ensurepip`` has been backported and still not end up<br>
with pip installed via it.</p>
<p dir="ltr">The primary consumers of the OSX and Windows installers are end users who are<br>
attempting to install Python on their own machine. There is not a package<br>
manager available where these users can install pip into their Python through<br>
a more supported mechanism. For this reason it is the belief of this PEP that<br>
installing by default on OSX and Windows is the best course of action.<br></p>
<p dir="ltr">Documentation<br>
=============</p>
<p dir="ltr">As part of this PEP, the updated packaging distribution and installation<br>
guides for Python 3.4 would be backported to Python 2.7.<br></p>
<p dir="ltr">Disabling ensurepip by Downstream Distributors<br>
==============================================</p>
<p dir="ltr">Due to its use in the ``venv`` module, downstream distributors cannot disable<br>
the ``ensurepip`` module in Python 3.4. However since Python 2.7 has no such<br>
module it is explicitly allowed for downstream distributors to patch the<br>
``ensurepip`` module to prevent it from installing anything.</p>
<p dir="ltr">If a downstream distributor wishes to disable ``ensurepip`` completely in<br>
Python 2.7, they should still at least provide the module and allow<br>
`python -m ensurepip` style invocation. However it should raise errors or<br>
otherwise exit with a non-zero exit code and print out an error on stderr<br>
directing users to what they can/should use instead of ``ensurepip``.<br></p>
<p dir="ltr">References<br>
==========</p>
<p dir="ltr">.. [#six] `six.py <<a href="https://pypi.python.org/pypi/six">https://pypi.python.org/pypi/six</a>>`__<br>
.. [#modernize] `modernize <<a href="https://pypi.python.org/pypi/modernize">https://pypi.python.org/pypi/modernize</a>>`__<br>
.. [#future] `python-future <<a href="https://pypi.python.org/pypi/future">https://pypi.python.org/pypi/future</a>>`__<br>
.. [#setuptools] `setuptools <<a href="https://pypi.python.org/pypi/setuptools">https://pypi.python.org/pypi/setuptools</a>>`__<br>
.. [#wheel] `Wheel <<a href="https://pypi.python.org/pypi/wheel">https://pypi.python.org/pypi/wheel</a>>`__<br>
.. [#twine] `twine <<a href="https://pypi.python.org/pypi/twine">https://pypi.python.org/pypi/twine</a>>`__<br></p>
<p dir="ltr">Copyright<br>
=========</p>
<p dir="ltr">This document has been placed in the public domain.<br></p>
<p dir="ltr"> <br>
..<br>
   Local Variables:<br>
   mode: indented-text<br>
   indent-tabs-mode: nil<br>
   sentence-end-double-space: t<br>
   fill-column: 70<br>
   coding: utf-8<br>
   End:</p>