travis-ci/travis-cookbooks — pull request #304 by dstufft (2014-04-30 11:36:01+00:00)
Title: Rework Python Support Outside of a Virtualenv

#303 fixed an issue where calling ``pythonX.Y`` outside of a virtualenv for that Python no longer worked.

This replaces that fix with a different one.

There are 3 "classes" of command that all python installs support, those are ``python``, ``pythonX``, and ``pythonX.Y``. This allows you to specify "I want the default Python", "I want the default Python 2", or "I want the default Python 2.7". However the fix in #303 only fixes the ``pythonX.Y`` case. Additionally there are other commands that ship with Python which do not work with the #303 strategy.

This PR instead drops the symlinking all together and instead just adjusts the ``$PATH`` variable so that the bin dir for each pyenv installed Python shows up on the ``$PATH``. It uses the order they were defined in the attributes to decide what order to put them on the ``$PATH`` allowing for easy specification about which Python should be the default, or the default for a particular series.

This PR also adds the non standard ``pythonX.Y.Z`` and ``pypy-X.Y.Z`` commands in order to support multiple micro releases within the same series (e.g. ``python2.7.6`` and ``python2.7.3``).