diff --git a/images/linux/scripts/installers/1604/hosted-tool-cache.sh b/images/linux/scripts/installers/1604/hosted-tool-cache.sh index f49cffd66..487f7cd53 100644 --- a/images/linux/scripts/installers/1604/hosted-tool-cache.sh +++ b/images/linux/scripts/installers/1604/hosted-tool-cache.sh @@ -27,13 +27,19 @@ for setup in $setups; do cd $original_directory; done; -DocumentInstalledItem "Python (available through the [setup-python](https://github.com/actions/setup-python/blob/master/README.md) task)" +DocumentInstalledItem "Python (available through the [setup-python](https://github.com/actions/setup-python/blob/master/README.md) action)" pythons=$(ls $AGENT_TOOLSDIRECTORY/Python) for python in $pythons; do DocumentInstalledItemIndent "Python $python" done; -DocumentInstalledItem "Ruby (available through the [setup-ruby](https://github.com/actions/setup-ruby/blob/master/README.md) task)" +# PyPy is also configured using the setup-python action +pypys=$(ls $AGENT_TOOLSDIRECTORY/PyPy) +for pypy in $pypys; do + DocumentInstalledItemIndent "PyPy $pypy" +done; + +DocumentInstalledItem "Ruby (available through the [setup-ruby](https://github.com/actions/setup-ruby/blob/master/README.md) action)" rubys=$(ls $AGENT_TOOLSDIRECTORY/Ruby) for ruby in $rubys; do DocumentInstalledItemIndent "Ruby $ruby" diff --git a/images/linux/scripts/installers/1804/hosted-tool-cache.sh b/images/linux/scripts/installers/1804/hosted-tool-cache.sh index 0fb87013a..0aca19df3 100644 --- a/images/linux/scripts/installers/1804/hosted-tool-cache.sh +++ b/images/linux/scripts/installers/1804/hosted-tool-cache.sh @@ -27,13 +27,19 @@ for setup in $setups; do cd $original_directory; done; -DocumentInstalledItem "Python (available through the [setup-python](https://github.com/actions/setup-python/blob/master/README.md) task)" +DocumentInstalledItem "Python (available through the [setup-python](https://github.com/actions/setup-python/blob/master/README.md) action)" pythons=$(ls $AGENT_TOOLSDIRECTORY/Python) for python in $pythons; do DocumentInstalledItemIndent "Python $python" done; -DocumentInstalledItem "Ruby (available through the [setup-ruby](https://github.com/actions/setup-ruby/blob/master/README.md) task)" +# PyPy is also configured using the setup-python action +pypys=$(ls $AGENT_TOOLSDIRECTORY/PyPy) +for pypy in $pypys; do + DocumentInstalledItemIndent "PyPy $pypy" +done; + +DocumentInstalledItem "Ruby (available through the [setup-ruby](https://github.com/actions/setup-ruby/blob/master/README.md) action)" rubys=$(ls $AGENT_TOOLSDIRECTORY/Ruby) for ruby in $rubys; do DocumentInstalledItemIndent "Ruby $ruby" diff --git a/images/linux/scripts/installers/python.sh b/images/linux/scripts/installers/python.sh index 4b56cf159..ab475cc91 100644 --- a/images/linux/scripts/installers/python.sh +++ b/images/linux/scripts/installers/python.sh @@ -1,7 +1,7 @@ #!/bin/bash ################################################################################ ## File: python.sh -## Desc: Installs Python 2/3 and related tools (pip, pypy) +## Desc: Installs Python 2/3 ################################################################################ # Source the helpers for use with the script @@ -10,47 +10,9 @@ source $HELPER_SCRIPTS/document.sh # Install Python, Python 3, pip, pip3 apt-get install -y --no-install-recommends python python-dev python-pip python3 python3-dev python3-pip -# Install PyPy 2.7 to $AGENT_TOOLSDIRECTORY -wget -q -P /tmp https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v7.1.0-linux64.tar.bz2 -tar -x -C /tmp -f /tmp/pypy2.7-v7.1.0-linux64.tar.bz2 -rm /tmp/pypy2.7-v7.1.0-linux64.tar.bz2 -mkdir -p $AGENT_TOOLSDIRECTORY/PyPy/2.7.13 -mv /tmp/pypy2.7-v7.1.0-linux64 $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64 -touch $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64.complete - -# add pypy to PATH by default -ln -s $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy /usr/local/bin/pypy -# pypy will be the python in PATH when its tools cache directory is prepended to PATH -# PEP 394-style symlinking; don't bother with minor version -ln -s $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/python2 -ln -s $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/python2 $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/python - -# Install latest Pip for PyPy2 -$AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy -m ensurepip -$AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy -m pip install --ignore-installed pip - -# Install PyPy 3.5 to $AGENT_TOOLSDIRECTORY -wget -q -P /tmp https://bitbucket.org/pypy/pypy/downloads/pypy3.5-v7.0.0-linux64.tar.bz2 -tar -x -C /tmp -f /tmp/pypy3.5-v7.0.0-linux64.tar.bz2 -rm /tmp/pypy3.5-v7.0.0-linux64.tar.bz2 -mkdir -p $AGENT_TOOLSDIRECTORY/PyPy/3.5.3 -mv /tmp/pypy3.5-v7.0.0-linux64 $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64 -touch $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64.complete - -# add pypy3 to PATH by default -ln -s $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/pypy3 /usr/local/bin/pypy3 -# pypy3 will be the python in PATH when its tools cache directory is prepended to PATH -# PEP 394-style symlinking; don't bother with minor version -ln -s $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/pypy3 $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/python3 -ln -s $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/python3 $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/python - -# Install latest Pip for PyPy3 -$AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/pypy3 -m ensurepip -$AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/pypy3 -m pip install --ignore-installed pip - # Run tests to determine that the software installed as expected echo "Testing to make sure that script performed as expected, and basic scenarios work" -for cmd in python pip pypy python3 pip3 pypy3; do +for cmd in python python3; do if ! command -v $cmd; then echo "$cmd was not installed or not found on PATH" exit 1 @@ -60,8 +22,4 @@ done # Document what was added to the image echo "Lastly, documenting what we added to the metadata file" DocumentInstalledItem "Python ($(python --version 2>&1))" -DocumentInstalledItem "pip ($(pip --version))" -DocumentInstalledItem "Python3 ($(python3 --version))" -DocumentInstalledItem "pip3 ($(pip3 --version))" -DocumentInstalledItem "PyPy2 ($(pypy --version 2>&1 | grep PyPy))" -DocumentInstalledItem "PyPy3 ($(pypy3 --version 2>&1 | grep PyPy))" +DocumentInstalledItem "Python3 ($(python3 --version))" \ No newline at end of file