Backed out 4 changesets (bug 1460402) for lint failure on intl/locales/en-US/hyphenation/hyph_en_US.dic. CLOSED TREE

Backed out changeset c2e8fbd72ca6 (bug 1460402)
Backed out changeset 3676e913dbff (bug 1460402)
Backed out changeset bb12ffd4b96e (bug 1460402)
Backed out changeset 3e50885329c4 (bug 1460402)
This commit is contained in:
Dorel Luca
2018-05-11 00:47:34 +03:00
parent aca5b4f245
commit a5dd93f753
10 changed files with 64 additions and 70 deletions

View File

@@ -6,13 +6,13 @@ import json
import os
import platform
import signal
import subprocess
import sys
from collections import defaultdict
from mozprocess import ProcessHandlerMixin
from mozlint import result
from mozlint.util import pip
from mozlint.pathutils import get_ancestors_by_name
@@ -98,6 +98,32 @@ class Flake8Process(ProcessHandlerMixin):
signal.signal(signal.SIGINT, orig)
def _run_pip(*args):
"""
Helper function that runs pip with subprocess
"""
try:
subprocess.check_output([os.path.join(bindir, 'pip')] + list(args),
stderr=subprocess.STDOUT)
return True
except subprocess.CalledProcessError as e:
print(e.output)
return False
def reinstall_flake8():
"""
Try to install flake8 at the target version, returns True on success
otherwise prints the otuput of the pip command and returns False
"""
if _run_pip('install', '-U',
'--require-hashes', '-r',
FLAKE8_REQUIREMENTS_PATH):
return True
return False
def run_process(config, cmd):
proc = Flake8Process(config, cmd)
proc.run()
@@ -109,7 +135,7 @@ def run_process(config, cmd):
def setup(root):
if not pip.reinstall_program(FLAKE8_REQUIREMENTS_PATH):
if not reinstall_flake8():
print(FLAKE8_INSTALL_ERROR)
return 1