| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,10 +38,7 @@ init: | |||
| 38 | 38 | ||
| 39 | 39 | install: | |
| 40 | 40 | # install conda and deps | |
| 41 | - - ps: ".\\ci\\install.ps1" | ||
| 42 | - - "%CONDA_BLD%\\Scripts\\conda config --set show_channel_urls true --set always_yes true --set changeps1 false" | ||
| 43 | - - "%CONDA_BLD%\\Scripts\\conda update -q conda" | ||
| 44 | - - "%CONDA_BLD%\\Scripts\\conda info -a" | ||
| 41 | + - ps: .\ci\install_miniconda.ps1 | ||
| 45 | 42 | ||
| 46 | 43 | # install for wheels | |
| 47 | 44 | - "%PYTHON%\\python.exe -m pip install --upgrade pip" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ | |||
| 5 | 5 | $MINICONDA_URL = "http://repo.continuum.io/miniconda/" | |
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | - function DownloadMiniconda ($python_version, $platform_suffix) { | ||
| 8 | + function DownloadMiniconda($python_version, $platform_suffix) { | ||
| 9 | 9 | $webclient = New-Object System.Net.WebClient | |
| 10 | 10 | $filename = "Miniconda3-latest-Windows-" + $platform_suffix + ".exe" | |
| 11 | 11 | $url = $MINICONDA_URL + $filename | |
@@ -20,30 +20,30 @@ function DownloadMiniconda ($python_version, $platform_suffix) { | |||
| 20 | 20 | # Download and retry up to 3 times in case of network transient errors. | |
| 21 | 21 | Write-Host "Downloading" $filename "from" $url | |
| 22 | 22 | $retry_attempts = 2 | |
| 23 | - for($i=0; $i -lt $retry_attempts; $i++){ | ||
| 23 | + for ($i=0; $i -lt $retry_attempts; $i++) { | ||
| 24 | 24 | try { | |
| 25 | 25 | $webclient.DownloadFile($url, $filepath) | |
| 26 | 26 | break | |
| 27 | 27 | } | |
| 28 | - Catch [Exception]{ | ||
| 28 | + catch [Exception] { | ||
| 29 | 29 | Start-Sleep 1 | |
| 30 | 30 | } | |
| 31 | - } | ||
| 32 | - if (Test-Path $filepath) { | ||
| 33 | - Write-Host "File saved at" $filepath | ||
| 34 | - } else { | ||
| 35 | - # Retry once to get the error message if any at the last try | ||
| 36 | - $webclient.DownloadFile($url, $filepath) | ||
| 37 | - } | ||
| 38 | - return $filepath | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + if (Test-Path $filepath) { | ||
| 34 | + Write-Host "File saved at" $filepath | ||
| 35 | + } else { | ||
| 36 | + # Retry once to get the error message if any at the last try | ||
| 37 | + $webclient.DownloadFile($url, $filepath) | ||
| 38 | + } | ||
| 39 | + return $filepath | ||
| 39 | 40 | } | |
| 40 | 41 | ||
| 41 | 42 | ||
| 42 | - function InstallMiniconda ($python_version, $architecture, $python_home) { | ||
| 43 | - Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home | ||
| 43 | + function InstallMiniconda($python_version, $architecture, $python_home) { | ||
| 44 | + Write-Host "Installing Python $python_version $architecture bit to $python_home" | ||
| 44 | 45 | if (Test-Path $python_home) { | |
| 45 | - Write-Host $python_home "already exists, skipping." | ||
| 46 | - # return $false | ||
| 46 | + Write-Host "$python_home already exists, skipping." | ||
| 47 | 47 | } | |
| 48 | 48 | if ($architecture -match "32") { | |
| 49 | 49 | $platform_suffix = "x86" | |
@@ -52,13 +52,13 @@ function InstallMiniconda ($python_version, $architecture, $python_home) { | |||
| 52 | 52 | } | |
| 53 | 53 | ||
| 54 | 54 | $filepath = DownloadMiniconda $python_version $platform_suffix | |
| 55 | - Write-Host "Installing" $filepath "to" $python_home | ||
| 55 | + Write-Host "Installing $filepath to $python_home" | ||
| 56 | 56 | $install_log = $python_home + ".log" | |
| 57 | 57 | $args = "/S /D=$python_home" | |
| 58 | 58 | Write-Host $filepath $args | |
| 59 | 59 | Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru | |
| 60 | 60 | if (Test-Path $python_home) { | |
| 61 | - Write-Host "Python $python_version ($architecture) installation complete" | ||
| 61 | + Write-Host "Python $python_version $architecture bit installation complete" | ||
| 62 | 62 | } else { | |
| 63 | 63 | Write-Host "Failed to install Python in $python_home" | |
| 64 | 64 | Get-Content -Path $install_log | |
@@ -67,27 +67,29 @@ function InstallMiniconda ($python_version, $architecture, $python_home) { | |||
| 67 | 67 | } | |
| 68 | 68 | ||
| 69 | 69 | ||
| 70 | - function InstallCondaPackages ($python_home, $spec) { | ||
| 70 | + function InstallCondaPackages($python_home, $spec) { | ||
| 71 | 71 | $conda_path = $python_home + "\Scripts\conda.exe" | |
| 72 | 72 | $args = "install --yes " + $spec | |
| 73 | - Write-Host ("conda " + $args) | ||
| 73 | + Write-Host ("conda " + $args) -ForegroundColor "Green" | ||
| 74 | 74 | Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru | |
| 75 | 75 | } | |
| 76 | 76 | ||
| 77 | 77 | ||
| 78 | - function UpdateConda ($python_home) { | ||
| 78 | + function UpdateConda($python_home) { | ||
| 79 | 79 | $conda_path = $python_home + "\Scripts\conda.exe" | |
| 80 | - Write-Host "Updating conda..." | ||
| 80 | + Write-Host "Updating conda..." -ForegroundColor "Green" | ||
| 81 | 81 | $args = "update --yes conda" | |
| 82 | 82 | Write-Host $conda_path $args | |
| 83 | 83 | Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru | |
| 84 | 84 | } | |
| 85 | 85 | ||
| 86 | 86 | ||
| 87 | - function main () { | ||
| 87 | + function main() { | ||
| 88 | + Write-Host "Starting install_miniconda.ps1" -ForegroundColor "Green" | ||
| 88 | 89 | InstallMiniconda $env:CONDA_BLD_VERSION $env:CONDA_BLD_ARCH $env:CONDA_BLD | |
| 89 | 90 | UpdateConda $env:CONDA_BLD | |
| 90 | 91 | InstallCondaPackages $env:CONDA_BLD "conda-build jinja2 anaconda-client" | |
| 92 | + Write-Host "Completed install_miniconda.ps1" -ForegroundColor "Green" | ||
| 91 | 93 | } | |
| 92 | 94 | ||
| 93 | 95 | main | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,38 +43,25 @@ | |||
| 43 | 43 | SET COMMAND_TO_RUN=%* | |
| 44 | 44 | SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows | |
| 45 | 45 | ||
| 46 | - :: Extract the major and minor versions, and allow for the minor version to be | ||
| 47 | - :: more than 9. This requires the version number to have two dots in it. | ||
| 46 | + :: CONDA_PY style, such as 27, 34 etc. | ||
| 48 | 47 | SET MAJOR_PYTHON_VERSION=%CONDA_PY:~0,1% | |
| 49 | - | ||
| 50 | - IF "%CONDA_PY:~2,1%" == "" ( | ||
| 51 | - :: CONDA_PY style, such as 27, 34 etc. | ||
| 52 | - SET MINOR_PYTHON_VERSION=%CONDA_PY:~1,1% | ||
| 53 | - ) ELSE ( | ||
| 54 | - IF "%CONDA_PY:~3,1%" == "." ( | ||
| 55 | - SET MINOR_PYTHON_VERSION=%CONDA_PY:~2,1% | ||
| 56 | - ) ELSE ( | ||
| 57 | - SET MINOR_PYTHON_VERSION=%CONDA_PY:~2,2% | ||
| 58 | - ) | ||
| 59 | - ) | ||
| 48 | + SET MINOR_PYTHON_VERSION=%CONDA_PY:~1,1% | ||
| 60 | 49 | ||
| 61 | 50 | :: Based on the Python version, determine what SDK version to use, and whether | |
| 62 | 51 | :: to set the SDK for 64-bit. | |
| 63 | 52 | IF %MAJOR_PYTHON_VERSION% == 2 ( | |
| 64 | 53 | SET WINDOWS_SDK_VERSION="v7.0" | |
| 65 | 54 | SET SET_SDK_64=Y | |
| 66 | - ) ELSE ( | ||
| 67 | - IF %MAJOR_PYTHON_VERSION% == 3 ( | ||
| 68 | - SET WINDOWS_SDK_VERSION="v7.1" | ||
| 69 | - IF %MINOR_PYTHON_VERSION% LEQ 4 ( | ||
| 70 | - SET SET_SDK_64=Y | ||
| 71 | - ) ELSE ( | ||
| 72 | - SET SET_SDK_64=N | ||
| 73 | - ) | ||
| 55 | + ) ELSE IF %MAJOR_PYTHON_VERSION% == 3 ( | ||
| 56 | + SET WINDOWS_SDK_VERSION="v7.1" | ||
| 57 | + IF %MINOR_PYTHON_VERSION% LEQ 4 ( | ||
| 58 | + SET SET_SDK_64=Y | ||
| 74 | 59 | ) ELSE ( | |
| 75 | - ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" | ||
| 76 | - EXIT /B 1 | ||
| 60 | + SET SET_SDK_64=N | ||
| 77 | 61 | ) | |
| 62 | + ) ELSE ( | ||
| 63 | + ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" | ||
| 64 | + EXIT /B 1 | ||
| 78 | 65 | ) | |
| 79 | 66 | ||
| 80 | 67 | IF "%PYTHON_ARCH%"=="64" ( | |
| Back | FazBrowse Home | New Git URL |
0 commit comments