mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Rework pipx toolset
This commit is contained in:
@@ -11,17 +11,18 @@ toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
|
||||
pipx_packages=$(jq ".pipx[] .package" $toolset)
|
||||
|
||||
for package in $pipx_packages; do
|
||||
python_path=$(jq ".pipx[] | select(.package == $package) .python" $toolset)
|
||||
if [ "$python_path" = "default" ]; then
|
||||
echo "Install $package into default python"
|
||||
pipx install $package
|
||||
else
|
||||
python_version=$(jq -r ".pipx[] | select(.package == $package) .python" $toolset)
|
||||
if [ "$python_version" != "null" ]; then
|
||||
python_path="/opt/hostedtoolcache/Python/$python_version*/x64/bin/python$python_version"
|
||||
echo "Install $package into python $python_path"
|
||||
pipx install $package --python $python_path
|
||||
else
|
||||
echo "Install $package into default python"
|
||||
pipx install $package
|
||||
fi
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
cmd=$(jq ".pipx[] | select(.package == $package) .cmd" $toolset)
|
||||
cmd=$(jq -r ".pipx[] | select(.package == $package) .cmd" $toolset)
|
||||
if ! command -v $cmd; then
|
||||
echo "$package was not installed"
|
||||
exit 1
|
||||
|
||||
@@ -192,12 +192,11 @@
|
||||
"pipx": [
|
||||
{
|
||||
"package": "yamllint",
|
||||
"python": "default",
|
||||
"cmd": "yamllint"
|
||||
},
|
||||
{
|
||||
"package": "aws-sam-cli",
|
||||
"python": "/opt/hostedtoolcache/Python/3.7*/x64/bin/python3.7",
|
||||
"python": "3.7",
|
||||
"cmd": "sam"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -155,12 +155,11 @@
|
||||
"pipx": [
|
||||
{
|
||||
"package": "yamllint",
|
||||
"python": "default",
|
||||
"cmd": "yamllint"
|
||||
},
|
||||
{
|
||||
"package": "aws-sam-cli",
|
||||
"python": "/opt/hostedtoolcache/Python/3.7*/x64/bin/python3.7",
|
||||
"python": "3.7",
|
||||
"cmd": "sam"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user