From c333c3424e17cbac765ccda5ab84888742dfa56c Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Tue, 2 May 2023 16:30:04 +0000 Subject: [PATCH] Drop pylint-1.5 R=gavinmak@google.com Bug: 1353487 Change-Id: Ifbe09b60f891d585edbd5831e4cb3c5a97f1fe8b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4491423 Commit-Queue: Josip Sokcevic Reviewed-by: Gavin Mak --- presubmit_canned_checks.py | 37 +++++++----------- pylint-1.5 | 79 -------------------------------------- pylint-1.5.bat | 12 ------ 3 files changed, 13 insertions(+), 115 deletions(-) delete mode 100755 pylint-1.5 delete mode 100644 pylint-1.5.bat diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 213ba3305..005b92866 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -1109,16 +1109,15 @@ def GetPylint(input_api, The default files_to_check enforces looking only at *.py files. - Currently only pylint version '1.5', '2.6' and '2.7' are supported. + Currently only pylint version '2.6' and '2.7' are supported. """ files_to_check = tuple(files_to_check or (r'.*\.py$', )) files_to_skip = tuple(files_to_skip or input_api.DEFAULT_FILES_TO_SKIP) extra_paths_list = extra_paths_list or [] - assert version in ('1.5', '2.6', '2.7'), \ + assert version in ('2.6', '2.7'), \ 'Unsupported pylint version: %s' % version - python2 = (version == '1.5') if input_api.is_committing or input_api.no_diffs: error_type = output_api.PresubmitError @@ -1207,12 +1206,11 @@ def GetPylint(input_api, if input_api.sys.version_info.major != 2: kwargs['stdin'] = kwargs['stdin'].encode('utf-8') - return input_api.Command( - name='Pylint (%s)' % description, - cmd=cmd, - kwargs=kwargs, - message=error_type, - python3=not python2) + return input_api.Command(name='Pylint (%s)' % description, + cmd=cmd, + kwargs=kwargs, + message=error_type, + python3=True) # pylint's cycle detection doesn't work in parallel, so spawn a second, # single-threaded job for just that check. However, only do this if there are @@ -1220,23 +1218,14 @@ def GetPylint(input_api, # Some PRESUBMITs explicitly mention cycle detection. if len(files) >= files_per_job and not any( 'R0401' in a or 'cyclic-import' in a for a in extra_args): - tests = [ - GetPylintCmd(files, ["--disable=cyclic-import"], True), - GetPylintCmd(files, ["--disable=all", "--enable=cyclic-import"], False), - ] - else: - tests = [ - GetPylintCmd(files, [], True), + return [ + GetPylintCmd(files, ["--disable=cyclic-import"], True), + GetPylintCmd(files, ["--disable=all", "--enable=cyclic-import"], False), ] - if version == '1.5': - # Warn users about pylint-1.5 deprecation - tests.append( - output_api.PresubmitPromptWarning( - 'pylint-1.5 is being run on %s and is deprecated, please switch ' - 'to 2.7 before 2022-07-11 (add version=\'2.7\' to RunPylint call)' - % input_api.PresubmitLocalPath())) - return tests + return [ + GetPylintCmd(files, [], True), + ] def RunPylint(input_api, *args, **kwargs): diff --git a/pylint-1.5 b/pylint-1.5 deleted file mode 100755 index 9c394ce20..000000000 --- a/pylint-1.5 +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env vpython -# Copyright 2019 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Note: We use tags here instead of refs because refs will always hit the -# network to see if there are any updates. - -# [VPYTHON:BEGIN] -# # Third party dependencies. These are only listed because pylint itself needs -# # them. Feel free to add/remove anything here. -# -# wheel: < -# name: "infra/python/wheels/configparser-py2_py3" -# version: "version:3.5.0" -# > -# wheel: < -# name: "infra/python/wheels/futures-py2_py3" -# version: "version:3.1.1" -# > -# wheel: < -# name: "infra/python/wheels/isort-py2_py3" -# version: "version:4.3.4" -# > -# wheel: < -# name: "infra/python/wheels/wrapt/${vpython_platform}" -# version: "version:1.10.11" -# > -# wheel: < -# name: "infra/python/wheels/backports_functools_lru_cache-py2_py3" -# version: "version:1.5" -# > -# wheel: < -# name: "infra/python/wheels/lazy-object-proxy/${vpython_platform}" -# version: "version:1.3.1" -# > -# wheel: < -# name: "infra/python/wheels/singledispatch-py2_py3" -# version: "version:3.4.0.3" -# > -# wheel: < -# name: "infra/python/wheels/enum34-py2" -# version: "version:1.1.6" -# > -# wheel: < -# name: "infra/python/wheels/mccabe-py2_py3" -# version: "version:0.6.1" -# > -# wheel: < -# name: "infra/python/wheels/six-py2_py3" -# version: "version:1.15.0" -# > -# -# # Pylint extensions. -# -# wheel: < -# name: "infra/python/wheels/pylint-quotes-py2_py3" -# version: "version:0.1.8" -# > -# -# # Pylint dependencies. -# -# wheel: < -# name: "infra/python/wheels/astroid-py2_py3" -# version: "version:1.4.9" -# > -# -# wheel: < -# name: "infra/python/wheels/pylint-py2_py3" -# version: "version:1.5.6-551505593fa0d9c5372b79c95e3dfe9a" -# > -# [VPYTHON:END] - -import sys - -import pylint_main - -if __name__ == '__main__': - sys.exit(pylint_main.main(sys.argv[1:])) diff --git a/pylint-1.5.bat b/pylint-1.5.bat deleted file mode 100644 index 4153985ed..000000000 --- a/pylint-1.5.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -:: Copyright 2021 The Chromium Authors. All rights reserved. -:: Use of this source code is governed by a BSD-style license that can be -:: found in the LICENSE file. -setlocal - -:: Ensure that "depot_tools" is somewhere in PATH so this tool can be used -:: standalone, but allow other PATH manipulations to take priority. -set PATH=%PATH%;%~dp0 - -:: Defer control. -vpython "%~dp0\pylint-1.5" %*