Commit 48e21915 by Sébastien Eustace

Avoid calling system pip when pip missing from venv

parent a54e29aa
...@@ -31,11 +31,8 @@ class DebugInfoCommand(Command): ...@@ -31,11 +31,8 @@ class DebugInfoCommand(Command):
env_python_version = ".".join(str(s) for s in env.version_info[:3]) env_python_version = ".".join(str(s) for s in env.version_info[:3])
self.output.title("Virtualenv") self.output.title("Virtualenv")
self.output.listing( listing = [
[ "<info>Python</info>: <comment>{}</>".format(env_python_version),
"<info>Python</info>: <comment>{}</>".format(
env_python_version
),
"<info>Implementation</info>: <comment>{}</>".format( "<info>Implementation</info>: <comment>{}</>".format(
env.python_implementation env.python_implementation
), ),
...@@ -43,7 +40,13 @@ class DebugInfoCommand(Command): ...@@ -43,7 +40,13 @@ class DebugInfoCommand(Command):
env.path if env.is_venv() else "NA" env.path if env.is_venv() else "NA"
), ),
] ]
if env.is_venv():
listing.append(
"<info>Valid</info>: <{tag}>{is_valid}</{tag}>".format(
tag="comment" if env.is_sane() else "error", is_valid=env.is_sane()
)
) )
self.output.listing(listing)
self.line("") self.line("")
......
...@@ -302,8 +302,6 @@ class Env(object): ...@@ -302,8 +302,6 @@ class Env(object):
Return path to the given executable. Return path to the given executable.
""" """
bin_path = (self._bin_dir / bin).with_suffix(".exe" if self._is_windows else "") bin_path = (self._bin_dir / bin).with_suffix(".exe" if self._is_windows else "")
if not bin_path.exists():
return bin
return str(bin_path) return str(bin_path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment