-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build-install.ps1 for Win10 compatibility
Fix tools/build-install.ps1 to work with Windows 10 and python 3.7.4. Python 3.7.4 has an odd choice of pip install location. So add helper tools/ci/PATH-add-pip-site.ps1.
- Loading branch information
Showing
3 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# PATH-add-pip-site.ps1 | ||
|
||
# update PATH with potential pip install locations on a Windows host | ||
function add_pip_site_PATH { | ||
# presumes $PYTHON is set to the desired python interpreter | ||
$usersite = & $PYTHON -c 'import site; print(site.USER_SITE);' | ||
$userbase = & $PYTHON -c 'import site; print(site.USER_BASE);' | ||
$userbasescript1 = Join-Path -Path "$userbase" -ChildPath "Script" | ||
# --user install location on Windows 10 is annoyingly specific and not | ||
# available in site module | ||
$userbasescript2 = Join-Path -Path "$userbase" -ChildPath (& $PYTHON -c 'import sys; print(\"Python\" + str(sys.version_info[0]) + str(sys.version_info[1]));') | ||
$userbasescript3 = Join-Path -Path "$userbasescript2" -ChildPath "Scripts" | ||
$paths = $env:PATH.Split($([IO.Path]::PathSeparator)) | ||
ForEach ($path_ in @("$usersite", | ||
"$userbase", | ||
"$userbasescript1", | ||
"$userbasescript2", | ||
"$userbasescript3")) | ||
{ | ||
if ($paths -contains $path_) { | ||
Write-Debug "skip adding to env:PATH '$path_'" | ||
continue | ||
} | ||
$env:PATH += "$([IO.Path]::PathSeparator)$path_" | ||
Write-Debug "added to env:PATH '$path_'" | ||
} | ||
} | ||
|
||
add_pip_site_PATH |