Bug 1730712: Ensure virtualenv up-to-date before activation r=ahal

Rather than requiring that consumers remember to `ensure()` before
calling `activate()`, we can do so automatically during activation.
There isn't a valid use case in which we want obsolete virtualenvs to be
activateable.

Usages of `MozSiteManager` have been updated accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D129688
This commit is contained in:
Mitchell Hentges
2021-11-17 20:54:25 +00:00
parent 8c45456312
commit 3b6ca7e679
4 changed files with 4 additions and 4 deletions

View File

@@ -84,9 +84,10 @@ def python(
requirements.pths_as_absolute(command_context.topsrcdir)
)
else:
command_context.virtualenv_manager.ensure()
if not no_activate:
command_context.virtualenv_manager.activate()
else:
command_context.virtualenv_manager.ensure()
python_path = command_context.virtualenv_manager.python_path
if requirements:
command_context.virtualenv_manager.install_pip_requirements(