mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Ubuntu] Implement new directories hierarchy (#8627)
This commit is contained in:
committed by
GitHub
parent
d1f2c9a3be
commit
5d40b1e213
34
images/ubuntu/scripts/build/python.sh
Normal file
34
images/ubuntu/scripts/build/python.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash -e
|
||||
################################################################################
|
||||
## File: python.sh
|
||||
## Desc: Installs Python 2/3
|
||||
################################################################################
|
||||
|
||||
set -e
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/etc-environment.sh
|
||||
source $HELPER_SCRIPTS/os.sh
|
||||
|
||||
# Install Python, Python 3, pip, pip3
|
||||
apt-get install -y --no-install-recommends python3 python3-dev python3-pip python3-venv
|
||||
|
||||
# Install pipx
|
||||
# Set pipx custom directory
|
||||
export PIPX_BIN_DIR=/opt/pipx_bin
|
||||
export PIPX_HOME=/opt/pipx
|
||||
python3 -m pip install pipx
|
||||
python3 -m pipx ensurepath
|
||||
# Update /etc/environment
|
||||
setEtcEnvironmentVariable "PIPX_BIN_DIR" $PIPX_BIN_DIR
|
||||
setEtcEnvironmentVariable "PIPX_HOME" $PIPX_HOME
|
||||
prependEtcEnvironmentPath $PIPX_BIN_DIR
|
||||
# Test pipx
|
||||
if ! command -v pipx; then
|
||||
echo "pipx was not installed or not found on PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Adding this dir to PATH will make installed pip commands are immediately available.
|
||||
prependEtcEnvironmentPath '$HOME/.local/bin'
|
||||
|
||||
invoke_tests "Tools" "Python"
|
||||
Reference in New Issue
Block a user