-
Notifications
You must be signed in to change notification settings - Fork 229
Powershell changes #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The choice of bitness depends on the bitness of the OS and 32-bit OSes can run on 64-bit architecture so the check for OS-bitness is more accurate.
The proposed name clarifies what the variable is better.
Originally, opening up a new PowerShell session solved the problem of changes to $env:PATH not taking effect in the current session. However, this can be solved by updating the current session's PATH variable. `Cleanup` is no longer necessary, so the only remaining statement (to remove the downloaded Python MSI) is extracted out. Additionally, this step is performed only if the Python MSI was downloaded.
Installing in the background might obfuscate errors during installation. Through this change, the user will be prompted to click through the MSI GUI.
Although the Python MSI adds Python to PATH, the change will only take effect in a new session. This change adds Python to the current session so that the user does not have to close their terminal.
scripts/install-python.ps1
Outdated
| Update-UserEnvironmentPath | ||
| Remove-Item $PythonInstaller | ||
| } else { | ||
| Write-Host "Python 3.7.3 is already installed. Exiting." -ForegroundColor Green |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" Exiting." is redundant.
install-python.ps1
Outdated
| function Download-Python { | ||
| $url = Get-PythonInstallationTarget | ||
| $client = New-Object System.Net.WebClient | ||
| $client.DownloadFile($url, $PythonInstaller) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this fails, returning $True doesn't make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is eliminate in a future commit.
…value Rename: "Get" is a PowerShell-approved verb, whereas "Assert" is not. This change also modifies the return contract of `Get-PythonExecutable` such that it returns the Python 3.7.3 executables found rather than the indication of whether a Python 3.7.3 executable exists.
When the user exits from the Python MSI prematurely, it returns the exit code 1602.
21b4fb4 to
b9a390a
Compare
The PS1 script invokes: - install-python.ps1 - ebcli_installer.py if the Python installer exists with code 0 The PS1 script installs instructs ebcli_installer.py to install `eb` in the user's home directory (within a .ebcli-virtual-env folder). The BAT script wraps the PS1 script.
Future steps may rely on the existence of Python. If Python installation fails, subsequent statements will fail. To preclude subsequent failures, the script will exit immediately following failure to install.
b9a390a to
7cb76dc
Compare
1. Overview
This PR:
Refer to the independent commit messages for precise details.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
2. Installation Prerequisites
git3. Testing:
Follow installation instructions laid out here.
3.1.
bundled_installer:install-python.ps1) regardless of whether Python is in PATH or notebhas been installed through this means or any other at a prior point if the Python installer returns normally.3.2.
install-python.ps1:virtualenvif Python installation succeeds or is skippedvirtualenveven if it is already in PATHvirtualenvif Python installation failspythonis in the current PowerShell session.pythonis present in the current PowerShell session and the future sessions.3.3.
ebcli_installer.py:Refer to the steps here.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.