Bug 1723031: Allow flexible dependency-specification in the Mach venv r=ahal

There's some trade-offs in play here: the major issue is that we can't
pin `psutil`'s because it's pre-installed on some CI workers with a
different version (5.4.2).

Additionally, we can't "just" bump that version, because CI workers jump
between different revisions to do work, so a specific pinned version
won't work when we try to update such a package.

One option is that we could avoid validating package versions in CI, but
then that will cause surprises (heck, I didn't know we were still using
`psutil==5.4.2` instead of `5.8.0` until now). By doing validation, we
make it more explicit and avoid accidentally depending on behaviour of
too new of such a package.

However, in most cases, we manage the installation environment and can
pin dependencies. So, I've made the top-level Mach virtualenv the _only_
one that is able to use requirement specifiers other than "==".

Differential Revision: https://phabricator.services.mozilla.com/D122889
This commit is contained in:
Mitchell Hentges
2021-09-27 20:27:20 +00:00
parent 479bb74d98
commit 3920476f20
7 changed files with 82 additions and 42 deletions

View File

@@ -73,6 +73,7 @@ def python(
requirements = MachEnvRequirements.from_requirements_definition(
command_context.topsrcdir,
False,
True,
os.path.join(
command_context.topsrcdir, "build", "mach_virtualenv_packages.txt"
),