tools/lint: install PyYAML if not available. Fixes gh-1286

This commit is contained in:
Rick Waldron 2017-10-18 12:19:37 -04:00
parent e760413d3f
commit 5a791f37f4
1 changed files with 17 additions and 0 deletions

View File

@ -4,6 +4,23 @@
import argparse
import sys
import pip
import pip.req
try:
__import__('yaml')
except ImportError:
for item in pip.req.parse_requirements("./tools/lint/requirements.txt", session="test262"):
if isinstance(item, pip.req.InstallRequirement):
requirement = item.name
if len(str(item.req.specifier)) > 0:
requirement = "{}{}".format(requirement, item.req.specifier)
# print(requirement)
pip.main(['install', requirement])
from lib.collect_files import collect_files
from lib.checks.features import CheckFeatures