From 5a791f37f4751eea006a8ab56bd7ff5aebdb75ea Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Wed, 18 Oct 2017 12:19:37 -0400 Subject: [PATCH] tools/lint: install PyYAML if not available. Fixes gh-1286 --- tools/lint/lint.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/lint/lint.py b/tools/lint/lint.py index 9d72fe38b6..20f2152daf 100755 --- a/tools/lint/lint.py +++ b/tools/lint/lint.py @@ -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