Revert "run_checks: Run pep257 via subprocess."
This reverts commit 380537d49c
.
Conflicts:
scripts/run_checks.py
This is needed because it seems pep257 doesn't install a binary on Windows.
This commit is contained in:
parent
1e8729eac7
commit
dc9263a77c
@ -102,6 +102,27 @@ def run(name, target=None, print_version=False):
|
||||
return status
|
||||
|
||||
|
||||
def check_pep257(target):
|
||||
"""Run pep257 checker with args passed."""
|
||||
# pylint: disable=assignment-from-no-return,no-member
|
||||
args = _get_args('pep257')
|
||||
sys.argv = ['pep257', target]
|
||||
if args is not None:
|
||||
sys.argv += args
|
||||
try:
|
||||
if hasattr(pep257, 'run_pep257'):
|
||||
# newer pep257 versions
|
||||
status = pep257.run_pep257()
|
||||
else:
|
||||
# older pep257 versions
|
||||
status = pep257.main(*pep257.parse_options())
|
||||
print()
|
||||
return status
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
return None
|
||||
|
||||
|
||||
def check_unittest():
|
||||
"""Run the unittest checker."""
|
||||
suite = unittest.TestLoader().discover('.')
|
||||
@ -231,7 +252,7 @@ def _get_checkers(args):
|
||||
# "Dynamic" checkers which exist once for each target.
|
||||
for target in config.get('DEFAULT', 'targets').split(','):
|
||||
checkers[target] = collections.OrderedDict([
|
||||
('pep257', functools.partial(run, 'pep257', target, args.version)),
|
||||
('pep257', functools.partial(check_pep257, target)),
|
||||
('flake8', functools.partial(run, 'flake8', target, args.version)),
|
||||
('vcs', functools.partial(check_vcs_conflict, target)),
|
||||
('pylint', functools.partial(run, 'pylint', target, args.version)),
|
||||
|
Loading…
Reference in New Issue
Block a user