Fix virtualenv python interpreter used (#98)

* Add virtualenv version logging
* Force using requested python interpreter
This commit is contained in:
Idan Tene 2022-02-27 11:25:25 +02:00 committed by GitHub
parent 92b5ce61a0
commit e3e6a1dda8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,7 @@ class VirtualenvPip(SystemPip, PackageManager):
return Argv.conditional_flag( return Argv.conditional_flag(
self.session.config["agent.package_manager.system_site_packages"], self.session.config["agent.package_manager.system_site_packages"],
"--system-site-packages", "--system-site-packages",
) ) + ("--python", self._bin)
def install_flags(self): def install_flags(self):
""" """
@ -64,6 +64,10 @@ class VirtualenvPip(SystemPip, PackageManager):
Only valid if instantiated with path. Only valid if instantiated with path.
Use self.python as self.bin does not exist. Use self.python as self.bin does not exist.
""" """
# Log virtualenv information to stdout
self.session.command(
self.python, "-m", "virtualenv", "--version"
)
self.session.command( self.session.command(
self.python, "-m", "virtualenv", self.path, *self.create_flags() self.python, "-m", "virtualenv", self.path, *self.create_flags()
).check_call() ).check_call()