Title: [268518] trunk/Tools
Revision
268518
Author
[email protected]
Date
2020-10-15 03:44:38 -0700 (Thu, 15 Oct 2020)

Log Message

webkitpy: Fix remaining pytest autoinstall imports
https://bugs.webkit.org/show_bug.cgi?id=217694

Reviewed by Carlos Garcia Campos.

* Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Bump mini
version due to argument rename below.
* Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:
(Package.__init__): Change argument name to communicate that the first
arg is the name of the package to be imported.
* Scripts/webkitpy/__init__.py: Some changes:
- Downgrade attr to a compatible version with the pytest used.
- Fix pytest_timeout import name
- Downgrade pytest to 3.x. Version 4.x deprecated direct invocation of
fixtures, which is still used by W3C webdriver test code.

* Scripts/webkitpy/webdriver_tests/pytest_runner.py:
(run): Avoid using pytest autoload features to ensure it would import
plugins like pytest_timeout, triggering their install.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (268517 => 268518)


--- trunk/Tools/ChangeLog	2020-10-15 08:09:38 UTC (rev 268517)
+++ trunk/Tools/ChangeLog	2020-10-15 10:44:38 UTC (rev 268518)
@@ -1,3 +1,25 @@
+2020-10-15  Lauro Moura  <[email protected]>
+
+        webkitpy: Fix remaining pytest autoinstall imports
+        https://bugs.webkit.org/show_bug.cgi?id=217694
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Bump mini
+        version due to argument rename below.
+        * Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py:
+        (Package.__init__): Change argument name to communicate that the first
+        arg is the name of the package to be imported.
+        * Scripts/webkitpy/__init__.py: Some changes:
+        - Downgrade attr to a compatible version with the pytest used.
+        - Fix pytest_timeout import name
+        - Downgrade pytest to 3.x. Version 4.x deprecated direct invocation of
+        fixtures, which is still used by W3C webdriver test code.
+
+        * Scripts/webkitpy/webdriver_tests/pytest_runner.py:
+        (run): Avoid using pytest autoload features to ensure it would import
+        plugins like pytest_timeout, triggering their install.
+
 2020-10-14  Ryosuke Niwa  <[email protected]>
 
         IPC testing JS API should expose a reply and describe the list of arguments for each message

Modified: trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py (268517 => 268518)


--- trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py	2020-10-15 08:09:38 UTC (rev 268517)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py	2020-10-15 10:44:38 UTC (rev 268518)
@@ -35,7 +35,7 @@
 from webkitcorepy.subprocess_utils import TimeoutExpired, CompletedProcess, run
 from webkitcorepy.output_capture import LoggerCapture, OutputCapture, OutputDuplicate
 
-version = Version(0, 4, 16)
+version = Version(0, 4, 17)
 
 from webkitcorepy.autoinstall import Package, AutoInstall
 if sys.version_info > (3, 0):

Modified: trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py (268517 => 268518)


--- trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py	2020-10-15 08:09:38 UTC (rev 268517)
+++ trunk/Tools/Scripts/libraries/webkitcorepy/webkitcorepy/autoinstall.py	2020-10-15 10:44:38 UTC (rev 268518)
@@ -93,8 +93,8 @@
             else:
                 raise OSError('{} has an  unrecognized package format'.format(self.path))
 
-    def __init__(self, name, version=None, pypi_name=None, slow_install=False, wheel=False, aliases=None):
-        self.name = name
+    def __init__(self, import_name, version=None, pypi_name=None, slow_install=False, wheel=False, aliases=None):
+        self.name = import_name
         self.version = version
         self._archives = []
         self.pypi_name = pypi_name or self.name

Modified: trunk/Tools/Scripts/webkitpy/__init__.py (268517 => 268518)


--- trunk/Tools/Scripts/webkitpy/__init__.py	2020-10-15 08:09:38 UTC (rev 268517)
+++ trunk/Tools/Scripts/webkitpy/__init__.py	2020-10-15 10:44:38 UTC (rev 268518)
@@ -31,7 +31,7 @@
 AutoInstall.set_directory(os.path.join(libraries, 'autoinstalled', 'python-{}'.format(sys.version_info[0])))
 
 AutoInstall.register(Package('atomicwrites', Version(1, 4, 0)))
-AutoInstall.register(Package('attr', Version(20, 1, 0), pypi_name='attrs'))
+AutoInstall.register(Package('attr', Version(19, 1, 0), pypi_name='attrs'))
 AutoInstall.register(Package('configparser', Version(4, 0, 2)))
 AutoInstall.register(Package('contextlib2', Version(0, 6, 0)))
 AutoInstall.register(Package('coverage', Version(5, 2, 1)))
@@ -46,8 +46,9 @@
 AutoInstall.register(Package('pathlib2', Version(2, 3, 5)))
 AutoInstall.register(Package('pluggy', Version(0, 13, 1)))
 AutoInstall.register(Package('py', Version(1, 9, 0)))
-AutoInstall.register(Package('pytest-timeout', Version(1, 4, 2)))
-AutoInstall.register(Package('pytest', Version(4, 6, 11)))
+AutoInstall.register(Package('pytest_timeout', Version(1, 4, 2), pypi_name='pytest-timeout'))
+# 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('scandir', Version(1, 10, 0)))
 AutoInstall.register(Package('selenium', Version(3, 141, 0)))

Modified: trunk/Tools/Scripts/webkitpy/webdriver_tests/pytest_runner.py (268517 => 268518)


--- trunk/Tools/Scripts/webkitpy/webdriver_tests/pytest_runner.py	2020-10-15 08:09:38 UTC (rev 268517)
+++ trunk/Tools/Scripts/webkitpy/webdriver_tests/pytest_runner.py	2020-10-15 10:44:38 UTC (rev 268518)
@@ -189,6 +189,10 @@
     _environ = dict(os.environ)
     os.environ.clear()
     os.environ.update(env)
+    # Disable autoload magic to avoid issues with webkitcorepy AutoInstall
+    # This will force pytest to actually import the desired plugins, which
+    # will trigger the AutoInstall procedure.
+    os.environ['PYTEST_DISABLE_PLUGIN_AUTOLOAD'] = '1'
 
     with TemporaryDirectory() as cache_directory:
         try:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to