diff --git a/images/linux/scripts/installers/pipx-packages.sh b/images/linux/scripts/installers/pipx-packages.sh index 825d1edc..6a5fe4df 100644 --- a/images/linux/scripts/installers/pipx-packages.sh +++ b/images/linux/scripts/installers/pipx-packages.sh @@ -8,11 +8,17 @@ export PATH="$PATH:/opt/pipx_bin" toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json" -pipx_packages=$(jq -r ".pipx[]" $toolset) +pipx_packages=$(jq ".pipx[] .package" $toolset) for package in $pipx_packages; do - echo "Install $package" - pipx install $package + python_path=$(jq ".pipx[] | select(.package == $package) .python" $toolset) + if [ "$python_path" = "default" ]; then + echo "Install $package into default python" + pipx install $package + else + echo "Install $package into python $python_path" + pipx install $package --python $python_path + fi done # Run tests to determine that the software installed as expected diff --git a/images/linux/toolsets/toolset-1804.json b/images/linux/toolsets/toolset-1804.json index cd327dec..f466f9f0 100644 --- a/images/linux/toolsets/toolset-1804.json +++ b/images/linux/toolsets/toolset-1804.json @@ -190,7 +190,13 @@ ] }, "pipx": [ - "yamllint", - "aws-sam-cli" + { + "package": "yamllint", + "python": "default" + }, + { + "package": "aws-sam-cli", + "python": "/opt/hostedtoolcache/Python/3.7*/x64/bin/python3.7" + } ] } diff --git a/images/linux/toolsets/toolset-2004.json b/images/linux/toolsets/toolset-2004.json index add68395..6bf5ece7 100644 --- a/images/linux/toolsets/toolset-2004.json +++ b/images/linux/toolsets/toolset-2004.json @@ -153,7 +153,13 @@ ] }, "pipx": [ - "yamllint", - "aws-sam-cli" + { + "package": "yamllint", + "python": "default" + }, + { + "package": "aws-sam-cli", + "python": "/opt/hostedtoolcache/Python/3.7*/x64/bin/python3.7" + } ] }