Skip to content

Commit

Permalink
Merge pull request #163 from sol-eng/patch-python-root-warning
Browse files Browse the repository at this point in the history
Switch to an env variable to ignore root warning
  • Loading branch information
tnederlof authored May 11, 2023
2 parents 454ab46 + 4c97b42 commit 55d7453
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/jupyter/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func InstallJupyter(pythonPath string) error {

// Install various Jupyter related packages from PyPI
func InstallJupyterAndComponents(pythonPath string) error {
licenseCommand := pythonPath + " -m pip install --no-warn-script-location --disable-pip-version-check --root-user-action=ignore jupyter jupyterlab rsp_jupyter rsconnect_jupyter workbench_jupyterlab"
licenseCommand := "PIP_ROOT_USER_ACTION=ignore " + pythonPath + " -m pip install --no-warn-script-location --disable-pip-version-check jupyter jupyterlab rsp_jupyter rsconnect_jupyter workbench_jupyterlab"
err := system.RunCommand(licenseCommand, true, 2)
if err != nil {
return fmt.Errorf("issue installing Jupyter with the command '%s': %w", licenseCommand, err)
Expand Down Expand Up @@ -111,7 +111,7 @@ func installIpykernel(pythonPath string) error {
return fmt.Errorf("issue removing python from the path: %w", err)
}

installCommand := basePath + "/pip install --no-warn-script-location --disable-pip-version-check --root-user-action=ignore ipykernel"
installCommand := "PIP_ROOT_USER_ACTION=ignore " + basePath + "/pip install --no-warn-script-location --disable-pip-version-check ipykernel"
err = system.RunCommand(installCommand, true, 1)
if err != nil {
return fmt.Errorf("issue installing ipykernel with the command '%s': %w", installCommand, err)
Expand Down
2 changes: 1 addition & 1 deletion internal/languages/python.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ func DownloadAndInstallPython(pythonVersion string, osType config.OperatingSyste
}

func UpgradePythonTools(pythonVersion string) error {
upgradeCommand := "/opt/python/" + pythonVersion + "/bin/pip install --upgrade --no-warn-script-location --disable-pip-version-check --root-user-action=ignore pip setuptools wheel"
upgradeCommand := "PIP_ROOT_USER_ACTION=ignore /opt/python/" + pythonVersion + "/bin/pip install --upgrade --no-warn-script-location --disable-pip-version-check pip setuptools wheel"
err := system.RunCommand(upgradeCommand, true, 2)
if err != nil {
return fmt.Errorf("issue upgrading pip, setuptools and wheel for Python with the command '%s': %w", upgradeCommand, err)
Expand Down

0 comments on commit 55d7453

Please sign in to comment.