diff --git a/tools/wpt/virtualenv.py b/tools/wpt/virtualenv.py index b27529da7a7e0c9..61de936b7679e0f 100644 --- a/tools/wpt/virtualenv.py +++ b/tools/wpt/virtualenv.py @@ -49,7 +49,13 @@ def start(self): self.activate() def install(self, *requirements): - call(self.pip_path, "install", *requirements) + # `--prefer-binary` guards against race conditions when installation + # occurs while packages are in the process of being published. + call(self.pip_path, "install", "--prefer-binary", *requirements) def install_requirements(self, requirements_path): - call(self.pip_path, "install", "-r", requirements_path) + # `--prefer-binary` guards against race conditions when installation + # occurs while packages are in the process of being published. + call( + self.pip_path, "install", "--prefer-binary", "-r", requirements_path + )