Bug 1623544 - Install python3-pip on Debian during bootstrap; r=firefox-build-system-reviewers,rstewart

Differential Revision: https://phabricator.services.mozilla.com/D68160

--HG--
extra : moz-landing-system : lando
This commit is contained in:
byron jones 2020-03-25 15:31:09 +00:00
parent ff6f9dd6a8
commit 8559ac6776
2 changed files with 20 additions and 6 deletions

View File

@ -124,14 +124,15 @@ class DebianBootstrapper(
have_python3 = any([self.which('python3'), self.which('python3.6'),
self.which('python3.5')])
python3_packages = self.check_output(
['apt-cache', 'pkgnames', 'python3'], universal_newlines=True)
python3_packages = python3_packages.splitlines()
if not have_python3:
python3_packages = self.check_output(
['apt-cache', 'pkgnames', 'python3'], universal_newlines=True)
python3_packages = python3_packages.splitlines()
if not have_python3 and 'python3' in python3_packages:
packages.extend(['python3', 'python3-dev'])
if 'python3' in python3_packages:
packages.extend(['python3', 'python3-dev'])
if not self.which('pip3') and 'python3-pip' in python3_packages:
packages.append('python3-pip')
self.apt_install(*packages)

View File

@ -37,6 +37,19 @@ class PhabricatorCommandProvider(MachCommandBase):
)
sys.exit(1)
# pip3 is part of Python since 3.4, however some distros choose to
# remove core components from languages. While bootstrap should
# install pip3 it isn't always possible, so display a nicer error
# message if pip3 is missing.
if not shutil.which("pip3"):
self.log(
logging.ERROR,
"pip3_not_installed",
{},
"`pip3` is not installed. Try running `mach bootstrap`.",
)
sys.exit(1)
command = ["pip3", "install", "--upgrade", "MozPhab"]
if (