Diff
Modified: trunk/Tools/ChangeLog (268596 => 268597)
--- trunk/Tools/ChangeLog 2020-10-16 17:45:39 UTC (rev 268596)
+++ trunk/Tools/ChangeLog 2020-10-16 17:49:59 UTC (rev 268597)
@@ -1,3 +1,26 @@
+2020-10-16 Jonathan Bedard <[email protected]>
+
+ [webkitpy] Use webkitcorepy's autoinstaller for plint
+ https://bugs.webkit.org/show_bug.cgi?id=217793
+ <rdar://problem/70356095>
+
+ Rubber-stamped by Aakash Jain.
+
+ * Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Bump version.
+ * Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:
+ (AutoInstall): Support multiple aliases to a single library.
+ (AutoInstall.register):
+ (AutoInstall.install):
+ (AutoInstall.install_everything):
+ * Scripts/webkitpy/__init__.py: Add pylint, map install zope.interface when zope is imported.
+ * Scripts/webkitpy/style/checkers/python.py:
+ (Pylinter.run):
+ * Scripts/webkitpy/thirdparty/__init__.py:
+ (AutoinstallImportHook.find_module): Remove _install_pylint().
+ (AutoinstallImportHook._install_pylint): Deleted.
+ * Scripts/webkitpy/thirdparty/__init___unittest.py:
+ (ThirdpartyTest.test_imports): mechanize and pylint are managed by the new autoinstaller.
+
2020-10-16 Aakash Jain <[email protected]>
[build.webkit.org] buildbot checkconfig fails when passwords.json is missing
Modified: trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py (268596 => 268597)
--- trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py 2020-10-16 17:45:39 UTC (rev 268596)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py 2020-10-16 17:49:59 UTC (rev 268597)
@@ -35,7 +35,7 @@
from webkitcorepy.subprocess_utils import TimeoutExpired, CompletedProcess, run
from webkitcorepy.output_capture import LoggerCapture, OutputCapture, OutputDuplicate
-version = Version(0, 4, 17)
+version = Version(0, 4, 18)
from webkitcorepy.autoinstall import Package, AutoInstall
if sys.version_info > (3, 0):
Modified: trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py (268596 => 268597)
--- trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py 2020-10-16 17:45:39 UTC (rev 268596)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py 2020-10-16 17:49:59 UTC (rev 268597)
@@ -33,6 +33,7 @@
import tempfile
import zipfile
+from collections import defaultdict
from logging import NullHandler
from webkitcorepy import log
from webkitcorepy.version import Version
@@ -309,7 +310,7 @@
index = 'pypi.org'
timeout = 30
version = Version(sys.version_info[0], sys.version_info[1], sys.version_info[2])
- packages = {}
+ packages = defaultdict(list)
manifest = {}
# When sharing an install location, projects may wish to overwrite packages on disk
@@ -435,8 +436,8 @@
package = Package(package)
elif isinstance(package, Package):
if cls.packages.get(package.name):
- if cls.packages.get(package.name).version != package.version:
- raise ValueError('Registered version of {} uses {}, but requested version uses {}'.format(package.name, cls.packages.get(package.name).version, package.version))
+ if cls.packages.get(package.name)[0].version != package.version:
+ raise ValueError('Registered version of {} uses {}, but requested version uses {}'.format(package.name, cls.packages.get(package.name)[0].version, package.version))
return cls.packages.get(package.name)
else:
raise ValueError('Expected package to be str or Package, not {}'.format(type(package)))
@@ -455,22 +456,22 @@
if not os.path.isdir(os.path.join(candidate, package.name)):
continue
sys.path.insert(0, candidate)
- return package
+ return [package]
for alias in package.aliases:
- cls.packages[alias] = package
- cls.packages[package.name] = package
- return package
+ cls.packages[alias].append(package)
+ cls.packages[package.name].append(package)
+ return [package]
@classmethod
def install(cls, package):
- to_install = cls.register(package)
- return to_install.install()
+ return all([to_install.install() for to_install in cls.register(package)])
@classmethod
def install_everything(cls):
- for package in cls.packages.values():
- package.install()
+ for packages in cls.packages.values():
+ for package in packages:
+ package.install()
return None
@classmethod
Modified: trunk/Tools/Scripts/webkitpy/__init__.py (268596 => 268597)
--- trunk/Tools/Scripts/webkitpy/__init__.py 2020-10-16 17:45:39 UTC (rev 268596)
+++ trunk/Tools/Scripts/webkitpy/__init__.py 2020-10-16 17:49:59 UTC (rev 268597)
@@ -41,6 +41,8 @@
AutoInstall.register(Package('genshi', Version(0, 7, 3), pypi_name='Genshi'))
AutoInstall.register(Package('html5lib', Version(1, 1)))
AutoInstall.register(Package('mechanize', Version(0, 4, 5)))
+AutoInstall.register(Package('logilab.common', Version(0, 58, 1), pypi_name='logilab-common', aliases=['logilab']))
+AutoInstall.register(Package('logilab.astng', Version(0, 24, 1), pypi_name='logilab-astng', aliases=['logilab']))
AutoInstall.register(Package('mozprocess', Version(1, 2, 0)))
AutoInstall.register(Package('mozlog', Version(6, 1)))
AutoInstall.register(Package('mozterm', Version(1, 0, 0)))
@@ -51,6 +53,7 @@
# Pytest held to 3.x due to WPT webdriver compatibility
AutoInstall.register(Package('pytest', Version(3, 10, 1)))
AutoInstall.register(Package('pycodestyle', Version(2, 5, 0)))
+AutoInstall.register(Package('pylint', Version(0, 25, 2)))
AutoInstall.register(Package('scandir', Version(1, 10, 0)))
AutoInstall.register(Package('selenium', Version(3, 141, 0)))
AutoInstall.register(Package('toml', Version(0, 10, 1)))
@@ -57,6 +60,6 @@
AutoInstall.register(Package('wcwidth', Version(0, 2, 5)))
AutoInstall.register(Package('webencodings', Version(0, 5, 1)))
AutoInstall.register(Package('zipp', Version(1, 2, 0)))
-AutoInstall.register(Package('zope.interface', Version(5, 1, 0), pypi_name='zope-interface'))
+AutoInstall.register(Package('zope.interface', Version(5, 1, 0), aliases=['zope'], pypi_name='zope-interface'))
AutoInstall.register(Package('webkitscmpy', Version(0, 0, 1)), local=True)
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/python.py (268596 => 268597)
--- trunk/Tools/Scripts/webkitpy/style/checkers/python.py 2020-10-16 17:45:39 UTC (rev 268596)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/python.py 2020-10-16 17:49:59 UTC (rev 268597)
@@ -111,8 +111,9 @@
def run(self, argv):
output = _FilteredStringIO(self.FALSE_POSITIVES)
with OutputCapture():
- from webkitpy.thirdparty.autoinstalled.pylint import lint
- from webkitpy.thirdparty.autoinstalled.pylint.reporters.text import ParseableTextReporter
+ from pylint import lint
+ from pylint.reporters.text import ParseableTextReporter
+
lint.Run(['--rcfile', self._pylintrc] + argv, reporter=ParseableTextReporter(output=output), exit=False)
return output
Modified: trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py (268596 => 268597)
--- trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py 2020-10-16 17:45:39 UTC (rev 268596)
+++ trunk/Tools/Scripts/webkitpy/thirdparty/__init__.py 2020-10-16 17:49:59 UTC (rev 268597)
@@ -93,9 +93,7 @@
# Note: all of the methods must follow the "_install_XXX" convention in
# order for autoinstall_everything(), below, to work properly.
- if '.pylint' in fullname:
- self._install_pylint()
- elif '.buildbot' in fullname:
+ if '.buildbot' in fullname:
self._install_buildbot()
elif '.keyring' in fullname:
self._install_keyring()
@@ -157,20 +155,6 @@
finally:
sys.stdout = sys.__stdout__
-
- def _install_pylint(self):
- self._ensure_autoinstalled_dir_is_in_sys_path()
- if (not self._fs.exists(self._fs.join(_AUTOINSTALLED_DIR, "pylint")) or
- not self._fs.exists(self._fs.join(_AUTOINSTALLED_DIR, "logilab/astng")) or
- not self._fs.exists(self._fs.join(_AUTOINSTALLED_DIR, "logilab/common"))):
- installer = AutoInstaller(target_dir=_AUTOINSTALLED_DIR)
- files_to_remove = []
- if sys.platform == 'win32':
- files_to_remove = ['test/data/write_protected_file.txt']
- installer.install("https://files.pythonhosted.org/packages/source/l/logilab-common/logilab-common-0.58.1.tar.gz", url_subpath="logilab-common-0.58.1", target_name="logilab/common", files_to_remove=files_to_remove)
- installer.install("https://files.pythonhosted.org/packages/source/l/logilab-astng/logilab-astng-0.24.1.tar.gz", url_subpath="logilab-astng-0.24.1", target_name="logilab/astng")
- installer.install('https://files.pythonhosted.org/packages/source/p/pylint/pylint-0.25.2.tar.gz', url_subpath="pylint-0.25.2", target_name="pylint")
-
# autoinstalled.buildbot is used by BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py
# and should ideally match the version of BuildBot used at build.webkit.org.
def _install_buildbot(self):
Modified: trunk/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py (268596 => 268597)
--- trunk/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py 2020-10-16 17:45:39 UTC (rev 268596)
+++ trunk/Tools/Scripts/webkitpy/thirdparty/__init___unittest.py 2020-10-16 17:49:59 UTC (rev 268597)
@@ -37,5 +37,3 @@
# This method tests that we can actually import everything.
# unused-variable, import failures - pylint: disable-msg=W0612,E0611,F0401
import webkitpy.thirdparty.autoinstalled.buildbot
- import webkitpy.thirdparty.autoinstalled.mechanize
- import webkitpy.thirdparty.autoinstalled.pylint