aboutsummaryrefslogtreecommitdiff
path: root/src/python/install.sh
diff options
context:
space:
mode:
authorJosh Spicer <joshspicer@github.com>2022-06-03 17:46:25 +0300
committerGitHub <noreply@github.com>2022-06-03 17:46:25 +0300
commitc12a205ab8e195541acfe0cb654b4888e16ea05c (patch)
treea1a45ac7dec9f31fa62972a65414b6d6fd1fd60d /src/python/install.sh
parent283b8e1f8f5dec9e54199c107e772ce56683769e (diff)
Pass options via environment variables (#39)
* up to docker-in-docker converted * first pass at the rest of the features (and bash linting and updated CLI * move shell linter to own file * rename feature.json -> devcontainer-feature.json * continue on error * continue on error in right spot * formatting * fix AZ_VERSION * update python * restore variable name * update linter actions, fix dind/dfd/desktop scripts, add test-scenaerios * add tree because I like tree * glob for shell linter * fix test-scenarios * shell linter * more shell helper
Diffstat (limited to 'src/python/install.sh')
-rwxr-xr-xsrc/python/install.sh28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/python/install.sh b/src/python/install.sh
index ba0aa0a..ed273c0 100755
--- a/src/python/install.sh
+++ b/src/python/install.sh
@@ -6,18 +6,18 @@
#
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/python.md
# Maintainer: The VS Code and Codespaces Teams
-#
-# Syntax: ./python-debian.sh [Python Version] [Python intall path] [PIPX_HOME] [non-root user] [Update rc files flag] [install tools flag] [Use Oryx if available flag] [Optimize when building from source flag]
-
-PYTHON_VERSION=${1:-"latest"} # 'system' checks the base image first, else installs 'latest'
-PYTHON_INSTALL_PATH=${2:-"/usr/local/python"}
-export PIPX_HOME=${3:-"/usr/local/py-utils"}
-USERNAME=${4:-"automatic"}
-UPDATE_RC=${5:-"true"}
-INSTALL_PYTHON_TOOLS=${6:-"true"}
-USE_ORYX_IF_AVAILABLE=${7:-"true"}
-OPTIMIZE_BUILD_FROM_SOURCE=${8-"false"}
-OVERRIDE_DEFAULT_VERSION=${9:-"true"}
+
+PYTHON_VERSION=${VERSION:-"latest"} # 'system' checks the base image first, else installs 'latest'
+INSTALL_PYTHON_TOOLS=${INSTALL_PYTHON_TOOLS:-"true"}
+OPTIMIZE_BUILD_FROM_SOURCE=${OPTIMIZE:-"false"}
+PYTHON_INSTALL_PATH=${INSTALL_PATH:-"/usr/local/python"}
+OVERRIDE_DEFAULT_VERSION=${OVERRIDE_DEFAULT_VERSION:-"true"}
+
+export PIPX_HOME=${PIPX_HOME:-"/usr/local/py-utils"}
+
+USERNAME=${USERNAME:-"automatic"}
+UPDATE_RC=${UPDATE_RC:-"true"}
+USE_ORYX_IF_AVAILABLE=${USE_ORYX_IF_AVAILABLE:-"true"}
DEFAULT_UTILS=("pylint" "flake8" "autopep8" "black" "yapf" "mypy" "pydocstyle" "pycodestyle" "bandit" "pipenv" "virtualenv")
PYTHON_SOURCE_GPG_KEYS="64E628F8D684696D B26995E310250568 2D347EA6AA65421D FB9921286F5E1540 3A5CA953F73C700D 04C367C218ADD4FF 0EDDC5F26A45C816 6AF053F07D9DC8D2 C9BE28DEE6DF025C 126EB563A74B06BF D9866941EA5BBD71 ED9D77D5"
@@ -41,7 +41,7 @@ chmod +x /etc/profile.d/00-restore-env.sh
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
USERNAME=""
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
- for CURRENT_USER in ${POSSIBLE_USERS[@]}; do
+ for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do
if id -u ${CURRENT_USER} > /dev/null 2>&1; then
USERNAME=${CURRENT_USER}
break
@@ -365,7 +365,7 @@ if ! type pipx > /dev/null 2>&1; then
/tmp/pip-tmp/bin/pipx install --pip-args=--no-cache-dir pipx
pipx_path="/tmp/pip-tmp/bin/"
fi
-for util in ${DEFAULT_UTILS[@]}; do
+for util in "${DEFAULT_UTILS[@]}"; do
if ! type ${util} > /dev/null 2>&1; then
${pipx_path}pipx install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' ${util}
else