added pipx and yamllint

This commit is contained in:
Nikita Bykov
2020-10-07 09:29:37 +03:00
parent 28a8724352
commit 5d96d50f59
11 changed files with 89 additions and 8 deletions

View File

@@ -22,7 +22,6 @@ binst_common_utils=(
github/gh/gh
p7zip
ant
yamllint
aria2
)

View File

@@ -0,0 +1,25 @@
source ~/utils/utils.sh
export PATH="$PATH:/opt/pipx_bin"
toolset=get_toolset_path
pipx_packages=$(jq -r ".pipx[] .package" $toolset)
for package in $pipx_packages; do
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 -r ".pipx[] | select(.package == \"$package\") .cmd" $toolset)
if ! command -v $cmd; then
echo "$package was not installed"
exit 1
fi
done

View File

@@ -11,3 +11,15 @@ echo "Brew Installing Python 2"
/usr/local/bin/brew tap-new local/python2
FORMULA_PATH=$(/usr/local/bin/brew extract python@2 local/python2 | grep "Homebrew/Library/Taps")
/usr/local/bin/brew install $FORMULA_PATH
echo "Installing pipx"
export PIPX_BIN_DIR=/opt/pipx_bin
export PIPX_HOME=/opt/pipx
brew install pipx
python3 -m pipx ensurepath
echo "export PIPX_BIN_DIR=${PIPX_BIN_DIR}" >> "${HOME}/.bashrc"
echo "export PIPX_HOME=${PIPX_HOME}" >> "${HOME}/.bashrc"
echo 'export PATH="$PIPX_BIN_DIR:$PATH"' >> "${HOME}/.bashrc"

View File

@@ -96,6 +96,10 @@ function Get-PipVersion {
return "${versionPart1} ${versionPart2} ${versionPart3}"
}
function Get-PipxVersion {
return "Pipx $(pipx --version 2> $null)"
}
function Get-NVMNodeVersionList {
$nvmPath = Join-Path $env:HOME ".nvm" "nvm.sh"
$nvmInitCommand = ". ${nvmPath} > /dev/null 2>&1 || true"

View File

@@ -81,6 +81,7 @@ $npmVersion = Run-Command "npm --version"
$yarnVersion = Run-Command "yarn --version"
$nugetVersion = Run-Command "nuget help" | Select-Object -First 1 | Take-Part -Part 2
$pip3Version = Get-PipVersion -Version 3
$pipxVersion = Get-PipxVersion
$condaVersion = Invoke-Expression "conda --version"
$rubyGemsVersion = Run-Command "gem --version"
$composerVersion = Run-Command "composer --version" | Take-Part -Part 2
@@ -97,6 +98,7 @@ if ($os.IsLessThanBigSur) {
$markdown += New-MDList -Style Unordered -Lines @(
"Pip ${pip3Version}",
$pipxVersion,
$bundlerVersion,
"Carthage ${carthageVersion}",
"CocoaPods ${cocoaPodsVersion}",

View File

@@ -196,6 +196,13 @@
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}",
"scripts": "./provision/core/toolset.ps1"
},
{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"scripts": [
"./provision/core/pipx-packages.sh"
]
},
{
"type": "shell",
"execute_command": "ruby {{ .Path }}",

View File

@@ -195,6 +195,13 @@
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}",
"scripts": "./provision/core/toolset.ps1"
},
{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"scripts": [
"./provision/core/pipx-packages.sh"
]
},
{
"type": "shell",
"execute_command": "ruby {{ .Path }}",

View File

@@ -192,6 +192,13 @@
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} pwsh -f {{ .Path }}",
"scripts": "./provision/core/toolset.ps1"
},
{
"type": "shell",
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"scripts": [
"./provision/core/pipx-packages.sh"
]
},
{
"type": "shell",
"execute_command": "ruby {{ .Path }}",

View File

@@ -257,5 +257,11 @@
"1.15.*"
]
}
],
"pipx": [
{
"package": "yamllint",
"cmd": "yamllint"
}
]
}

View File

@@ -166,5 +166,11 @@
"1.15.*"
]
}
],
"pipx": [
{
"package": "yamllint",
"cmd": "yamllint"
}
]
}

View File

@@ -91,5 +91,11 @@
"1.15.*"
]
}
],
"pipx": [
{
"package": "yamllint",
"cmd": "yamllint"
}
]
}