Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 28 additions & 34 deletions pipenv/utils/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,41 +326,35 @@ def abort(msg=""):
elif not project.s.PIPENV_YES:
# Non-interactive session without PIPENV_YES, proceed with installation
abort()
else:
# Tell the user we're installing Python.
console.print(
f"[bold]Installing [green]CPython[/green] {version} with {installer.cmd}[/bold]"
)
console.print("(this may take a few minutes)[bold]...[/bold]")
with console.status(
"Installing python...", spinner=project.s.PIPENV_SPINNER
):
try:
c = installer.install(version)
except InstallerError as e:
err.print(
environments.PIPENV_SPINNER_FAIL_TEXT.format("Failed...")
)
err.print("Something went wrong...")
err.print(f"[cyan]{e.err}[/cyan]")
else:
console.print(
environments.PIPENV_SPINNER_OK_TEXT.format("Success!")
)
# Print the results, in a beautiful blue...
err.print(f"[cyan]{c.stdout}[/cyan]")
# Find the newly installed Python, hopefully.
version = str(version)
path_to_python = find_a_system_python(version)

# Tell the user we're installing Python.
console.print(
f"[bold]Installing [green]CPython[/green] {version} with {installer.cmd}[/bold]"
)
console.print("(this may take a few minutes)[bold]...[/bold]")
with console.status("Installing python...", spinner=project.s.PIPENV_SPINNER):
try:
assert python_version(path_to_python) == version
except AssertionError:
err.print(
"[bold][red]Warning:[/red][/bold]"
" The Python you just installed is not available "
"on your [bold]PATH[/bold], apparently."
)
sys.exit(1)
c = installer.install(version)
except InstallerError as e:
err.print(environments.PIPENV_SPINNER_FAIL_TEXT.format("Failed..."))
err.print("Something went wrong...")
err.print(f"[cyan]{e.err}[/cyan]")
else:
console.print(environments.PIPENV_SPINNER_OK_TEXT.format("Success!"))
# Print the results, in a beautiful blue...
err.print(f"[cyan]{c.stdout}[/cyan]")
# Find the newly installed Python, hopefully.
version = str(version)
path_to_python = find_a_system_python(version)
try:
assert python_version(path_to_python) == version
except AssertionError:
err.print(
"[bold][red]Warning:[/red][/bold]"
" The Python you just installed is not available "
"on your [bold]PATH[/bold], apparently."
)
sys.exit(1)
return path_to_python


Expand Down
Loading