Bug 1712151: Add test to verify virtualenv compatibility r=ahal

This adds two main compatibility guarantees:
1. Vendored dependencies <=> Pypi-downloaded dependencies
2. Global Mach dependencies <=> command-specific dependencies

As part of this, a new `vendored:` action was added to the virtualenv
definition format. Otherwise similar to `pth:` paths, `vendored:`
packages are assumed to be "pip install"-able.

Some validation (the `.dist-info`/`PKG-INFO` checks) was added to
`requirements.py` to verify that `pth:` and `vendored:` are correctly
used.

Differential Revision: https://phabricator.services.mozilla.com/D122900
This commit is contained in:
Mitchell Hentges
2021-09-28 14:59:28 +00:00
parent 2e31db3870
commit 03bd43fee8
10 changed files with 261 additions and 85 deletions

View File

@@ -185,7 +185,8 @@ def _activate_python_environment(topsrcdir):
os.path.join(topsrcdir, "build", "mach_virtualenv_packages.txt"),
)
sys.path[0:0] = [
os.path.join(topsrcdir, pth.path) for pth in requirements.pth_requirements
os.path.join(topsrcdir, pth.path)
for pth in requirements.pth_requirements + requirements.vendored_requirements
]