Simplified installation process of PlatformIO // Resolve #274

This commit is contained in:
Ivan Kravets
2015-08-22 17:09:28 +03:00
parent 8e42c4ae31
commit a1483c263f
9 changed files with 63 additions and 73 deletions
+5 -10
View File
@@ -59,17 +59,12 @@ function InstallPython ($python_version, $architecture, $python_home) {
function InstallPip ($python_home) {
$pip_path = $python_home + "/Scripts/pip.exe"
$python_path = $python_home + "/python.exe"
if (-not(Test-Path $pip_path)) {
Write-Host "Installing pip..."
$webclient = New-Object System.Net.WebClient
$webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH)
Write-Host "Executing:" $python_path $GET_PIP_PATH
Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru
} else {
Write-Host "pip already installed."
}
Write-Host "Installing pip..."
$webclient = New-Object System.Net.WebClient
$webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH)
Write-Host "Executing:" $python_path $GET_PIP_PATH
Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru
}
function InstallPackage ($python_home, $pkg) {
+5 -9
View File
@@ -87,21 +87,17 @@ def install_pip():
def install_pypi_packages(packages):
for pipargs in packages:
print (exec_python_cmd([
"-m", "pip.__main__" if sys.version_info < (2, 7, 0) else "pip",
"install", "-U"] + pipargs))
print (exec_python_cmd([
"-m", "pip.__main__" if sys.version_info < (2, 7, 0) else "pip",
"install", "-U"] + packages))
def main():
steps = [
("Fixing Windows %PATH% Environment", fix_winpython_pathenv, []),
("Installing Python Package Manager", install_pip, []),
("Installing PlatformIO and dependencies", install_pypi_packages, [
[["setuptools"], ["platformio"], [
"--egg", "http://dl.platformio.org/scons.zip"
]]
])
("Installing PlatformIO and dependencies", install_pypi_packages,
[["setuptools", "platformio"]])
]
if not IS_WINDOWS: